diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 390df0c3ed..c9c83c77c4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2504,7 +2504,7 @@ /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz /types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @richseviora /types/react-app/ @prakarshpandey -/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne +/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch /types/react-body-classname/ @mhegazy /types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @katbusch /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar diff --git a/notNeededPackages.json b/notNeededPackages.json index e94e48189c..28a60b5ac1 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -294,6 +294,12 @@ "sourceRepoURL": "https://github.com/fpellet/jquery.ajaxFile", "asOfVersion": "0.2.29" }, + { + "libraryName": "js-data", + "typingsPackageName": "js-data", + "sourceRepoURL": "https://github.com/js-data/js-data", + "asOfVersion": "3.0.0" + }, { "libraryName": "JSNLog", "typingsPackageName": "jsnlog", @@ -348,6 +354,12 @@ "sourceRepoURL": "https://github.com/steelsojka/lodash-decorators", "asOfVersion": "4.0.0" }, + { + "libraryName": "log4js", + "typingsPackageName": "log4js", + "sourceRepoURL": "https://github.com/nomiddlename/log4js-node", + "asOfVersion": "2.3.5" + }, { "libraryName": "lower-case", "typingsPackageName": "lower-case", @@ -390,6 +402,12 @@ "sourceRepoURL": "https://github.com/moment/moment", "asOfVersion": "2.13.0" }, + { + "libraryName": "MQTT", + "typingsPackageName": "mqtt", + "sourceRepoURL": "https://github.com/mqttjs/MQTT.js", + "asOfVersion": "2.5.0" + }, { "libraryName": "ng-table", "typingsPackageName": "ng-table", @@ -468,6 +486,12 @@ "sourceRepoURL": "https://github.com/r3mi/poly2tri.js", "asOfVersion": "1.4.0" }, + { + "libraryName": "popper.js", + "typingsPackageName": "popper.js", + "sourceRepoURL": "https://github.com/FezVrasta/popper.js/", + "asOfVersion": "1.11.0" + }, { "libraryName": "Prando", "typingsPackageName": "prando", @@ -504,6 +528,12 @@ "sourceRepoURL": "https://github.com/gpbl/react-day-picker", "asOfVersion": "5.3.0" }, + { + "libraryName": "realm", + "typingsPackageName": "realm", + "sourceRepoURL": "https://github.com/realm/realm-js", + "asOfVersion": "1.13.0" + }, { "libraryName": "Redux", "typingsPackageName": "redux", diff --git a/types/abbrev/tsconfig.json b/types/abbrev/tsconfig.json index 95c20ed32a..0755c19fe1 100644 --- a/types/abbrev/tsconfig.json +++ b/types/abbrev/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "abbrev-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ably/tsconfig.json b/types/ably/tsconfig.json index 86c7bc0114..844463ce68 100644 --- a/types/ably/tsconfig.json +++ b/types/ably/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/abs/tsconfig.json b/types/abs/tsconfig.json index 8921c60cd0..2bcb3f7094 100644 --- a/types/abs/tsconfig.json +++ b/types/abs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/absolute/tsconfig.json b/types/absolute/tsconfig.json index d12e097c74..ba18df791e 100644 --- a/types/absolute/tsconfig.json +++ b/types/absolute/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/acc-wizard/tsconfig.json b/types/acc-wizard/tsconfig.json index 96105a9957..a20aeba97b 100644 --- a/types/acc-wizard/tsconfig.json +++ b/types/acc-wizard/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/accept-language-parser/tsconfig.json b/types/accept-language-parser/tsconfig.json index adcad2bc16..11532082db 100644 --- a/types/accept-language-parser/tsconfig.json +++ b/types/accept-language-parser/tsconfig.json @@ -1,15 +1,23 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": ["index.d.ts", "accept-language-parser-tests.ts"] -} + "files": [ + "index.d.ts", + "accept-language-parser-tests.ts" + ] +} \ No newline at end of file diff --git a/types/accepts/tsconfig.json b/types/accepts/tsconfig.json index 8df97d74f7..35b618292d 100644 --- a/types/accepts/tsconfig.json +++ b/types/accepts/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/accounting/tsconfig.json b/types/accounting/tsconfig.json index 7ce026ff30..f815c5b01e 100644 --- a/types/accounting/tsconfig.json +++ b/types/accounting/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ace/tsconfig.json b/types/ace/tsconfig.json index 799f241178..eb52fff185 100644 --- a/types/ace/tsconfig.json +++ b/types/ace/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/acl/tsconfig.json b/types/acl/tsconfig.json index b485f342af..9f5c6a01ef 100644 --- a/types/acl/tsconfig.json +++ b/types/acl/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/acorn/tsconfig.json b/types/acorn/tsconfig.json index fbdc652a87..0b4760b0fc 100644 --- a/types/acorn/tsconfig.json +++ b/types/acorn/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/actioncable/tsconfig.json b/types/actioncable/tsconfig.json index d985971a65..cb137a8982 100644 --- a/types/actioncable/tsconfig.json +++ b/types/actioncable/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-access/tsconfig.json b/types/activex-access/tsconfig.json index 6537f2d47b..a376fcb722 100644 --- a/types/activex-access/tsconfig.json +++ b/types/activex-access/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-adodb/tsconfig.json b/types/activex-adodb/tsconfig.json index 81c6088e56..5cb32f94c9 100644 --- a/types/activex-adodb/tsconfig.json +++ b/types/activex-adodb/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-dao/tsconfig.json b/types/activex-dao/tsconfig.json index d23ed8dfe1..2ddea247b9 100644 --- a/types/activex-dao/tsconfig.json +++ b/types/activex-dao/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-excel/tsconfig.json b/types/activex-excel/tsconfig.json index c8352aacb4..244ab1d0ef 100644 --- a/types/activex-excel/tsconfig.json +++ b/types/activex-excel/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-infopath/tsconfig.json b/types/activex-infopath/tsconfig.json index 07443b0f79..6feef8496c 100644 --- a/types/activex-infopath/tsconfig.json +++ b/types/activex-infopath/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-libreoffice/index.d.ts b/types/activex-libreoffice/index.d.ts index be16c1441a..1698317e8f 100644 --- a/types/activex-libreoffice/index.d.ts +++ b/types/activex-libreoffice/index.d.ts @@ -12,9 +12,8 @@ declare class sequence { private typekey: sequence; } -declare class SafeArray { - private typekey: SafeArray; -} +// tslint:disable-next-line no-empty-interface +interface SafeArray {} declare namespace com.sun.star { namespace accessibility { diff --git a/types/activex-libreoffice/tsconfig.json b/types/activex-libreoffice/tsconfig.json index f17c193b97..712ea46ca1 100644 --- a/types/activex-libreoffice/tsconfig.json +++ b/types/activex-libreoffice/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-msforms/tsconfig.json b/types/activex-msforms/tsconfig.json index 3b7ce9f67c..38f907552d 100644 --- a/types/activex-msforms/tsconfig.json +++ b/types/activex-msforms/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-mshtml/tsconfig.json b/types/activex-mshtml/tsconfig.json index 05d416fdbb..deba2b6ba3 100644 --- a/types/activex-mshtml/tsconfig.json +++ b/types/activex-mshtml/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-msxml2/tsconfig.json b/types/activex-msxml2/tsconfig.json index 96a984bd36..49c53f71ca 100644 --- a/types/activex-msxml2/tsconfig.json +++ b/types/activex-msxml2/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-office/tsconfig.json b/types/activex-office/tsconfig.json index 9fc37a1754..729657e813 100644 --- a/types/activex-office/tsconfig.json +++ b/types/activex-office/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-outlook/tsconfig.json b/types/activex-outlook/tsconfig.json index 79f59c68a1..1a9fddc714 100644 --- a/types/activex-outlook/tsconfig.json +++ b/types/activex-outlook/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-powerpoint/activex-powerpoint-tests.ts b/types/activex-powerpoint/activex-powerpoint-tests.ts index 0d161081f8..3f2bedf8cd 100644 --- a/types/activex-powerpoint/activex-powerpoint-tests.ts +++ b/types/activex-powerpoint/activex-powerpoint-tests.ts @@ -1,4 +1,5 @@ -const collectionToArray = (col: any) => { +// tslint:disable-next-line no-unnecessary-generics +const collectionToArray = (col: any): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); diff --git a/types/activex-powerpoint/tsconfig.json b/types/activex-powerpoint/tsconfig.json index 148adf0197..8a0392da3f 100644 --- a/types/activex-powerpoint/tsconfig.json +++ b/types/activex-powerpoint/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-scripting/tsconfig.json b/types/activex-scripting/tsconfig.json index e237423341..e2008551fd 100644 --- a/types/activex-scripting/tsconfig.json +++ b/types/activex-scripting/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-stdole/tsconfig.json b/types/activex-stdole/tsconfig.json index 5ce15cf560..cbe3ce7aae 100644 --- a/types/activex-stdole/tsconfig.json +++ b/types/activex-stdole/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-vbide/activex-vbide-tests.ts b/types/activex-vbide/activex-vbide-tests.ts index f94491f8cb..c3d92e51cf 100644 --- a/types/activex-vbide/activex-vbide-tests.ts +++ b/types/activex-vbide/activex-vbide-tests.ts @@ -1,6 +1,5 @@ -/// - -const collectionToArray = (col: any) => { +// tslint:disable-next-line no-unnecessary-generics +const collectionToArray = (col: any): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); diff --git a/types/activex-vbide/tsconfig.json b/types/activex-vbide/tsconfig.json index c0c819dde7..6fb205a3c4 100644 --- a/types/activex-vbide/tsconfig.json +++ b/types/activex-vbide/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-wia/tsconfig.json b/types/activex-wia/tsconfig.json index b98459223d..e77b3d1b66 100644 --- a/types/activex-wia/tsconfig.json +++ b/types/activex-wia/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/activex-word/activex-word-tests.ts b/types/activex-word/activex-word-tests.ts index d93a5f4e16..4a0000e6fa 100644 --- a/types/activex-word/activex-word-tests.ts +++ b/types/activex-word/activex-word-tests.ts @@ -1,4 +1,5 @@ -const collectionToArray = (col: any) => { +// tslint:disable-next-line no-unnecessary-generics +const collectionToArray = (col: any): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); diff --git a/types/activex-word/tsconfig.json b/types/activex-word/tsconfig.json index feeb1b5858..c62626ca52 100644 --- a/types/activex-word/tsconfig.json +++ b/types/activex-word/tsconfig.json @@ -1,11 +1,14 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5", + "scripthost" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/adal/tsconfig.json b/types/adal/tsconfig.json index 236017077a..a024918b3a 100644 --- a/types/adal/tsconfig.json +++ b/types/adal/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/add2home/tsconfig.json b/types/add2home/tsconfig.json index ff9b311d2b..904e5e7453 100644 --- a/types/add2home/tsconfig.json +++ b/types/add2home/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/adm-zip/tsconfig.json b/types/adm-zip/tsconfig.json index 3287d252d6..8e998c6f38 100644 --- a/types/adm-zip/tsconfig.json +++ b/types/adm-zip/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/adone/tsconfig.json b/types/adone/tsconfig.json index d472e48dba..c23bf82155 100644 --- a/types/adone/tsconfig.json +++ b/types/adone/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -63,4 +64,4 @@ "test/glosses/compressors.ts", "test/glosses/archives.ts" ] -} +} \ No newline at end of file diff --git a/types/aframe/tsconfig.json b/types/aframe/tsconfig.json index f11ddb6188..3385a8aca7 100755 --- a/types/aframe/tsconfig.json +++ b/types/aframe/tsconfig.json @@ -1,25 +1,26 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es5", - "dom", - "es2015.iterable", - "es2015.promise" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "aframe-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "dom", + "es2015.iterable", + "es2015.promise" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "aframe-tests.ts" + ] } \ No newline at end of file diff --git a/types/agenda/tsconfig.json b/types/agenda/tsconfig.json index 22adf1f746..0a553809fd 100644 --- a/types/agenda/tsconfig.json +++ b/types/agenda/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aggregate-error/tsconfig.json b/types/aggregate-error/tsconfig.json index 253c743b98..f092ab1c3e 100644 --- a/types/aggregate-error/tsconfig.json +++ b/types/aggregate-error/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "aggregate-error-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/alertify/tsconfig.json b/types/alertify/tsconfig.json index 56d098af47..86ae0eac3d 100644 --- a/types/alertify/tsconfig.json +++ b/types/alertify/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/alexa-sdk/tsconfig.json b/types/alexa-sdk/tsconfig.json index 26757de01c..acc11c8263 100644 --- a/types/alexa-sdk/tsconfig.json +++ b/types/alexa-sdk/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/alexa-voice-service/tsconfig.json b/types/alexa-voice-service/tsconfig.json index 70cb9b2201..737cccf9e6 100644 --- a/types/alexa-voice-service/tsconfig.json +++ b/types/alexa-voice-service/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/algebra.js/tsconfig.json b/types/algebra.js/tsconfig.json index 9fb8a64bcc..e9f585ef8a 100644 --- a/types/algebra.js/tsconfig.json +++ b/types/algebra.js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "algebra.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 1bb77a50e9..d848642dc0 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for algoliasearch-client-js 3.18.1 +// Type definitions for algoliasearch-client-js 3.18.2 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle +// Haroen Viaene +// Aurélien Hervé // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace algoliasearch { @@ -145,7 +147,7 @@ declare namespace algoliasearch { * @param filters * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey */ - generateSecuredApiKey(key: string, filters: AlgoliaSecuredApiOptions): void; + generateSecuredApiKey(key: string, filters: AlgoliaSecuredApiOptions): string; /** * Perform multiple operations with one API call to reduce latency * @param action @@ -325,7 +327,7 @@ declare namespace algoliasearch { * @param cb(err, res) * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - saveObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + saveObjects(objects: object[], cb: (err: Error, res: any) => void): void; /** * Update parameters of a specific object * @param object @@ -539,7 +541,7 @@ declare namespace algoliasearch { * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - saveObjects(objects: [{}]): Promise ; + saveObjects(objects: object[]): Promise ; /** * Update parameters of a specific object * @param object @@ -808,10 +810,9 @@ declare namespace algoliasearch { interface AlgoliaAction { /** * Type of the batch action - * values: addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch */ - action: string; + action: "addObject" | "updateObject" | "partialUpdateObject" | "partialUpdateObjectNoCreate" | "deleteObject" | "delete" | "clear"; /** * Name of the index where the bact will be performed * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch @@ -924,10 +925,9 @@ declare namespace algoliasearch { objectID: string; /** * Type of synonym - * values: synonym,oneWaySynonym * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym */ - type: string; + type: "synonym" | "oneWaySynonym"; /** * Values used for the synonym * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym diff --git a/types/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json index 5c32bb92c1..3358732ba3 100644 --- a/types/algoliasearch/tsconfig.json +++ b/types/algoliasearch/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/alt/tsconfig.json b/types/alt/tsconfig.json index 9d70eb5d76..82260e525d 100644 --- a/types/alt/tsconfig.json +++ b/types/alt/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amazon-product-api/amazon-product-api-tests.ts b/types/amazon-product-api/amazon-product-api-tests.ts index 0a02153236..37682a11aa 100644 --- a/types/amazon-product-api/amazon-product-api-tests.ts +++ b/types/amazon-product-api/amazon-product-api-tests.ts @@ -3,7 +3,7 @@ declare var process: { env: any }; import amazon = require('amazon-product-api'); -var client = amazon.createClient({ +let client = amazon.createClient({ awsId: process.env.AWS_ACCESS_KEY_ID, awsSecret: process.env.AWS_SECRET, awsTag: process.env.AWS_ASSOCIATE_TAG @@ -12,7 +12,7 @@ var client = amazon.createClient({ // Item Search -var searchQuery = { +let searchQuery = { director: 'Quentin Tarantino', actor: 'Samuel L. Jackson', searchIndex: 'DVD', @@ -37,11 +37,11 @@ client.itemSearch(searchQuery, (err, results) => { // Item Lookup -var lookupQuery = { +let lookupQuery = { itemId: 'B00008OE6I', idType: 'ASIN', responseGroup: 'OfferFull', - Condition: 'All' + condition: 'All' }; client.itemLookup(lookupQuery).then((results) => { @@ -58,9 +58,22 @@ client.itemLookup(lookupQuery, (err, results) => { console.log(getResultCount(results) + " lookup results"); }); +let lookupQueryWithItemIdArray = { + itemId: ['B00008OE6I', 'B00008OE6E'], + idType: 'ASIN', + responseGroup: 'OfferFull', + condition: 'All' +}; + +client.itemLookup(lookupQueryWithItemIdArray).then((results) => { + console.log(getResultCount(results) + " lookup results"); +}).catch(function(err){ + console.log(err); +}); + // Browse Node Lookup -var nodeLookupQuery = { +let nodeLookupQuery = { browseNodeId: '2625373011' }; @@ -81,4 +94,4 @@ client.browseNodeLookup(nodeLookupQuery, (err, results) => { function getResultCount(results: Object[]) { return results != undefined ? results.length : 0; -} \ No newline at end of file +} diff --git a/types/amazon-product-api/index.d.ts b/types/amazon-product-api/index.d.ts index 797adf45f4..34bafd04f4 100644 --- a/types/amazon-product-api/index.d.ts +++ b/types/amazon-product-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for amazon-product-api // Project: https://github.com/t3chnoboy/amazon-product-api -// Definitions by: Matti Lehtinen +// Definitions by: Matti Lehtinen , Alex Leon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,10 +15,35 @@ interface IAmazonProductQueryCallback { (err: string, results: Object[]): void; } +interface IItemSearchOptions { + condition?: string; + keywords?: string; + responseGroup?: string; + searchIndex?: string; + itemPage?: number; + sort?: string; +} + +interface IItemLookupOptions { + condition?: string; + idType?: string; + includeReviewsSummary?: boolean; + itemId?: string | string[]; + responseGroup?: string; + searchIndex?: string; + truncateReviewsAt?: number; + variationPage?: string; +} + +interface IBrowseNodeLookupOptions { + browseNodeId?: string; + responseGroup?: string; +} + interface IAmazonProductClient { - itemSearch(query: any, callback?: IAmazonProductQueryCallback): Promise; - itemLookup(query: any, callback?: IAmazonProductQueryCallback): Promise; - browseNodeLookup(query: any, callback?: IAmazonProductQueryCallback): Promise; + itemSearch(query: IItemSearchOptions, callback?: IAmazonProductQueryCallback): Promise; + itemLookup(query: IItemLookupOptions, callback?: IAmazonProductQueryCallback): Promise; + browseNodeLookup(query: IBrowseNodeLookupOptions, callback?: IAmazonProductQueryCallback): Promise; } export declare function createClient(credentials: ICredentials): IAmazonProductClient; diff --git a/types/amazon-product-api/tsconfig.json b/types/amazon-product-api/tsconfig.json index 900bf22474..060741740b 100644 --- a/types/amazon-product-api/tsconfig.json +++ b/types/amazon-product-api/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amcharts/tsconfig.json b/types/amcharts/tsconfig.json index 9661cf12ad..fa1c069762 100644 --- a/types/amcharts/tsconfig.json +++ b/types/amcharts/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amplify-deferred/tsconfig.json b/types/amplify-deferred/tsconfig.json index fc6466d629..443772e942 100644 --- a/types/amplify-deferred/tsconfig.json +++ b/types/amplify-deferred/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amplify/tsconfig.json b/types/amplify/tsconfig.json index c30882c681..44daa69ba9 100644 --- a/types/amplify/tsconfig.json +++ b/types/amplify/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amplitude-js/tsconfig.json b/types/amplitude-js/tsconfig.json index ec0c948bff..0ca8f85efe 100644 --- a/types/amplitude-js/tsconfig.json +++ b/types/amplitude-js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amqp-rpc/tsconfig.json b/types/amqp-rpc/tsconfig.json index 0f5df30f7c..f8bfc7aa64 100644 --- a/types/amqp-rpc/tsconfig.json +++ b/types/amqp-rpc/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/amqp/amqp-tests.ts b/types/amqp/amqp-tests.ts index 7940f44ed4..dfe38f2676 100644 --- a/types/amqp/amqp-tests.ts +++ b/types/amqp/amqp-tests.ts @@ -3,6 +3,7 @@ import * as amqp from 'amqp'; async function connect() { const promise = new Promise((resolve, reject) => { const client = amqp.createConnection({ + clientProperties: { applicationName: 'typing' }, url: 'amqp://admin:password@localhost:5672' }); diff --git a/types/amqp/index.d.ts b/types/amqp/index.d.ts index ea7d6bcc65..ca39ce4404 100644 --- a/types/amqp/index.d.ts +++ b/types/amqp/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for amqp 0.2 // Project: https://github.com/postwait/node-amqp // Definitions by: Carl Winkler +// Mark Line // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -90,7 +91,7 @@ export interface ConnectionOptions { url?: string; port?: number; login?: string; - passowrd?: string; + password?: string; connectionTimeout?: number; authMechanism?: string; vhost?: string; @@ -125,6 +126,19 @@ export interface ConnectionOptions { /** Default: 1000 */ reconnectBackoffTime?: number; + + clientProperties?: { + applicationName?: string; + capabilities?: { + consumer_cancel_notify?: boolean + } + /** Default: 'node-' + process.version */ + platform?: string; + /** Default: node-amqp */ + product?: string; + /** Default: 'nodeAMQPVersion' */ + version?: string; + }; } export interface QueueOptions { diff --git a/types/amqp/tsconfig.json b/types/amqp/tsconfig.json index 2b9b4d5ce9..e73b54d700 100644 --- a/types/amqp/tsconfig.json +++ b/types/amqp/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "amqp-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/amqplib/tsconfig.json b/types/amqplib/tsconfig.json index 16ed704846..b5b83b84ce 100644 --- a/types/amqplib/tsconfig.json +++ b/types/amqplib/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "callback_api.d.ts", "amqplib-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/analytics-node/tsconfig.json b/types/analytics-node/tsconfig.json index e29c706061..3684577e65 100644 --- a/types/analytics-node/tsconfig.json +++ b/types/analytics-node/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-agility/tsconfig.json b/types/angular-agility/tsconfig.json index e93788ab40..460060cde0 100644 --- a/types/angular-agility/tsconfig.json +++ b/types/angular-agility/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-animate/tsconfig.json b/types/angular-animate/tsconfig.json index 1401eeeedb..d34d6a1d77 100644 --- a/types/angular-animate/tsconfig.json +++ b/types/angular-animate/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-block-ui/tsconfig.json b/types/angular-block-ui/tsconfig.json index b1b705a6e5..f5717731be 100644 --- a/types/angular-block-ui/tsconfig.json +++ b/types/angular-block-ui/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "angular-block-ui-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-bootstrap-calendar/tsconfig.json b/types/angular-bootstrap-calendar/tsconfig.json index d568befb6b..72a05b7ce7 100644 --- a/types/angular-bootstrap-calendar/tsconfig.json +++ b/types/angular-bootstrap-calendar/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-bootstrap-lightbox/tsconfig.json b/types/angular-bootstrap-lightbox/tsconfig.json index 2bf84b358f..3792bc3da5 100644 --- a/types/angular-bootstrap-lightbox/tsconfig.json +++ b/types/angular-bootstrap-lightbox/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-breadcrumb/tsconfig.json b/types/angular-breadcrumb/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/angular-breadcrumb/tsconfig.json +++ b/types/angular-breadcrumb/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-clipboard/tsconfig.json b/types/angular-clipboard/tsconfig.json index 4e95bc9714..0c6a1dadaf 100644 --- a/types/angular-clipboard/tsconfig.json +++ b/types/angular-clipboard/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-cookie/tsconfig.json b/types/angular-cookie/tsconfig.json index 8bceb7e77b..ae3ec8dd21 100644 --- a/types/angular-cookie/tsconfig.json +++ b/types/angular-cookie/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-cookies/tsconfig.json b/types/angular-cookies/tsconfig.json index 1401eeeedb..d34d6a1d77 100644 --- a/types/angular-cookies/tsconfig.json +++ b/types/angular-cookies/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-deferred-bootstrap/tsconfig.json b/types/angular-deferred-bootstrap/tsconfig.json index 5eda2c3552..119199cc5a 100644 --- a/types/angular-deferred-bootstrap/tsconfig.json +++ b/types/angular-deferred-bootstrap/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-dialog-service/tsconfig.json b/types/angular-dialog-service/tsconfig.json index 4c40df5788..b6db392406 100644 --- a/types/angular-dialog-service/tsconfig.json +++ b/types/angular-dialog-service/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-dynamic-locale/tsconfig.json b/types/angular-dynamic-locale/tsconfig.json index 85e4234b51..b117d5eabe 100644 --- a/types/angular-dynamic-locale/tsconfig.json +++ b/types/angular-dynamic-locale/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-environment/tsconfig.json b/types/angular-environment/tsconfig.json index 8c7dbd4b39..35bd754e95 100644 --- a/types/angular-environment/tsconfig.json +++ b/types/angular-environment/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-es/tsconfig.json b/types/angular-es/tsconfig.json index 27a6433555..8eb4ea8925 100644 --- a/types/angular-es/tsconfig.json +++ b/types/angular-es/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "experimentalDecorators": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/angular-feature-flags/tsconfig.json b/types/angular-feature-flags/tsconfig.json index 43e952a681..07b352a43c 100644 --- a/types/angular-feature-flags/tsconfig.json +++ b/types/angular-feature-flags/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-file-saver/tsconfig.json b/types/angular-file-saver/tsconfig.json index 358d72c750..60a3fb0eca 100644 --- a/types/angular-file-saver/tsconfig.json +++ b/types/angular-file-saver/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-file-upload/tsconfig.json b/types/angular-file-upload/tsconfig.json index 310d96da7c..11194d71d0 100644 --- a/types/angular-file-upload/tsconfig.json +++ b/types/angular-file-upload/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "angular-file-upload-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-formly/angular-formly-tests.ts b/types/angular-formly/angular-formly-tests.ts index b78c8a1257..d053660362 100644 --- a/types/angular-formly/angular-formly-tests.ts +++ b/types/angular-formly/angular-formly-tests.ts @@ -14,6 +14,19 @@ class FormConfig { templateUrl: 'my-messages.html' }); + formlyConfig.setWrapper([ + { + name: 'validation-0', + types: ['input-0', 'customInput-0'], + templateUrl: 'my-messages-0.html' + }, + { + name: 'validation-1', + types: ['input-1', 'customInput-1'], + templateUrl: 'my-messages-1.html' + } + ]); + formlyValidationMessages.addStringMessage('required', 'This field is required'); formlyConfig.setType({ @@ -21,14 +34,14 @@ class FormConfig { extends: 'input' }); - formlyConfig.disableWarnings = true; + formlyConfig.disableWarnings = true; formlyConfig.templateManipulators = undefined; formlyConfig.extras.apiCheckInstance = null; formlyConfig.extras.defaultHideDirective = 'ng-if'; formlyConfig.extras.disableNgModelAttrsManipulator = true; formlyConfig.extras.errorExistsAndShouldBeVisibleExpression = angular.noop; - formlyConfig.extras.explicitAsync = true; + formlyConfig.extras.explicitAsync = true; formlyConfig.extras.fieldTransform = angular.noop; formlyConfig.extras.fieldTransform = [angular.noop]; formlyConfig.extras.getFieldId = angular.noop; diff --git a/types/angular-formly/index.d.ts b/types/angular-formly/index.d.ts index 8bcab28800..55c4743fc9 100644 --- a/types/angular-formly/index.d.ts +++ b/types/angular-formly/index.d.ts @@ -589,7 +589,7 @@ declare namespace AngularFormly { disableWarnings: boolean; extras: IFormlyConfigExtras; setType(typeOptions: ITypeOptions): void; - setWrapper(wrapperOptions: IWrapperOptions): void; + setWrapper(wrapperOptions: IWrapperOptions | Array): void; templateManipulators: ITemplateManipulators; } diff --git a/types/angular-formly/tsconfig.json b/types/angular-formly/tsconfig.json index 06379faf4b..3812b7cd66 100644 --- a/types/angular-formly/tsconfig.json +++ b/types/angular-formly/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-fullscreen/tsconfig.json b/types/angular-fullscreen/tsconfig.json index 6e6e8be685..72a22e0897 100644 --- a/types/angular-fullscreen/tsconfig.json +++ b/types/angular-fullscreen/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-gettext/tsconfig.json b/types/angular-gettext/tsconfig.json index 906c7b6f00..43c7dc3cab 100644 --- a/types/angular-gettext/tsconfig.json +++ b/types/angular-gettext/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-google-analytics/tsconfig.json b/types/angular-google-analytics/tsconfig.json index 78026bd417..b66432d04c 100644 --- a/types/angular-google-analytics/tsconfig.json +++ b/types/angular-google-analytics/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-gridster/tsconfig.json b/types/angular-gridster/tsconfig.json index a266d23b64..94b4c6ceff 100644 --- a/types/angular-gridster/tsconfig.json +++ b/types/angular-gridster/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-growl-v2/tsconfig.json b/types/angular-growl-v2/tsconfig.json index 30bf2cd4c1..16ccffe41f 100644 --- a/types/angular-growl-v2/tsconfig.json +++ b/types/angular-growl-v2/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-hotkeys/index.d.ts b/types/angular-hotkeys/index.d.ts index 38ff06a969..0f0be68d8e 100644 --- a/types/angular-hotkeys/index.d.ts +++ b/types/angular-hotkeys/index.d.ts @@ -10,6 +10,10 @@ import * as ng from 'angular'; +export type HotkeysProvider = ng.hotkeys.HotkeysProvider; +export type HotkeysProviderChained = ng.hotkeys.HotkeysProviderChained; +export type Hotkey = ng.hotkeys.Hotkey; + declare module 'angular' { export namespace hotkeys { diff --git a/types/angular-hotkeys/tsconfig.json b/types/angular-hotkeys/tsconfig.json index 57f3f6375b..f277241888 100644 --- a/types/angular-hotkeys/tsconfig.json +++ b/types/angular-hotkeys/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-http-auth/tsconfig.json b/types/angular-http-auth/tsconfig.json index 75f27930ba..61029fcc00 100644 --- a/types/angular-http-auth/tsconfig.json +++ b/types/angular-http-auth/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-httpi/tsconfig.json b/types/angular-httpi/tsconfig.json index b149191fb1..64c28306cf 100644 --- a/types/angular-httpi/tsconfig.json +++ b/types/angular-httpi/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-idle/tsconfig.json b/types/angular-idle/tsconfig.json index 9aa3da84d3..57cc641db8 100644 --- a/types/angular-idle/tsconfig.json +++ b/types/angular-idle/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-jwt/tsconfig.json b/types/angular-jwt/tsconfig.json index 96b47460ce..b884cbc435 100644 --- a/types/angular-jwt/tsconfig.json +++ b/types/angular-jwt/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-load/tsconfig.json b/types/angular-load/tsconfig.json index b9a8bb1819..ee5ee74b72 100644 --- a/types/angular-load/tsconfig.json +++ b/types/angular-load/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-loading-bar/angular-loading-bar-tests.ts b/types/angular-loading-bar/angular-loading-bar-tests.ts index be39a7a54d..55fbdde2a0 100644 --- a/types/angular-loading-bar/angular-loading-bar-tests.ts +++ b/types/angular-loading-bar/angular-loading-bar-tests.ts @@ -13,13 +13,12 @@ class TestController { app.controller('TestController', TestController); -var barConfig: angular.loadingBar.ILoadingBarProvider[] = []; -barConfig.push({ - includeSpinner: true, - includeBar: true, - spinnerTemplate: 'template', - latencyThreshold: 100, - startSize: 0.02, - loadingBarTemplate: '', - autoIncrement: true -}); +var barConfig: angular.loadingBar.ILoadingBarProvider; + +barConfig.includeSpinner = false; +barConfig.includeBar = false; +barConfig.spinnerTemplate = 'someOtherTemplateString'; +barConfig.latencyThreshold = 70; +barConfig.startSize = 0.05; +barConfig.loadingBarTemplate = 'anotherTemplateString'; +barConfig.autoIncrement = false; diff --git a/types/angular-loading-bar/index.d.ts b/types/angular-loading-bar/index.d.ts index 1c738aea96..61717152de 100644 --- a/types/angular-loading-bar/index.d.ts +++ b/types/angular-loading-bar/index.d.ts @@ -54,6 +54,33 @@ declare module 'angular' { * Give illusion that there's always progress */ autoIncrement?: boolean; + + /** + * Broadcast the start event + */ + start(): void; + + /** + * Set the percentage completed + * @param {number} n - number between 0 and 1 + */ + set(n: number): void; + + /** + * Get the percentage completed + * @returns {number} + */ + status(): number; + + /** + * Increment the loading bar + */ + inc(): void; + + /** + * Complete the loading bar + */ + complete(): void; } } diff --git a/types/angular-loading-bar/tsconfig.json b/types/angular-loading-bar/tsconfig.json index 24e7af55dd..f639942629 100644 --- a/types/angular-loading-bar/tsconfig.json +++ b/types/angular-loading-bar/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-local-storage/tsconfig.json b/types/angular-local-storage/tsconfig.json index 2df37e062b..44c357b558 100644 --- a/types/angular-local-storage/tsconfig.json +++ b/types/angular-local-storage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-localforage/tsconfig.json b/types/angular-localforage/tsconfig.json index 9974f90248..dc98f1186d 100644 --- a/types/angular-localforage/tsconfig.json +++ b/types/angular-localforage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-locker/tsconfig.json b/types/angular-locker/tsconfig.json index 2dfdebd8ad..35091c7ea8 100644 --- a/types/angular-locker/tsconfig.json +++ b/types/angular-locker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-material/tsconfig.json b/types/angular-material/tsconfig.json index dba3d4ed32..3ecdc4851c 100644 --- a/types/angular-material/tsconfig.json +++ b/types/angular-material/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-media-queries/tsconfig.json b/types/angular-media-queries/tsconfig.json index 7fa741764d..6a02589dc1 100644 --- a/types/angular-media-queries/tsconfig.json +++ b/types/angular-media-queries/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-meteor/tsconfig.json b/types/angular-meteor/tsconfig.json index 07f3a81313..16d4015269 100644 --- a/types/angular-meteor/tsconfig.json +++ b/types/angular-meteor/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-mocks/tsconfig.json b/types/angular-mocks/tsconfig.json index 6487dc0dba..cfce69a898 100644 --- a/types/angular-mocks/tsconfig.json +++ b/types/angular-mocks/tsconfig.json @@ -13,6 +13,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-modal/tsconfig.json b/types/angular-modal/tsconfig.json index cdbc078a59..c727f39fbb 100644 --- a/types/angular-modal/tsconfig.json +++ b/types/angular-modal/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-notifications/tsconfig.json b/types/angular-notifications/tsconfig.json index 00d57f16e1..7186df8fd5 100644 --- a/types/angular-notifications/tsconfig.json +++ b/types/angular-notifications/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-notify/tsconfig.json b/types/angular-notify/tsconfig.json index 30678a1308..a993101ea8 100644 --- a/types/angular-notify/tsconfig.json +++ b/types/angular-notify/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-oauth2/tsconfig.json b/types/angular-oauth2/tsconfig.json index e8a5250748..253e138f2f 100644 --- a/types/angular-oauth2/tsconfig.json +++ b/types/angular-oauth2/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +22,4 @@ "index.d.ts", "angular-oauth2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-odata-resources/tsconfig.json b/types/angular-odata-resources/tsconfig.json index 4bb727cafa..cf8b87b038 100644 --- a/types/angular-odata-resources/tsconfig.json +++ b/types/angular-odata-resources/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-pdfjs-viewer/tsconfig.json b/types/angular-pdfjs-viewer/tsconfig.json index a8d322df87..bdae87bf50 100644 --- a/types/angular-pdfjs-viewer/tsconfig.json +++ b/types/angular-pdfjs-viewer/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "angular-pdfjs-viewer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-permission/tsconfig.json b/types/angular-permission/tsconfig.json index dbd8053570..80dd668340 100644 --- a/types/angular-permission/tsconfig.json +++ b/types/angular-permission/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-promise-tracker/tsconfig.json b/types/angular-promise-tracker/tsconfig.json index e18793a3be..2e81cb6ea3 100644 --- a/types/angular-promise-tracker/tsconfig.json +++ b/types/angular-promise-tracker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-q-spread/tsconfig.json b/types/angular-q-spread/tsconfig.json index 4ab75ae3be..a00f0e4d5f 100644 --- a/types/angular-q-spread/tsconfig.json +++ b/types/angular-q-spread/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-resource/tsconfig.json b/types/angular-resource/tsconfig.json index 53d572b642..7599b3e12e 100644 --- a/types/angular-resource/tsconfig.json +++ b/types/angular-resource/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-route/tsconfig.json b/types/angular-route/tsconfig.json index 750627caf0..9960b488ba 100644 --- a/types/angular-route/tsconfig.json +++ b/types/angular-route/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-sanitize/tsconfig.json b/types/angular-sanitize/tsconfig.json index d3804af0bc..4ce7848518 100644 --- a/types/angular-sanitize/tsconfig.json +++ b/types/angular-sanitize/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-scenario/tsconfig.json b/types/angular-scenario/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/angular-scenario/tsconfig.json +++ b/types/angular-scenario/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-scroll/tsconfig.json b/types/angular-scroll/tsconfig.json index 09810157e8..b6d6daecb2 100644 --- a/types/angular-scroll/tsconfig.json +++ b/types/angular-scroll/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-signalr-hub/tsconfig.json b/types/angular-signalr-hub/tsconfig.json index edc7264376..d0e69b894d 100644 --- a/types/angular-signalr-hub/tsconfig.json +++ b/types/angular-signalr-hub/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-spinner/tsconfig.json b/types/angular-spinner/tsconfig.json index 9f8a416e9e..e09fc93f8e 100644 --- a/types/angular-spinner/tsconfig.json +++ b/types/angular-spinner/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-storage/tsconfig.json b/types/angular-storage/tsconfig.json index 2ddc1386e4..07dc148cef 100644 --- a/types/angular-storage/tsconfig.json +++ b/types/angular-storage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-strap/tsconfig.json b/types/angular-strap/tsconfig.json index 44616c2229..7ac157876b 100644 --- a/types/angular-strap/tsconfig.json +++ b/types/angular-strap/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-toastr/tsconfig.json b/types/angular-toastr/tsconfig.json index 9e8e395643..be88b26d08 100644 --- a/types/angular-toastr/tsconfig.json +++ b/types/angular-toastr/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-toasty/tsconfig.json b/types/angular-toasty/tsconfig.json index 66881e3acf..085335904c 100644 --- a/types/angular-toasty/tsconfig.json +++ b/types/angular-toasty/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-tooltips/tsconfig.json b/types/angular-tooltips/tsconfig.json index 945fa84c71..8465b76909 100644 --- a/types/angular-tooltips/tsconfig.json +++ b/types/angular-tooltips/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "angular-tooltips-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-touchspin/tsconfig.json b/types/angular-touchspin/tsconfig.json index 02708e0656..8c3d5338c4 100644 --- a/types/angular-touchspin/tsconfig.json +++ b/types/angular-touchspin/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-translate/tsconfig.json b/types/angular-translate/tsconfig.json index b0ed532983..7b3df3db88 100644 --- a/types/angular-translate/tsconfig.json +++ b/types/angular-translate/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-ui-bootstrap/tsconfig.json b/types/angular-ui-bootstrap/tsconfig.json index 242fd49d1e..62765ca465 100644 --- a/types/angular-ui-bootstrap/tsconfig.json +++ b/types/angular-ui-bootstrap/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-ui-notification/tsconfig.json b/types/angular-ui-notification/tsconfig.json index d46b2d1354..25e3769186 100644 --- a/types/angular-ui-notification/tsconfig.json +++ b/types/angular-ui-notification/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-ui-router/index.d.ts b/types/angular-ui-router/index.d.ts index d1f2c43b48..04e3c9341a 100644 --- a/types/angular-ui-router/index.d.ts +++ b/types/angular-ui-router/index.d.ts @@ -281,7 +281,7 @@ declare module 'angular' { current: IState; /** A param object, e.g. {sectionId: section.id)}, that you'd like to test against the current active state. */ params: IStateParamsService; - reload(): angular.IPromise; + reload(reloadState?: string | IState): angular.IPromise; /** Currently pending transition. A promise that'll resolve or reject. */ transition: angular.IPromise<{}>; diff --git a/types/angular-ui-router/tsconfig.json b/types/angular-ui-router/tsconfig.json index ebac0235fb..83aeab8d3b 100644 --- a/types/angular-ui-router/tsconfig.json +++ b/types/angular-ui-router/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-ui-scroll/tsconfig.json b/types/angular-ui-scroll/tsconfig.json index 897082b4a9..8fb95049e4 100644 --- a/types/angular-ui-scroll/tsconfig.json +++ b/types/angular-ui-scroll/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-ui-sortable/tsconfig.json b/types/angular-ui-sortable/tsconfig.json index 80410539a4..b96f69101e 100644 --- a/types/angular-ui-sortable/tsconfig.json +++ b/types/angular-ui-sortable/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-ui-tree/tsconfig.json b/types/angular-ui-tree/tsconfig.json index 15e286d17d..cb2693e910 100644 --- a/types/angular-ui-tree/tsconfig.json +++ b/types/angular-ui-tree/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-websocket/tsconfig.json b/types/angular-websocket/tsconfig.json index 124f24258b..96aab30ef0 100644 --- a/types/angular-websocket/tsconfig.json +++ b/types/angular-websocket/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-wizard/tsconfig.json b/types/angular-wizard/tsconfig.json index ff7d1da277..a87aedbbe4 100644 --- a/types/angular-wizard/tsconfig.json +++ b/types/angular-wizard/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular-xeditable/tsconfig.json b/types/angular-xeditable/tsconfig.json index 93c8382090..44cdeea7bf 100644 --- a/types/angular-xeditable/tsconfig.json +++ b/types/angular-xeditable/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular.throttle/tsconfig.json b/types/angular.throttle/tsconfig.json index 46b55f70ff..bcee04a06f 100644 --- a/types/angular.throttle/tsconfig.json +++ b/types/angular.throttle/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index c60da29504..03f7af5160 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -509,7 +509,13 @@ namespace TestInjector { } const anyFunction: Function = foobar; - const anyResult: string = $injector.invoke(anyFunction); + let anyResult: string = $injector.invoke(anyFunction); + + const inlineAnnotatedFunction: any[] = [false, foobar]; + anyResult = $injector.invoke(inlineAnnotatedFunction); + anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext', 'anyLocals'); + anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext'); + anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals'); } } diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 8415c6e6b7..bcc8ab7466 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -392,6 +392,7 @@ declare namespace angular { $rollbackViewValue(): void; $commitViewValue(): void; $isEmpty(value: any): boolean; + $overrideModelOptions(options: INgModelOptions): void; $viewValue: any; @@ -2078,7 +2079,7 @@ declare namespace angular { get(name: '$xhrFactory'): IXhrFactory; has(name: string): boolean; instantiate(typeConstructor: {new(...args: any[]): T}, locals?: any): T; - invoke(inlineAnnotatedFunction: any[]): any; + invoke(inlineAnnotatedFunction: any[], context?: any, locals?: any): any; invoke(func: (...args: any[]) => T, context?: any, locals?: any): T; invoke(func: Function, context?: any, locals?: any): any; strictDi: boolean; diff --git a/types/angular/test/jquery3-merging-tests.ts b/types/angular/test/jquery3-merging-tests.ts index 510519466b..507c58b67e 100644 --- a/types/angular/test/jquery3-merging-tests.ts +++ b/types/angular/test/jquery3-merging-tests.ts @@ -1,9 +1,11 @@ import $ = require('jquery'); import * as angular from 'angular'; +// Fix TODOs once https://github.com/Microsoft/TypeScript/issues/18910 is fixed + function JQuery() { function indexSignature() { - $('p')[0]; // $ExpectType HTMLElement + $('p')[0]; // TODO: $ExpectType HTMLElement } function addClass() { @@ -12,7 +14,7 @@ function JQuery() { // $ExpectType JQuery $('p').addClass(function(index, currentClassName) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -35,7 +37,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('alt', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -47,7 +49,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('width', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -59,7 +61,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('title', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -69,7 +71,7 @@ function JQuery() { // $ExpectType JQuery $('#greatphoto').attr('title', function(index, attr) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -96,9 +98,9 @@ function JQuery() { // $ExpectType JQuery $('p').bind('myEvent', 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -106,15 +108,15 @@ function JQuery() { $('p').bind('myEvent', 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('p').bind('myEvent', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -122,7 +124,7 @@ function JQuery() { $('p').bind('myEvent', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -133,15 +135,15 @@ function JQuery() { $('p').bind({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }); @@ -162,13 +164,13 @@ function JQuery() { } function off() { - function defaultContext_defaultData(this: HTMLElement, event: JQuery.Event) { } + function defaultContext_defaultData(this: HTMLElement, event: JQueryEventObject) { } - function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } + function defaultContext_customData(this: HTMLElement, event: JQueryEventObject) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } + function customContext_defaultData(this: I1, event: JQueryEventObject) { } - function customContext_customData(this: I1, event: JQuery.Event) { } + function customContext_customData(this: I1, event: JQueryEventObject) { } interface I1 { kind: 'I1'; } @@ -238,9 +240,9 @@ function JQuery() { // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -248,15 +250,15 @@ function JQuery() { $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').on('myEvent', null, 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -264,15 +266,15 @@ function JQuery() { $('table').on('myEvent', null, 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').on('myEvent', 'td', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -280,7 +282,7 @@ function JQuery() { $('table').on('myEvent', 'td', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -289,9 +291,9 @@ function JQuery() { // $ExpectType JQuery $('table').on('myEvent', 3, function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -299,15 +301,15 @@ function JQuery() { $('table').on('myEvent', 3, function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').on('myEvent', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -315,7 +317,7 @@ function JQuery() { $('table').on('myEvent', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -326,15 +328,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td', 'myData'); @@ -343,15 +345,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, null, 'myData'); @@ -360,15 +362,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td'); @@ -377,15 +379,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 3); @@ -394,15 +396,15 @@ function JQuery() { $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }); @@ -413,9 +415,9 @@ function JQuery() { // $ExpectType JQuery $('table').one('myEvent', 'td', 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -423,15 +425,15 @@ function JQuery() { $('table').one('myEvent', 'td', 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').one('myEvent', null, 'myData', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -439,15 +441,15 @@ function JQuery() { $('table').one('myEvent', null, 'myData', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').one('myEvent', 'td', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -455,7 +457,7 @@ function JQuery() { $('table').one('myEvent', 'td', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -464,9 +466,9 @@ function JQuery() { // $ExpectType JQuery $('table').one('myEvent', 3, function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -474,15 +476,15 @@ function JQuery() { $('table').one('myEvent', 3, function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); // $ExpectType JQuery $('table').one('myEvent', function(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -490,7 +492,7 @@ function JQuery() { $('table').one('myEvent', function(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; }); @@ -501,15 +503,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td', 'myData'); @@ -518,15 +520,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, null, 'myData'); @@ -535,15 +537,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 'td'); @@ -552,15 +554,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }, 3); @@ -569,15 +571,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; - // $ExpectType Event + // TODO: $ExpectType Event event; }, myEvent3(this: I1, event) { // $ExpectType I1 this; - // $ExpectType Event + // TODO: $ExpectType Event event; } }); @@ -589,7 +591,7 @@ function JQuery() { // $ExpectType JQuery $('p').removeClass(function(index, currentClassName) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -609,7 +611,7 @@ function JQuery() { // $ExpectType JQuery $('p').toggleClass(function(index, className, state) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; @@ -626,7 +628,7 @@ function JQuery() { // $ExpectType JQuery $('p').toggleClass(function(index, className, state) { - // $ExpectType HTMLElement + // TODO: $ExpectType HTMLElement this; // $ExpectType number index; diff --git a/types/angular/tsconfig.json b/types/angular/tsconfig.json index f102aff22f..92d1e026c3 100644 --- a/types/angular/tsconfig.json +++ b/types/angular/tsconfig.json @@ -16,6 +16,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -24,4 +25,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} +} \ No newline at end of file diff --git a/types/angular/tslint.json b/types/angular/tslint.json index 77b236700e..b0c1e9007a 100644 --- a/types/angular/tslint.json +++ b/types/angular/tslint.json @@ -14,6 +14,7 @@ "max-line-length": false, "no-empty-interface": false, "no-namespace": false, + "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, "no-void-expression": false, "unified-signatures": false, diff --git a/types/angularfire/tsconfig.json b/types/angularfire/tsconfig.json index a0e1af228c..79526d1d23 100644 --- a/types/angularfire/tsconfig.json +++ b/types/angularfire/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angularlocalstorage/tsconfig.json b/types/angularlocalstorage/tsconfig.json index bcae5a609f..18cbe35651 100644 --- a/types/angularlocalstorage/tsconfig.json +++ b/types/angularlocalstorage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/angulartics/tsconfig.json b/types/angulartics/tsconfig.json index d190dd2ab3..2cfa5bb6a9 100644 --- a/types/angulartics/tsconfig.json +++ b/types/angulartics/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/animation-frame/tsconfig.json b/types/animation-frame/tsconfig.json index aec9b43665..50f3aa0703 100644 --- a/types/animation-frame/tsconfig.json +++ b/types/animation-frame/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/animejs/tsconfig.json b/types/animejs/tsconfig.json index 506b75ade3..02c5552371 100644 --- a/types/animejs/tsconfig.json +++ b/types/animejs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "animejs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/annyang/tsconfig.json b/types/annyang/tsconfig.json index f54c7cd18c..f16b627fac 100644 --- a/types/annyang/tsconfig.json +++ b/types/annyang/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "annyang-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ansi-styles/tsconfig.json b/types/ansi-styles/tsconfig.json index 9aa9a851d4..daf091f6ce 100644 --- a/types/ansi-styles/tsconfig.json +++ b/types/ansi-styles/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ansicolors/tsconfig.json b/types/ansicolors/tsconfig.json index 27e01ecd7b..02963e3afd 100644 --- a/types/ansicolors/tsconfig.json +++ b/types/ansicolors/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/any-db-transaction/tsconfig.json b/types/any-db-transaction/tsconfig.json index 04e83c8b60..70db166ef8 100644 --- a/types/any-db-transaction/tsconfig.json +++ b/types/any-db-transaction/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/any-db/tsconfig.json b/types/any-db/tsconfig.json index 78ed339650..21170c7c68 100644 --- a/types/any-db/tsconfig.json +++ b/types/any-db/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/anybar/tsconfig.json b/types/anybar/tsconfig.json index 67676d8dbb..1dd62548e6 100644 --- a/types/anybar/tsconfig.json +++ b/types/anybar/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/anydb-sql-migrations/tsconfig.json b/types/anydb-sql-migrations/tsconfig.json index 78eef3d69a..33bb5ae800 100644 --- a/types/anydb-sql-migrations/tsconfig.json +++ b/types/anydb-sql-migrations/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/anymatch/tsconfig.json b/types/anymatch/tsconfig.json index e4fad1c219..d30a18ba98 100644 --- a/types/anymatch/tsconfig.json +++ b/types/anymatch/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "anymatch-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/apex.js/tsconfig.json b/types/apex.js/tsconfig.json index 7f4f681f45..2a67c3005a 100644 --- a/types/apex.js/tsconfig.json +++ b/types/apex.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aphrodite/tsconfig.json b/types/aphrodite/tsconfig.json index d197eb1339..733098707c 100644 --- a/types/aphrodite/tsconfig.json +++ b/types/aphrodite/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/api-error-handler/tsconfig.json b/types/api-error-handler/tsconfig.json index 63f8ed23b4..343e9007e9 100644 --- a/types/api-error-handler/tsconfig.json +++ b/types/api-error-handler/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/apigee-access/tsconfig.json b/types/apigee-access/tsconfig.json index b13dc3e8ee..3a18c6594a 100644 --- a/types/apigee-access/tsconfig.json +++ b/types/apigee-access/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/apollo-codegen/apollo-codegen-tests.ts b/types/apollo-codegen/apollo-codegen-tests.ts new file mode 100644 index 0000000000..38d9733faf --- /dev/null +++ b/types/apollo-codegen/apollo-codegen-tests.ts @@ -0,0 +1,30 @@ +import { + downloadSchema, + generate, + introspectSchema, + printSchema +} from "apollo-codegen"; + +async function main() { + await downloadSchema( + "http://example.com/graphql", + "schema.json", + {}, + false, + "POST" + ); + + generate(["input.ts"], "schema.json", "types.ts", "typescript", "gql", { + passthroughCustomScalars: false, + customScalarsPrefix: "S", + addTypename: false, + namespace: "", + operationIdsPath: null, + generateOperationIds: false, + mergeInFieldsFromFragmentSpreads: false + }); + + await introspectSchema("schema.json", "schema.gql"); + + await printSchema("schema.in", "schema.out"); +} diff --git a/types/apollo-codegen/index.d.ts b/types/apollo-codegen/index.d.ts new file mode 100644 index 0000000000..a506f7475e --- /dev/null +++ b/types/apollo-codegen/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for apollo-codegen 0.16 +// Project: https://github.com/apollographql/apollo-codegen +// Definitions by: Bradley Ayers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +export function downloadSchema( + url: string, + outputPath: string, + additionalHeaders: { [name: string]: string }, + insecure: boolean, + method: string +): Promise; + +export function introspectSchema( + schemaPath: string, + outputPath: string +): Promise; + +export function printSchema( + schemaPath: string, + outputPath: string +): Promise; + +export function generate( + inputPaths: string[], + schemaPath: string, + outputPath: string, + target: "json" | "swift" | "ts" | "typescript" | "flow" | "scala", + tagName: string, + options: { + passthroughCustomScalars: boolean; + customScalarsPrefix: string; + addTypename: boolean; + namespace: string; + operationIdsPath: string | null; + generateOperationIds: boolean; + mergeInFieldsFromFragmentSpreads: boolean; + } +): void; diff --git a/types/apollo-codegen/tsconfig.json b/types/apollo-codegen/tsconfig.json new file mode 100644 index 0000000000..a793b04d75 --- /dev/null +++ b/types/apollo-codegen/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "apollo-codegen-tests.ts" + ] +} \ No newline at end of file diff --git a/types/apollo-codegen/tslint.json b/types/apollo-codegen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/apollo-codegen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/app-root-path/tsconfig.json b/types/app-root-path/tsconfig.json index a3f43b0b45..0786aa8b6c 100644 --- a/types/app-root-path/tsconfig.json +++ b/types/app-root-path/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/appframework/tsconfig.json b/types/appframework/tsconfig.json index a672bb4b83..8ed9e604ca 100644 --- a/types/appframework/tsconfig.json +++ b/types/appframework/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/applepayjs/tsconfig.json b/types/applepayjs/tsconfig.json index 0bb26b97ac..892c52bd37 100644 --- a/types/applepayjs/tsconfig.json +++ b/types/applepayjs/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "baseUrl": "../", - "forceConsistentCasingInFileNames": true, - "lib": [ - "dom", - "es6" - ], - "module": "commonjs", - "noImplicitAny": true, - "noImplicitThis": true, - "noEmit": true, - "strictNullChecks": true, - "typeRoots": [ - "../" - ], - "types": [] - }, - "files": [ - "index.d.ts", - "applepayjs-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "forceConsistentCasingInFileNames": true, + "lib": [ + "dom", + "es6" + ], + "module": "commonjs", + "noImplicitAny": true, + "noImplicitThis": true, + "noEmit": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "typeRoots": [ + "../" + ], + "types": [] + }, + "files": [ + "index.d.ts", + "applepayjs-tests.ts" + ] +} \ No newline at end of file diff --git a/types/appletvjs/tsconfig.json b/types/appletvjs/tsconfig.json index 777e9522ba..44dc1a34db 100644 --- a/types/appletvjs/tsconfig.json +++ b/types/appletvjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/applicationinsights-js/tsconfig.json b/types/applicationinsights-js/tsconfig.json index 3a24c6f936..db2a137f6b 100644 --- a/types/applicationinsights-js/tsconfig.json +++ b/types/applicationinsights-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/applicationinsights/tsconfig.json b/types/applicationinsights/tsconfig.json index 2ee81db96d..abc81fb75c 100644 --- a/types/applicationinsights/tsconfig.json +++ b/types/applicationinsights/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/arbiter/tsconfig.json b/types/arbiter/tsconfig.json index 2b345fa427..674951954e 100644 --- a/types/arbiter/tsconfig.json +++ b/types/arbiter/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 115d270add..9202525e55 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,13 +1,14 @@ -// Type definitions for ArcGIS API for JavaScript 4.4 +// Type definitions for ArcGIS API for JavaScript 4.5 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -interface HashMap { +interface HashMap { [index: string]: T; } -interface IPromise { +interface IPromise { always(callback?: (valueOrError: T) => IPromise | U | void): IPromise; cancel?(reason?: U, strict?: boolean): U; isCanceled?(): boolean; @@ -51,43 +52,951 @@ declare namespace __esri { protected _set(propertyName: string, value: T): this; } + + export type ItemCallback = (item: T, index: number) => void; + + export type ItemCompareCallback = (firstItem: T, secondItem: T) => number; + + export type ItemMapCallback = (item: T, index: number) => R; + + export type ItemReduceCallback = (previousValue: R, currentValue: T, index: number) => R; + + export type ItemTestCallback = (item: T, index: number) => boolean; + + interface Collection extends Evented {} + + type Constructor = new (...params: any[]) => T; + + interface Types { + key: string | ((obj: any) => string); + base: Constructor | Function; + typeMap: HashMap>; + } + + export class Collection extends Accessor { + constructor(values?: any[] | Collection); + + readonly length: number; + + add(item: T, index?: number): void; + addMany(items: T[] | Collection, index?: number): void; + clone(): Collection; + concat(value: T[] | Collection): Collection; + every(callback: ItemTestCallback): boolean; + filter(callback: ItemTestCallback): Collection; + find(callback: ItemTestCallback): T; + findIndex(callback: ItemTestCallback): number; + flatten(callback: ItemCallback): Collection; + forEach(callback: ItemCallback): void; + getItemAt(index: number): T; + includes(searchElement: T): boolean; + indexOf(searchElement: T, fromIndex?: number): number; + join(separator?: string): string; + lastIndexOf(searchElement: T, fromIndex?: number): number; + map(callback: ItemMapCallback): Collection; + pop(): T; + push(item: T): number; + reduce(callback: ItemReduceCallback, initialValue?: R): R; + reduceRight(callback: ItemReduceCallback, initialValue?: R): R; + remove(item: T): void; + removeAll(): void; + removeAt(index: number): any; + removeMany(items: T[] | Collection): T[]; + reorder(item: T, index: number): T; + reverse(): Collection; + shift(): T; + slice(begin?: number, end?: number): Collection; + some(callback: ItemCallback): boolean; + sort(compareFunction?: ItemCompareCallback): void; + splice(start: number, deleteCount: number, items: T[] | Collection): T[]; + toArray(): T[]; + unshift(...items: T[]): number; + + static isCollection(value: any | Collection): value is Collection; + + static ofType(type: Constructor | Types): new (items?: (T[] | Collection) | { items?: T[] | Collection }) => Collection; + } + + type CollectionProperties = T[] | Collection; + + + + type DateProperties = number | string | Date; + + + export type BaseDynamicLayerLayerviewCreateEventHandler = (event: BaseDynamicLayerLayerviewCreateEvent) => void; + + export type BaseDynamicLayerLayerviewDestroyEventHandler = (event: BaseDynamicLayerLayerviewDestroyEvent) => void; + + export type BaseElevationLayerLayerviewCreateEventHandler = (event: BaseElevationLayerLayerviewCreateEvent) => void; + + export type BaseElevationLayerLayerviewDestroyEventHandler = (event: BaseElevationLayerLayerviewDestroyEvent) => void; + + export type BaseTileLayerLayerviewCreateEventHandler = (event: BaseTileLayerLayerviewCreateEvent) => void; + + export type BaseTileLayerLayerviewDestroyEventHandler = (event: BaseTileLayerLayerviewDestroyEvent) => void; + + export type CSVLayerLayerviewCreateEventHandler = (event: CSVLayerLayerviewCreateEvent) => void; + + export type CSVLayerLayerviewDestroyEventHandler = (event: CSVLayerLayerviewDestroyEvent) => void; + + export type ElevationLayerLayerviewCreateEventHandler = (event: ElevationLayerLayerviewCreateEvent) => void; + + export type ElevationLayerLayerviewDestroyEventHandler = (event: ElevationLayerLayerviewDestroyEvent) => void; + + export type FeatureLayerLayerviewCreateEventHandler = (event: FeatureLayerLayerviewCreateEvent) => void; + + export type FeatureLayerLayerviewDestroyEventHandler = (event: FeatureLayerLayerviewDestroyEvent) => void; + + export type GeoRSSLayerLayerviewCreateEventHandler = (event: GeoRSSLayerLayerviewCreateEvent) => void; + + export type GeoRSSLayerLayerviewDestroyEventHandler = (event: GeoRSSLayerLayerviewDestroyEvent) => void; + + export type GraphicsLayerLayerviewCreateEventHandler = (event: GraphicsLayerLayerviewCreateEvent) => void; + + export type GraphicsLayerLayerviewDestroyEventHandler = (event: GraphicsLayerLayerviewDestroyEvent) => void; + + export type GroupLayerLayerviewCreateEventHandler = (event: GroupLayerLayerviewCreateEvent) => void; + + export type GroupLayerLayerviewDestroyEventHandler = (event: GroupLayerLayerviewDestroyEvent) => void; + + export type IdentityManagerCredentialCreateEventHandler = (event: IdentityManagerCredentialCreateEvent) => void; + + export type IdentityManagerCredentialsDestroyEventHandler = (event: IdentityManagerCredentialsDestroyEvent) => void; + + export type ImageryLayerLayerviewCreateEventHandler = (event: ImageryLayerLayerviewCreateEvent) => void; + + export type ImageryLayerLayerviewDestroyEventHandler = (event: ImageryLayerLayerviewDestroyEvent) => void; + + export type IntegratedMeshLayerLayerviewCreateEventHandler = (event: IntegratedMeshLayerLayerviewCreateEvent) => void; + + export type IntegratedMeshLayerLayerviewDestroyEventHandler = (event: IntegratedMeshLayerLayerviewDestroyEvent) => void; + + export type KMLLayerLayerviewCreateEventHandler = (event: KMLLayerLayerviewCreateEvent) => void; + + export type KMLLayerLayerviewDestroyEventHandler = (event: KMLLayerLayerviewDestroyEvent) => void; + + export type MapImageLayerLayerviewCreateEventHandler = (event: MapImageLayerLayerviewCreateEvent) => void; + + export type MapImageLayerLayerviewDestroyEventHandler = (event: MapImageLayerLayerviewDestroyEvent) => void; + + export type MapNotesLayerLayerviewCreateEventHandler = (event: MapNotesLayerLayerviewCreateEvent) => void; + + export type MapNotesLayerLayerviewDestroyEventHandler = (event: MapNotesLayerLayerviewDestroyEvent) => void; + + export type MapViewClickEventHandler = (event: MapViewClickEvent) => void; + + export type MapViewDoubleClickEventHandler = (event: MapViewDoubleClickEvent) => void; + + export type MapViewDragEventHandler = (event: MapViewDragEvent) => void; + + export type MapViewHoldEventHandler = (event: MapViewHoldEvent) => void; + + export type MapViewKeyDownEventHandler = (event: MapViewKeyDownEvent) => void; + + export type MapViewKeyUpEventHandler = (event: MapViewKeyUpEvent) => void; + + export type MapViewLayerviewCreateEventHandler = (event: MapViewLayerviewCreateEvent) => void; + + export type MapViewLayerviewDestroyEventHandler = (event: MapViewLayerviewDestroyEvent) => void; + + export type MapViewMouseWheelEventHandler = (event: MapViewMouseWheelEvent) => void; + + export type MapViewPointerDownEventHandler = (event: MapViewPointerDownEvent) => void; + + export type MapViewPointerMoveEventHandler = (event: MapViewPointerMoveEvent) => void; + + export type MapViewPointerUpEventHandler = (event: MapViewPointerUpEvent) => void; + + export type MapViewResizeEventHandler = (event: MapViewResizeEvent) => void; + + interface Basemap extends Accessor, Loadable, JSONSupport { + baseLayers: Collection; + id: string; + loaded: boolean; + portalItem: PortalItem; + referenceLayers: Collection; + thumbnailUrl: string; + title: string; + + clone(): Basemap; + } + + interface BasemapConstructor { + new(properties?: BasemapProperties): Basemap; + + + fromId(id: string): Basemap; + + fromJSON(json: any): Basemap; + } + + export const Basemap: BasemapConstructor; + + interface BasemapProperties extends LoadableProperties { + baseLayers?: CollectionProperties; + id?: string; + loaded?: boolean; + portalItem?: PortalItemProperties; + referenceLayers?: CollectionProperties; + thumbnailUrl?: string; + title?: string; + } + + interface Camera extends Accessor, JSONSupport { + fov: number; + heading: number; + position: Point; + tilt: number; + + clone(): Camera; + } + + interface CameraConstructor { + new(properties?: CameraProperties): Camera; + + fromJSON(json: any): Camera; + } + + export const Camera: CameraConstructor; + + interface CameraProperties { + fov?: number; + heading?: number; + position?: PointProperties; + tilt?: number; + } + + interface Color { + a: number; + b: number; + g: number; + r: number; + + clone(): Color; + setColor(color: string | number[] | any): Color; + toCss(includeAlpha?: boolean): string; + toHex(): string; + toJSON(): any; + toRgb(): number[]; + toRgba(): number[]; + } + + interface ColorConstructor { + + blendColors(start: Color, end: Color, weight: number, obj?: Color): Color; + new(color: string | number[] | any): Color; + fromArray(a: number[], obj?: Color): Color; + fromHex(color: string, obj?: Color): Color; + fromJSON(json: any): Color; + fromRgb(color: string, obj?: Color): Color; + fromString(str: string, obj?: Color): Color; + } + + export const Color: ColorConstructor; + + interface config { + geometryServiceUrl: string; + geoRSSServiceUrl: string; + kmlServiceUrl: string; + portalUrl: string; + request: configRequest; + workers: configWorkers; + } + + export const config: config; + + export interface configRequest { + corsDetection?: boolean; + corsDetectionTimeout?: number; + corsEnabledServers?: (string | configRequestCorsEnabledServers)[]; + forceProxy?: boolean; + httpsDomains?: string[]; + maxUrlLength?: number; + proxyUrl?: string; + timeout?: number; + useCors?: string | boolean; + useIdentity?: boolean; + proxyRules?: configRequestProxyRules[]; + } + + export interface configRequestCorsEnabledServers { + host?: string; + withCredentials?: boolean; + } + + export interface configRequestProxyRules { + proxyUrl?: string; + urlPrefix?: string; + } + + export interface configWorkers { + loaderConfig?: configWorkersLoaderConfig; + } + + export interface configWorkersLoaderConfig { + has?: any; + paths?: any; + map?: any; + packages?: any[]; + } + + + + export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; + + export interface WatchHandle { + remove(): void; + } + + interface decorators { + aliasOf(propertyName: string): Function; + cast(propertyName: string): Function; + cast(classFunction: Function): Function; + declared(baseClass: T, ...mixinClasses: any[]): T; + property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; + subclass(declaredClass?: string): Function; + } + + export const decorators: decorators; + + export interface decoratorsPropertyPropertyMetadata { + dependsOn?: string[]; + type?: Function; + cast?: Function; + readOnly?: boolean; + constructOnly?: boolean; + aliasOf?: string; + value?: any; + } + + + + + + + + + + + + + + interface Error { + details: any; + message: string; + name: string; + } + + export const Error: Error; + + export class Evented { + protected emit(type: string, event: any): void; + hasEventListener(type: string): boolean; + on(type: string, listener: EventHandler): IHandle; + } + + export type EventHandler = (event: any) => void; + + interface JSONSupport { + toJSON(): any; + } + + interface JSONSupportConstructor { + new(): JSONSupport; + + + fromJSON(json: any): any; + } + + export const JSONSupport: JSONSupportConstructor; + + interface lang { + clone(elem: any): any; + } + + export const lang: lang; + + interface Loadable { + loadError: Error; + loadStatus: string; + loadWarnings: any[]; + + always(callbackOrErrback?: Function): IPromise; + cancelLoad(): void; + isFulfilled(): boolean; + isRejected(): boolean; + isResolved(): boolean; + load(): IPromise; + otherwise(errback?: Function): IPromise; + then(callback?: Function, errback?: Function, progback?: Function): IPromise; + } + + interface LoadableConstructor { + new(): Loadable; + } + + export const Loadable: LoadableConstructor; + + interface LoadableProperties { + loadError?: Error; + loadStatus?: string; + loadWarnings?: any[]; + } + + interface corePromise { + always(callbackOrErrback?: Function): IPromise; + isFulfilled(): boolean; + isRejected(): boolean; + isResolved(): boolean; + otherwise(errback?: Function): IPromise; + then(callback?: Function, errback?: Function, progback?: Function): IPromise; + } + + interface corePromiseConstructor { + new(): corePromise; + } + + export const corePromise: corePromiseConstructor; + + interface promiseUtils { + eachAlways(promises: IPromise[] | any): IPromise | any; + filter(input: T[], predicate: FilterPredicateCallback): IPromise; + reject(error?: any): IPromise; + resolve(value?: T): IPromise; + } + + export const promiseUtils: promiseUtils; + + export interface EachAlwaysResult { + promise: IPromise; + value: any; + error: any; + } + + export type FilterPredicateCallback = (value: any, index: number) => IPromise; + + interface requireUtils { + when(moduleRequire: any, moduleNames: string[] | string): IPromise; + } + + export const requireUtils: requireUtils; + + interface urlUtils { + addProxyRule(rule: urlUtilsAddProxyRuleRule): number; + getProxyRule(url: string): any; + urlToObject(url: string): any; + } + + export const urlUtils: urlUtils; + + export interface urlUtilsAddProxyRuleRule { + proxyUrl: string; + urlPrefix: string; + } + + interface watchUtils { + init(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + on(obj: Accessor, propertyName: string, eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; + once(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + pausable(obj: Accessor, propertyName: string, callback?: WatchCallback): PausableWatchHandle; + watch(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + when(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; + whenDefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; + whenDefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + whenFalse(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; + whenFalseOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + whenNot(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; + whenNotOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + whenOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + whenTrue(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; + whenTrueOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + whenUndefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; + whenUndefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + } + + export const watchUtils: watchUtils; + + export type EventAttachedCallback = (target: any, propName: string, obj: Accessor, eventName: string) => void; + + export interface PausableWatchHandle { + remove(): void; + pause(): void; + resume(): void; + } + export interface PromisedWatchHandle extends IPromise { remove(): void; } - export type ItemCallback = (item: any, index: number) => void; - export type ItemCompareCallback = (firstItem: any, secondItem: any) => number; - - export type ItemMapCallback = (item: any, index: number) => any; - - export type ItemReduceCallback = (previousValue: any, currentValue: any, index: number) => any; - - export type ItemTestCallback = (item: any, index: number) => boolean; - - export interface PortalItemFetchRelatedItemsParams { - relationshipType: string; - direction?: string; + interface workers { + open(client: any, modulePath: string): IPromise; } - export interface PortalItemUpdateParams { - data: string | any; + export const workers: workers; + + interface Connection { + broadcast(methodName: string, data?: any, buffers?: ArrayBuffer[]): IPromise; + close(): void; + invoke(methodName: string, data?: any, buffers?: ArrayBuffer[]): IPromise; } - export interface PortalUserAddItemParams { - item: PortalItem; - data?: string | any; - folder?: PortalFolder; + interface ConnectionConstructor { + new(client: any, id: number): Connection; } - export interface PortalUserFetchItemsParams { - folder: PortalFolder; - num: number; - start: number; + export const Connection: ConnectionConstructor; + + interface Circle extends Polygon { + center: Point | number[]; + geodesic: boolean; + numberOfPoints: number; + radius: number; + radiusUnit: string; + + clone(): Circle; } - export interface PortalFeaturedGroups { - owner: string; - title: string; + interface CircleConstructor { + new(properties?: CircleProperties): Circle; + + fromJSON(json: any): Circle; + } + + export const Circle: CircleConstructor; + + interface CircleProperties extends PolygonProperties { + center?: PointProperties | number[]; + geodesic?: boolean; + numberOfPoints?: number; + radius?: number; + radiusUnit?: string; + } + + interface Extent extends Geometry { + center: Point; + height: number; + mmax: number; + mmin: number; + width: number; + xmax: number; + xmin: number; + ymax: number; + ymin: number; + zmax: number; + zmin: number; + + centerAt(point: Point): Extent; + clone(): Extent; + contains(geometry: Point | Extent): boolean; + equals(extent: Extent): boolean; + expand(factor: number): Extent; + intersection(extent: Extent): Extent; + intersects(geometry: Geometry): boolean; + normalize(): Extent[]; + offset(dx: number, dy: number, dz: number): Extent; + union(extent: Extent): Extent; + } + + interface ExtentConstructor { + new(properties?: ExtentProperties): Extent; + + fromJSON(json: any): Extent; + } + + export const Extent: ExtentConstructor; + + interface ExtentProperties extends GeometryProperties { + center?: PointProperties; + height?: number; + mmax?: number; + mmin?: number; + width?: number; + xmax?: number; + xmin?: number; + ymax?: number; + ymin?: number; + zmax?: number; + zmin?: number; + } + + interface Geometry extends Accessor, JSONSupport { + cache: any; + extent: Extent; + hasM: boolean; + hasZ: boolean; + spatialReference: SpatialReference; + type: string; + + clone(): Geometry; + } + + interface GeometryConstructor { + new(properties?: GeometryProperties): Geometry; + + fromJSON(json: any): Geometry; + } + + export const Geometry: GeometryConstructor; + + interface GeometryProperties { + cache?: any; + extent?: ExtentProperties; + hasM?: boolean; + hasZ?: boolean; + spatialReference?: SpatialReferenceProperties; + type?: string; + } + + interface geometryEngine { + buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + clip(geometry: Geometry, envelope: Extent): Geometry; + contains(containerGeometry: Geometry, insideGeometry: Geometry): boolean; + convexHull(geometry: Geometry, merge?: boolean): Geometry | Geometry[]; + crosses(geometry1: Geometry, geometry2: Geometry): boolean; + cut(geometry: Geometry, cutter: Polyline): Geometry[]; + densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; + difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; + disjoint(geometry1: Geometry, geometry2: Geometry): boolean; + distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; + equals(geometry1: Geometry, geometry2: Geometry): boolean; + extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; + flipHorizontal(geometry: Geometry, flipOrigin?: Point): Geometry; + flipVertical(geometry: Geometry, flipOrigin?: Point): Geometry; + generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; + geodesicArea(geometry: Polygon, unit: string | number): number; + geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; + geodesicLength(geometry: Geometry, unit: string | number): number; + intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; + intersects(geometry1: Geometry, geometry2: Geometry): boolean; + isSimple(geometry: Geometry): boolean; + nearestCoordinate(geometry: Geometry, inputPoint: Point): NearestPointResult; + nearestVertex(geometry: Geometry, inputPoint: Point): NearestPointResult; + nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): NearestPointResult[]; + offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; + overlaps(geometry1: Geometry, geometry2: Geometry): boolean; + planarArea(geometry: Polygon, unit: string | number): number; + planarLength(geometry: Geometry, unit: string | number): number; + relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; + rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; + simplify(geometry: Geometry): Geometry; + symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; + touches(geometry1: Geometry, geometry2: Geometry): boolean; + union(geometries: Geometry[]): Geometry; + within(innerGeometry: Geometry, outerGeometry: Geometry): boolean; + } + + export const geometryEngine: geometryEngine; + + export interface NearestPointResult { + coordinate: Point; + distance: number; + isRightSide: boolean; + vertexIndex: number; + isEmpty: boolean; + } + + interface geometryEngineAsync { + buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + clip(geometry: Geometry, envelope: Extent): IPromise; + contains(containerGeometry: Geometry, insideGeometry: Geometry): IPromise; + convexHull(geometry: Geometry, merge?: boolean): IPromise; + crosses(geometry1: Geometry, geometry2: Geometry): IPromise; + cut(geometry: Geometry, cutter: Polyline): IPromise; + densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; + difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): IPromise; + disjoint(geometry1: Geometry, geometry2: Geometry): IPromise; + distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): IPromise; + equals(geometry1: Geometry, geometry2: Geometry): IPromise; + extendedSpatialReferenceInfo(spatialReference: SpatialReference): IPromise; + flipHorizontal(geometry: Geometry, flipOrigin?: Point): IPromise; + flipVertical(geometry: Geometry, flipOrigin?: Point): IPromise; + generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): IPromise; + geodesicArea(geometry: Polygon, unit: string | number): IPromise; + geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; + geodesicLength(geometry: Geometry, unit: string | number): IPromise; + intersect(geometry: Geometry | Geometry[], intersector: Geometry): IPromise; + intersects(geometry1: Geometry, geometry2: Geometry): IPromise; + isSimple(geometry: Geometry): IPromise; + nearestCoordinate(geometry: Geometry, inputPoint: Point): IPromise; + nearestVertex(geometry: Geometry, inputPoint: Point): IPromise; + nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): IPromise; + offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): IPromise; + overlaps(geometry1: Geometry, geometry2: Geometry): IPromise; + planarArea(geometry: Polygon, unit: string | number): IPromise; + planarLength(geometry: Geometry, unit: string | number): IPromise; + relate(geometry1: Geometry, geometry2: Geometry, relation: string): IPromise; + rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): IPromise; + simplify(geometry: Geometry): IPromise; + symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): IPromise; + touches(geometry1: Geometry, geometry2: Geometry): IPromise; + union(geometries: Geometry[]): IPromise; + within(innerGeometry: Geometry, outerGeometry: Geometry): IPromise; + } + + export const geometryEngineAsync: geometryEngineAsync; + + interface HeightModelInfo extends Accessor, JSONSupport { + heightModel: string; + heightUnit: string; + vertCRS: string; + } + + interface HeightModelInfoConstructor { + new(properties?: HeightModelInfoProperties): HeightModelInfo; + + fromJSON(json: any): HeightModelInfo; + } + + export const HeightModelInfo: HeightModelInfoConstructor; + + interface HeightModelInfoProperties { + heightModel?: string; + heightUnit?: string; + vertCRS?: string; + } + + interface Multipoint extends Geometry { + points: number[][]; + + addPoint(point: Point | number[]): Multipoint; + clone(): Multipoint; + getPoint(index: number): Point; + removePoint(index: number): Point; + setPoint(index: number, point: Point): Multipoint; + } + + interface MultipointConstructor { + new(properties?: MultipointProperties): Multipoint; + + fromJSON(json: any): Multipoint; + } + + export const Multipoint: MultipointConstructor; + + interface MultipointProperties extends GeometryProperties { + points?: number[][]; + } + + interface Point extends Geometry { + latitude: number; + longitude: number; + m: number; + x: number; + y: number; + z: number; + + clone(): Point; + copy(other: Point): void; + distance(other: Point): number; + equals(point: Point): boolean; + normalize(): Point; + } + + interface PointConstructor { + new(properties?: PointProperties): Point; + + fromJSON(json: any): Point; + } + + export const Point: PointConstructor; + + interface PointProperties extends GeometryProperties { + latitude?: number; + longitude?: number; + m?: number; + x?: number; + y?: number; + z?: number; + } + + interface Polygon extends Geometry { + centroid: Point; + isSelfIntersecting: boolean; + rings: number[][][]; + + addRing(ring: Point[] | number[][]): Polygon; + clone(): Polygon; + contains(point: Point): boolean; + getPoint(ringIndex: number, pointIndex: number): Point; + insertPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; + isClockwise(ring: Point[] | number[][]): boolean; + removePoint(ringIndex: number, pointIndex: number): Point[]; + removeRing(index: number): Point[]; + setPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; + } + + interface PolygonConstructor { + new(properties?: PolygonProperties): Polygon; + + + fromExtent(extent: Extent): Polygon; + + fromJSON(json: any): Polygon; + } + + export const Polygon: PolygonConstructor; + + interface PolygonProperties extends GeometryProperties { + centroid?: PointProperties; + isSelfIntersecting?: boolean; + rings?: number[][][]; + } + + interface Polyline extends Geometry { + paths: number[][][]; + + addPath(points: number[][]): Polyline; + clone(): Polyline; + getPoint(pathIndex: number, pointIndex: number): Point; + insertPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; + removePath(index: number): Point[]; + removePoint(pathIndex: number, pointIndex: number): Point; + setPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; + } + + interface PolylineConstructor { + new(properties?: PolylineProperties): Polyline; + + fromJSON(json: any): Polyline; + } + + export const Polyline: PolylineConstructor; + + interface PolylineProperties extends GeometryProperties { + paths?: number[][][]; + } + + interface ScreenPoint extends Accessor { + x: number; + y: number; + } + + interface ScreenPointConstructor { + new(properties?: ScreenPointProperties): ScreenPoint; + } + + export const ScreenPoint: ScreenPointConstructor; + + interface ScreenPointProperties { + x?: number; + y?: number; + } + + interface SpatialReference extends Accessor, JSONSupport { + isGeographic: boolean; + isWebMercator: boolean; + isWGS84: boolean; + isWrappable: boolean; + WebMercator: SpatialReference; + WGS84: SpatialReference; + wkid: number; + wkt: string; + + clone(): SpatialReference; + equals(spatialReference: SpatialReference): boolean; + } + + interface SpatialReferenceConstructor { + new(properties?: SpatialReferenceProperties): SpatialReference; + + fromJSON(json: any): SpatialReference; + } + + export const SpatialReference: SpatialReferenceConstructor; + + interface SpatialReferenceProperties { + isGeographic?: boolean; + isWebMercator?: boolean; + isWGS84?: boolean; + isWrappable?: boolean; + WebMercator?: SpatialReferenceProperties; + WGS84?: SpatialReferenceProperties; + wkid?: number; + wkt?: string; + } + + interface jsonUtils { + fromJSON(json: any): Geometry; + getJsonType(geometry: Geometry): string; + } + + export const jsonUtils: jsonUtils; + + interface normalizeUtils { + normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; + } + + export const normalizeUtils: normalizeUtils; + + interface webMercatorUtils { + canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; + geographicToWebMercator(geometry: Geometry): Geometry; + lngLatToXY(long: number, lat: number): number[]; + project(geometry: Geometry, spatialReference: SpatialReference | any): Geometry; + webMercatorToGeographic(geometry: Geometry): Geometry; + xyToLngLat(x: number, y: number): number[]; + } + + export const webMercatorUtils: webMercatorUtils; + + interface Graphic extends Accessor, JSONSupport { + attributes: any; + geometry: Geometry; + layer: FeatureLayer | GraphicsLayer; + popupTemplate: PopupTemplate; + symbol: Symbol; + visible: boolean; + + clone(): Graphic; + getAttribute(name: string): any; + setAttribute(name: string, newValue: any): void; + } + + interface GraphicConstructor { + new(properties?: GraphicProperties): Graphic; + + fromJSON(json: any): Graphic; + } + + export const Graphic: GraphicConstructor; + + interface GraphicProperties { + attributes?: any; + geometry?: GeometryProperties; + layer?: FeatureLayerProperties | GraphicsLayerProperties; + popupTemplate?: PopupTemplateProperties; + symbol?: SymbolProperties; + visible?: boolean; + } + + interface Ground extends Accessor, Loadable, JSONSupport { + layers: Collection; + loaded: boolean; + + clone(): Ground; + queryElevation(geometry: Point | Multipoint | Polyline, options?: GroundQueryElevationOptions): IPromise; + } + + interface GroundConstructor { + new(properties?: GroundProperties): Ground; + + fromJSON(json: any): Ground; + } + + export const Ground: GroundConstructor; + + interface GroundProperties extends LoadableProperties { + layers?: CollectionProperties; + loaded?: boolean; + } + + export interface ElevationQueryResult { + geometry: Point | Multipoint | Polyline; + sampleInfo: ElevationQueryResultSampleInfo[]; + noDataValue: number; } export interface GroundQueryElevationOptions { @@ -95,27 +1004,576 @@ declare namespace __esri { noDataValue?: number; } - export interface PopupTemplateExpressionInfos { - name: string; - title?: string; - expression: string; - returnType?: string; + export interface ElevationQueryResultSampleInfo { + demResolution: number; + source: ElevationLayer; } - export interface PopupTemplateFieldInfos { - fieldName: string; - format?: PopupTemplateFieldInfosFormat; - isEditable?: boolean; - label?: string; - stringFieldOption?: string; - tooltip?: string; - visible?: boolean; + interface Credential extends Accessor { + expires: number; + isAdmin: boolean; + oAuthState: any; + server: string; + ssl: boolean; + token: string; + userId: string; + + destroy(): void; + refreshToken(): void; } - export interface PopupTemplateFieldInfosFormat { - dateFormat?: string; - digitSeparator?: boolean; - places?: number; + interface CredentialConstructor { + new(properties?: CredentialProperties): Credential; + } + + export const Credential: CredentialConstructor; + + interface CredentialProperties { + expires?: number; + isAdmin?: boolean; + oAuthState?: any; + server?: string; + ssl?: boolean; + token?: string; + userId?: string; + } + + interface IdentityManager extends IdentityManagerBase { + dialog: any; + + setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; + setOAuthResponseHash(hash: string): void; + + on(name: "credential-create", eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; + on(name: "credential-create", modifiers: string[], eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; + on(name: "credentials-destroy", eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; + on(name: "credentials-destroy", modifiers: string[], eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; + } + + interface IdentityManagerConstructor { + new(): IdentityManager; + } + + export const IdentityManager: IdentityManagerConstructor; + + export interface IdentityManagerCredentialCreateEvent { + credential: Credential; + } + + export interface IdentityManagerCredentialsDestroyEvent { + } + + export type HandlerCallback = (authorizeParams: any, authorizeUrl: string, oAuthInfo: OAuthInfo, resourceUrl: string, serverInfo: ServerInfo) => void; + + interface IdentityManagerBase extends Evented { + tokenValidity: number; + + checkSignInStatus(resUrl: string): IPromise; + destroyCredentials(): void; + findCredential(url: string, userId?: string): Credential; + findOAuthInfo(url: string): OAuthInfo; + findServerInfo(url: string): ServerInfo; + generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerBaseGenerateTokenOptions): IPromise; + getCredential(url: string, options?: IdentityManagerBaseGetCredentialOptions): IPromise; + initialize(json: any): void; + isBusy(): boolean; + oAuthSignIn(resUrl: string, serverInfo: ServerInfo, oAuthInfo: OAuthInfo, options?: IdentityManagerBaseOAuthSignInOptions): IPromise; + registerOAuthInfos(oAuthInfos: OAuthInfo[]): void; + registerServers(serverInfos: ServerInfo[]): void; + registerToken(properties: IdentityManagerBaseRegisterTokenProperties): void; + setProtocolErrorHandler(handlerFunction: IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction): void; + setRedirectionHandler(handlerFunction: IdentityManagerBaseSetRedirectionHandlerHandlerFunction): void; + signIn(url: string, serverInfo: ServerInfo, options?: IdentityManagerBaseSignInOptions): IPromise; + toJSON(): any; + } + + interface IdentityManagerBaseConstructor { + new(): IdentityManagerBase; + } + + export const IdentityManagerBase: IdentityManagerBaseConstructor; + + export interface IdentityManagerBaseGenerateTokenOptions { + serverUrl: string; + token: string; + ssl: boolean; + } + + export interface IdentityManagerBaseGetCredentialOptions { + error?: Error; + oAuthPopupConfirmation?: boolean; + retry?: boolean; + token?: string; + } + + export interface IdentityManagerBaseOAuthSignInOptions { + error: Error; + oAuthPopupConfirmation: boolean; + token: string; + } + + export interface IdentityManagerBaseRegisterTokenProperties { + expires?: number; + server: string; + ssl?: boolean; + token: string; + userId?: string; + } + + export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction { + resourceUrl: string; + serverInfo: ServerInfo; + } + + export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction { + resourceUrl: string; + returnUrlParamName: string; + serverInfo: ServerInfo; + signInPage: string; + } + + export interface IdentityManagerBaseSignInOptions { + error: Error; + } + + interface OAuthInfo extends Accessor, JSONSupport { + appId: string; + authNamespace: string; + expiration: number; + locale: string; + minTimeUntilExpiration: number; + popup: boolean; + popupCallbackUrl: string; + popupWindowFeatures: string; + portalUrl: string; + + clone(): OAuthInfo; + } + + interface OAuthInfoConstructor { + new(properties?: OAuthInfoProperties): OAuthInfo; + + fromJSON(json: any): OAuthInfo; + } + + export const OAuthInfo: OAuthInfoConstructor; + + interface OAuthInfoProperties { + appId?: string; + authNamespace?: string; + expiration?: number; + locale?: string; + minTimeUntilExpiration?: number; + popup?: boolean; + popupCallbackUrl?: string; + popupWindowFeatures?: string; + portalUrl?: string; + } + + interface ServerInfo extends Accessor, JSONSupport { + adminTokenServiceUrl: string; + currentVersion: number; + server: string; + shortLivedTokenValidity: number; + tokenServiceUrl: string; + } + + interface ServerInfoConstructor { + new(properties?: ServerInfoProperties): ServerInfo; + + fromJSON(json: any): ServerInfo; + } + + export const ServerInfo: ServerInfoConstructor; + + interface ServerInfoProperties { + adminTokenServiceUrl?: string; + currentVersion?: number; + server?: string; + shortLivedTokenValidity?: number; + tokenServiceUrl?: string; + } + + interface kernel { + version: string; + } + + export const kernel: kernel; + + interface BaseDynamicLayer extends Layer, ScaleRangeLayer { + addResolvingPromise(promiseToLoad: IPromise): IPromise; + fetchImage(extent: Extent, width: number, height: number, options?: BaseDynamicLayerFetchImageOptions): IPromise; + getImageUrl(extent: Extent, width: number, height: number): IPromise | string; + + on(name: "layerview-create", eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; + } + + interface BaseDynamicLayerConstructor { + new(properties?: BaseDynamicLayerProperties): BaseDynamicLayer; + } + + export const BaseDynamicLayer: BaseDynamicLayerConstructor; + + interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + + } + + export interface BaseDynamicLayerFetchImageOptions { + allowImageDataAccess?: boolean; + } + + export interface BaseDynamicLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface BaseDynamicLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface BaseElevationLayer extends Layer { + spatialReference: SpatialReference; + tileInfo: TileInfo; + + addResolvingPromise(promiseToLoad: IPromise): IPromise; + fetchTile(level: number, row: number, column: number, options?: BaseElevationLayerFetchTileOptions): IPromise; + getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; + + on(name: "layerview-create", eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; + } + + interface BaseElevationLayerConstructor { + new(properties?: BaseElevationLayerProperties): BaseElevationLayer; + } + + export const BaseElevationLayer: BaseElevationLayerConstructor; + + interface BaseElevationLayerProperties extends LayerProperties { + spatialReference?: SpatialReferenceProperties; + tileInfo?: TileInfoProperties; + } + + export interface BaseElevationLayerFetchTileOptions { + noDataValue?: number; + } + + export interface ElevationTileData { + values: number[]; + width: number; + height: number; + maxZError: number; + noDataValue: number; + } + + export interface BaseElevationLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface BaseElevationLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface BaseTileLayer extends Layer, ScaleRangeLayer { + spatialReference: SpatialReference; + tileInfo: TileInfo; + + addResolvingPromise(promiseToLoad: IPromise): IPromise; + fetchTile(level: number, row: number, column: number, options?: BaseTileLayerFetchTileOptions): IPromise; + getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; + getTileUrl(level: number, row: number, column: number): string | IPromise; + + on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; + } + + interface BaseTileLayerConstructor { + new(properties?: BaseTileLayerProperties): BaseTileLayer; + } + + export const BaseTileLayer: BaseTileLayerConstructor; + + interface BaseTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + spatialReference?: SpatialReferenceProperties; + tileInfo?: TileInfoProperties; + } + + export interface BaseTileLayerFetchTileOptions { + allowImageDataAccess?: boolean; + } + + export interface BaseTileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface BaseTileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface CSVLayer extends Layer { + copyright: string; + delimiter: string; + elevationInfo: CSVLayerElevationInfo; + featureReduction: CSVLayerFeatureReduction; + fields: Field[]; + labelingInfo: LabelClass[]; + labelsVisible: boolean; + latitudeField: string; + legendEnabled: boolean; + longitudeField: string; + maxScale: number; + minScale: number; + outFields: string[]; + popupEnabled: boolean; + popupTemplate: PopupTemplate; + renderer: Renderer; + screenSizePerspectiveEnabled: boolean; + url: string; + + on(name: "layerview-create", eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; + } + + interface CSVLayerConstructor { + new(properties?: CSVLayerProperties): CSVLayer; + } + + export const CSVLayer: CSVLayerConstructor; + + interface CSVLayerProperties extends LayerProperties { + copyright?: string; + delimiter?: string; + elevationInfo?: CSVLayerElevationInfo; + featureReduction?: CSVLayerFeatureReduction; + fields?: FieldProperties[]; + labelingInfo?: LabelClassProperties[]; + labelsVisible?: boolean; + latitudeField?: string; + legendEnabled?: boolean; + longitudeField?: string; + maxScale?: number; + minScale?: number; + outFields?: string[]; + popupEnabled?: boolean; + popupTemplate?: PopupTemplateProperties; + renderer?: RendererProperties; + screenSizePerspectiveEnabled?: boolean; + url?: string; + } + + export interface CSVLayerElevationInfo { + mode: string; + offset?: number; + featureExpressionInfo?: CSVLayerElevationInfoFeatureExpressionInfo; + unit?: string; + } + + export interface CSVLayerElevationInfoFeatureExpressionInfo { + expression?: string; + } + + export interface CSVLayerFeatureReduction { + type: string; + } + + export interface CSVLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface CSVLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface DynamicLayer { + portalItem: PortalItem; + url: string; + + fetchImage(extent: Extent, width: number, height: number, options?: DynamicLayerFetchImageOptions): IPromise; + getImageUrl(extent: Extent, width: number, height: number, options?: DynamicLayerGetImageUrlOptions): IPromise | string; + } + + interface DynamicLayerConstructor { + new(): DynamicLayer; + } + + export const DynamicLayer: DynamicLayerConstructor; + + interface DynamicLayerProperties { + portalItem?: PortalItemProperties; + url?: string; + } + + export interface DynamicLayerFetchImageOptions { + allowImageDataAccess?: boolean; + rotation?: number; + pixelRatio?: number; + } + + export interface DynamicLayerGetImageUrlOptions { + pixelRatio?: number; + rotation?: number; + } + + interface ElevationLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { + url: string; + + fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; + queryElevation(geometry: Point | Multipoint | Polyline, options?: ElevationLayerQueryElevationOptions): IPromise; + + on(name: "layerview-create", eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: ElevationLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: ElevationLayerLayerviewDestroyEventHandler): IHandle; + } + + interface ElevationLayerConstructor { + new(properties?: ElevationLayerProperties): ElevationLayer; + + fromJSON(json: any): ElevationLayer; + } + + export const ElevationLayer: ElevationLayerConstructor; + + interface ElevationLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { + url?: string; + } + + export interface ElevationLayerQueryElevationOptions { + demResolution?: number | string; + returnSampleInfo?: boolean; + noDataValue?: number; + } + + export interface ElevationLayerElevationQueryResult { + geometry: Point | Multipoint | Polyline; + sampleInfo: ElevationLayerElevationQueryResultSampleInfo[]; + noDataValue: number; + } + + export interface ElevationLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface ElevationLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + export interface ElevationLayerElevationQueryResultSampleInfo { + demResolution: number; + } + + interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { + capabilities: FeatureLayerCapabilities; + copyright: string; + definitionExpression: string; + displayField: string; + elevationInfo: FeatureLayerElevationInfo; + featureReduction: FeatureLayerFeatureReduction; + fields: Field[]; + gdbVersion: string; + geometryType: string; + hasAttachments: boolean; + hasM: boolean; + hasZ: boolean; + labelingInfo: LabelClass[]; + labelsVisible: boolean; + layerId: number; + legendEnabled: boolean; + objectIdField: string; + outFields: string[]; + popupEnabled: boolean; + popupTemplate: PopupTemplate; + renderer: Renderer; + returnM: boolean; + returnZ: boolean; + screenSizePerspectiveEnabled: boolean; + source: Collection; + spatialReference: SpatialReference; + templates: FeatureTemplate[]; + token: string; + typeIdField: string; + types: FeatureType[]; + url: string; + version: number; + + applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; + createQuery(): Query; + getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + + on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle; + } + + interface FeatureLayerConstructor { + new(properties?: FeatureLayerProperties): FeatureLayer; + + fromJSON(json: any): FeatureLayer; + } + + export const FeatureLayer: FeatureLayerConstructor; + + interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + capabilities?: FeatureLayerCapabilities; + copyright?: string; + definitionExpression?: string; + displayField?: string; + elevationInfo?: FeatureLayerElevationInfo; + featureReduction?: FeatureLayerFeatureReduction; + fields?: FieldProperties[]; + gdbVersion?: string; + geometryType?: string; + hasAttachments?: boolean; + hasM?: boolean; + hasZ?: boolean; + labelingInfo?: LabelClassProperties[]; + labelsVisible?: boolean; + layerId?: number; + legendEnabled?: boolean; + objectIdField?: string; + outFields?: string[]; + popupEnabled?: boolean; + popupTemplate?: PopupTemplateProperties; + renderer?: RendererProperties; + returnM?: boolean; + returnZ?: boolean; + screenSizePerspectiveEnabled?: boolean; + source?: CollectionProperties; + spatialReference?: SpatialReferenceProperties; + templates?: FeatureTemplateProperties[]; + token?: string; + typeIdField?: string; + types?: FeatureTypeProperties[]; + url?: string; + version?: number; + } + + export interface FeatureEditResult { + objectId: number; + error: FeatureEditResultError; } export interface FeatureLayerApplyEditsEdits { @@ -184,6 +1642,12 @@ declare namespace __esri { export interface FeatureLayerElevationInfo { mode: string; offset?: number; + featureExpressionInfo?: FeatureLayerElevationInfoFeatureExpressionInfo; + unit?: string; + } + + export interface FeatureLayerElevationInfoFeatureExpressionInfo { + expression?: string; } export interface FeatureLayerFeatureReduction { @@ -195,3220 +1659,21 @@ declare namespace __esri { } export interface FeatureLayerLayerviewCreateEvent { - view: View; layerView: LayerView; + view: View; } - export type FeatureLayerLayerviewCreateEventHandler = (event: FeatureLayerLayerviewCreateEvent) => void; - export interface FeatureLayerLayerviewDestroyEvent { + layerView: LayerView; view: View; - layerView: LayerView; } - export type FeatureLayerLayerviewDestroyEventHandler = (event: FeatureLayerLayerviewDestroyEvent) => void; - - export interface GraphicsLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface GraphicsLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type GraphicsLayerLayerviewCreateEventHandler = (event: GraphicsLayerLayerviewCreateEvent) => void; - - export interface GraphicsLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type GraphicsLayerLayerviewDestroyEventHandler = (event: GraphicsLayerLayerviewDestroyEvent) => void; - - export interface LayerFromArcGISServerUrlParams { - url: string; - properties?: any; - } - - export interface LayerFromPortalItemParams { - portalItem: PortalItem; - } - - export interface FeatureTemplateThumbnail { - contentType: any; - imageData: string; - height: number; - width: number; - } - - export interface LabelClassLabelExpressionInfo { - value?: string; - } - - export interface LabelSymbol3DVerticalOffsetProperties { - screenLength?: number; - minWorldLength?: number; - maxWorldLength?: number; - } - export interface LabelSymbol3DVerticalOffset extends Accessor { - screenLength: number; - minWorldLength?: number; - maxWorldLength?: number; - } - - export interface QueryQuantizationParameters { - extent?: Extent; - mode?: string; - originPosition?: string; - tolerance?: number; - } - - export interface ViewPadding { - left?: number; - top?: number; - right?: number; - bottom?: number; - } - - export interface WebMapSourceVersion { - major: number; - minor: number; - } - - export interface WebSceneSaveAsOptions { - folder?: PortalFolder; - ignoreUnsupported?: boolean; - } - - export interface WebSceneSaveOptions { - ignoreUnsupported?: boolean; - } - - export interface WebSceneSourceVersion { - major: number; - minor: number; - } - - export interface WebSceneUpdateFromOptions { - environmentExcluded?: boolean; - viewpointExcluded?: boolean; - } - - export type EventHandler = (event: any) => void; - - export interface SceneViewDragEventOrigin { - x: number; - y: number; - } - - export interface SceneViewClickEvent { - mapPoint: Point; - x: number; - y: number; - button: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewClickEventHandler = (event: SceneViewClickEvent) => void; - - export interface SceneViewDoubleClickEvent { - mapPoint: Point; - x: number; - y: number; - button: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewDoubleClickEventHandler = (event: SceneViewDoubleClickEvent) => void; - - export interface SceneViewDragEvent { - action: string; - x: number; - y: number; - origin: SceneViewDragEventOrigin; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewDragEventHandler = (event: SceneViewDragEvent) => void; - - export type EasingFunction = (t: number, duration: number) => number; - - export interface SceneViewHoldEvent { - mapPoint: Point; - x: number; - y: number; - button: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewHoldEventHandler = (event: SceneViewHoldEvent) => void; - - export interface SceneViewKeyDownEvent { - repeat: boolean; - key: string; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewKeyDownEventHandler = (event: SceneViewKeyDownEvent) => void; - - export interface SceneViewKeyUpEvent { - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewKeyUpEventHandler = (event: SceneViewKeyUpEvent) => void; - - export interface SceneViewLayerviewCreateEvent { - layer: Layer; - layerView: LayerView; - } - - export type SceneViewLayerviewCreateEventHandler = (event: SceneViewLayerviewCreateEvent) => void; - - export interface SceneViewLayerviewDestroyEvent { - layer: Layer; - layerView: LayerView; - } - - export type SceneViewLayerviewDestroyEventHandler = (event: SceneViewLayerviewDestroyEvent) => void; - - export interface SceneViewMouseWheelEvent { - x: number; - y: number; - deltaY: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewMouseWheelEventHandler = (event: SceneViewMouseWheelEvent) => void; - - export interface SceneViewPointerDownEvent { - pointerId: number; - pointerType: string; - x: number; - y: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewPointerDownEventHandler = (event: SceneViewPointerDownEvent) => void; - - export interface SceneViewPointerMoveEvent { - pointerId: number; - pointerType: string; - x: number; - y: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewPointerMoveEventHandler = (event: SceneViewPointerMoveEvent) => void; - - export interface SceneViewPointerUpEvent { - pointerId: number; - pointerType: string; - x: number; - y: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type SceneViewPointerUpEventHandler = (event: SceneViewPointerUpEvent) => void; - - export interface SceneViewResizeEvent { - oldWidth: number; - oldHeight: number; - width: number; - height: number; - } - - export type SceneViewResizeEventHandler = (event: SceneViewResizeEvent) => void; - - export interface SceneViewConstraintsProperties { - altitude?: SceneViewConstraintsAltitudeProperties; - clipDistance?: SceneViewConstraintsClipDistanceProperties; - collision?: SceneViewConstraintsCollision; - tilt?: SceneViewConstraintsTiltProperties; - } - export interface SceneViewConstraints extends Accessor { - altitude?: SceneViewConstraintsAltitude; - clipDistance?: SceneViewConstraintsClipDistance; - collision?: SceneViewConstraintsCollision; - tilt?: SceneViewConstraintsTilt; - } - - export interface SceneViewConstraintsAltitudeProperties { - min?: number; - max?: number; - } - export interface SceneViewConstraintsAltitude extends Accessor { - min?: number; - max?: number; - } - - export interface SceneViewConstraintsClipDistanceProperties { - near?: number; - far?: number; - mode?: string; - } - export interface SceneViewConstraintsClipDistance extends Accessor { - near?: number; - far?: number; - mode?: string; - } - - export interface SceneViewConstraintsCollision { - enabled?: boolean; - } - - export interface SceneViewConstraintsTiltProperties { - max?: number; - mode?: string; - } - export interface SceneViewConstraintsTilt extends Accessor { - max?: number; - mode?: string; - } - - export interface SceneViewEnvironmentProperties { - lighting?: SceneViewEnvironmentLightingProperties; - atmosphereEnabled?: boolean; - atmosphere?: SceneViewEnvironmentAtmosphereProperties; - starsEnabled?: boolean; - } - export interface SceneViewEnvironment extends Accessor { - lighting?: SceneViewEnvironmentLighting; - atmosphereEnabled?: boolean; - atmosphere?: SceneViewEnvironmentAtmosphere; - starsEnabled?: boolean; - } - - export interface SceneViewEnvironmentAtmosphereProperties { - quality?: string; - } - export interface SceneViewEnvironmentAtmosphere extends Accessor { - quality?: string; - } - - export interface SceneViewEnvironmentLightingProperties { - date?: Date; - directShadowsEnabled?: boolean; - ambientOcclusionEnabled?: boolean; - cameraTrackingEnabled?: boolean; - } - export interface SceneViewEnvironmentLighting extends Accessor { - date?: Date; - directShadowsEnabled?: boolean; - ambientOcclusionEnabled?: boolean; - cameraTrackingEnabled?: boolean; - } - - export interface SceneViewGoToOptions { - animate?: boolean; - speedFactor?: number; - duration?: number; - maxDuration?: number; - easing?: string | EasingFunction; - } - - export interface SceneViewHighlightOptions { - color?: Color; - haloOpacity?: number; - fillOpacity?: number; - } - - export interface SceneViewHitTestScreenPoint { - x: number; - y: number; - } - - export interface SceneViewToMapScreenPoint { - x: number; - y: number; - } - - export interface WatchHandle { - remove(): void; - } - - export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; - - export interface IdentityManagerBaseGenerateTokenOptions { - serverUrl: string; - token: string; - ssl: boolean; - } - - export interface IdentityManagerBaseGetCredentialOptions { - error?: Error; - oAuthPopupConfirmation?: boolean; - retry?: boolean; - token?: string; - } - - export interface IdentityManagerBaseOAuthSignInOptions { - error: Error; - oAuthPopupConfirmation: boolean; - token: string; - } - - export interface IdentityManagerBaseRegisterTokenProperties { - expires?: number; - server: string; - ssl?: boolean; - token: string; - userId?: string; - } - - export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction { - resourceUrl: string; - serverInfo: ServerInfo; - } - - export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction { - resourceUrl: string; - returnUrlParamName: string; - serverInfo: ServerInfo; - signInPage: string; - } - - export interface IdentityManagerBaseSignInOptions { - error: Error; - } - - export interface IdentityManagerCredentialCreateEvent { - credential: Credential; - } - - export type IdentityManagerCredentialCreateEventHandler = (event: IdentityManagerCredentialCreateEvent) => void; - - export interface IdentityManagerCredentialsDestroyEvent { - } - - export type IdentityManagerCredentialsDestroyEventHandler = (event: IdentityManagerCredentialsDestroyEvent) => void; - - export type HandlerCallback = (authorizeParams: any, authorizeUrl: string, oAuthInfo: OAuthInfo, resourceUrl: string, serverInfo: ServerInfo) => void; - - export interface BaseElevationLayerFetchTileOptions { - noDataValue?: number; - } - - export interface BaseElevationLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type BaseElevationLayerLayerviewCreateEventHandler = (event: BaseElevationLayerLayerviewCreateEvent) => void; - - export interface BaseElevationLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type BaseElevationLayerLayerviewDestroyEventHandler = (event: BaseElevationLayerLayerviewDestroyEvent) => void; - - export interface CSVLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface CSVLayerFeatureReduction { - type: string; - } - - export interface CSVLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type CSVLayerLayerviewCreateEventHandler = (event: CSVLayerLayerviewCreateEvent) => void; - - export interface CSVLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type CSVLayerLayerviewDestroyEventHandler = (event: CSVLayerLayerviewDestroyEvent) => void; - - export interface ElevationLayerQueryElevationOptions { - demResolution?: number | string; - returnSampleInfo?: boolean; - noDataValue?: number; - } - - export interface ElevationLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type ElevationLayerLayerviewCreateEventHandler = (event: ElevationLayerLayerviewCreateEvent) => void; - - export interface ElevationLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type ElevationLayerLayerviewDestroyEventHandler = (event: ElevationLayerLayerviewDestroyEvent) => void; - - export interface GeoRSSLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type GeoRSSLayerLayerviewCreateEventHandler = (event: GeoRSSLayerLayerviewCreateEvent) => void; - - export interface GeoRSSLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type GeoRSSLayerLayerviewDestroyEventHandler = (event: GeoRSSLayerLayerviewDestroyEvent) => void; - - export interface GroupLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type GroupLayerLayerviewCreateEventHandler = (event: GroupLayerLayerviewCreateEvent) => void; - - export interface GroupLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type GroupLayerLayerviewDestroyEventHandler = (event: GroupLayerLayerviewDestroyEvent) => void; - - export interface ImageryLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type ImageryLayerLayerviewCreateEventHandler = (event: ImageryLayerLayerviewCreateEvent) => void; - - export interface ImageryLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type ImageryLayerLayerviewDestroyEventHandler = (event: ImageryLayerLayerviewDestroyEvent) => void; - - export interface IntegratedMeshLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type IntegratedMeshLayerLayerviewCreateEventHandler = (event: IntegratedMeshLayerLayerviewCreateEvent) => void; - - export interface IntegratedMeshLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type IntegratedMeshLayerLayerviewDestroyEventHandler = (event: IntegratedMeshLayerLayerviewDestroyEvent) => void; - - export interface MapImageLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type MapImageLayerLayerviewCreateEventHandler = (event: MapImageLayerLayerviewCreateEvent) => void; - - export interface MapImageLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type MapImageLayerLayerviewDestroyEventHandler = (event: MapImageLayerLayerviewDestroyEvent) => void; - - export interface MapNotesLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type MapNotesLayerLayerviewCreateEventHandler = (event: MapNotesLayerLayerviewCreateEvent) => void; - - export interface MapNotesLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type MapNotesLayerLayerviewDestroyEventHandler = (event: MapNotesLayerLayerviewDestroyEvent) => void; - - export interface OpenStreetMapLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type OpenStreetMapLayerLayerviewCreateEventHandler = (event: OpenStreetMapLayerLayerviewCreateEvent) => void; - - export interface OpenStreetMapLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type OpenStreetMapLayerLayerviewDestroyEventHandler = (event: OpenStreetMapLayerLayerviewDestroyEvent) => void; - - export interface PointCloudLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type PointCloudLayerLayerviewCreateEventHandler = (event: PointCloudLayerLayerviewCreateEvent) => void; - - export interface PointCloudLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type PointCloudLayerLayerviewDestroyEventHandler = (event: PointCloudLayerLayerviewDestroyEvent) => void; - - export interface PointCloudLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface PointCloudRendererColorModulation { - field: string; - minValue: number; - maxValue: number; - } - - export interface PointCloudRendererPointSizeAlgorithm { - type?: string; - useRealWorldSymbolSizes?: boolean; - size?: number; - scaleFactor?: number; - minSize?: number; - } - - export interface SceneLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type SceneLayerLayerviewCreateEventHandler = (event: SceneLayerLayerviewCreateEvent) => void; - - export interface SceneLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type SceneLayerLayerviewDestroyEventHandler = (event: SceneLayerLayerviewDestroyEvent) => void; - - export interface SceneLayerElevationInfo { - mode: string; - offset?: number; - } - - export interface SceneLayerFeatureReduction { - type: string; - } - - export interface StreamLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type StreamLayerLayerviewCreateEventHandler = (event: StreamLayerLayerviewCreateEvent) => void; - - export interface StreamLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type StreamLayerLayerviewDestroyEventHandler = (event: StreamLayerLayerviewDestroyEvent) => void; - - export interface StreamLayerFilter { - geometry?: Extent; - where?: string; - } - - export interface StreamLayerPurgeOptions { - displayCount: number; - age: number; - } - - export interface StreamLayerUpdateFilterFilterChanges { - geometry: Extent; - where: string; - } - - export interface TileLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type TileLayerLayerviewCreateEventHandler = (event: TileLayerLayerviewCreateEvent) => void; - - export interface TileLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type TileLayerLayerviewDestroyEventHandler = (event: TileLayerLayerviewDestroyEvent) => void; - - export interface TileLayerFetchTileOptions { - allowImageDataAccess?: boolean; - } - - export interface UnknownLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type UnknownLayerLayerviewCreateEventHandler = (event: UnknownLayerLayerviewCreateEvent) => void; - - export interface UnknownLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type UnknownLayerLayerviewDestroyEventHandler = (event: UnknownLayerLayerviewDestroyEvent) => void; - - export interface UnsupportedLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type UnsupportedLayerLayerviewCreateEventHandler = (event: UnsupportedLayerLayerviewCreateEvent) => void; - - export interface UnsupportedLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type UnsupportedLayerLayerviewDestroyEventHandler = (event: UnsupportedLayerLayerviewDestroyEvent) => void; - - export interface VectorTileLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type VectorTileLayerLayerviewCreateEventHandler = (event: VectorTileLayerLayerviewCreateEvent) => void; - - export interface VectorTileLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type VectorTileLayerLayerviewDestroyEventHandler = (event: VectorTileLayerLayerviewDestroyEvent) => void; - - export interface VectorTileLayerCurrentStyleInfo { - serviceUrl: string; - styleUrl: string; - spriteUrl: string; - glyphsUrl: string; - style: any; - layerDefinition: any; - } - - export interface WebTileLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type WebTileLayerLayerviewCreateEventHandler = (event: WebTileLayerLayerviewCreateEvent) => void; - - export interface WebTileLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type WebTileLayerLayerviewDestroyEventHandler = (event: WebTileLayerLayerviewDestroyEvent) => void; - - export interface WMSLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type WMSLayerLayerviewCreateEventHandler = (event: WMSLayerLayerviewCreateEvent) => void; - - export interface WMSLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type WMSLayerLayerviewDestroyEventHandler = (event: WMSLayerLayerviewDestroyEvent) => void; - - export interface WMSLayerFetchImageOptions { - allowImageDataAccess?: boolean; - pixelRatio?: number; - rotation?: number; - } - - export interface WMTSLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type WMTSLayerLayerviewCreateEventHandler = (event: WMTSLayerLayerviewCreateEvent) => void; - - export interface WMTSLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type WMTSLayerLayerviewDestroyEventHandler = (event: WMTSLayerLayerviewDestroyEvent) => void; - - export interface BaseDynamicLayerFetchImageOptions { - allowImageDataAccess?: boolean; - } - - export interface BaseDynamicLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type BaseDynamicLayerLayerviewCreateEventHandler = (event: BaseDynamicLayerLayerviewCreateEvent) => void; - - export interface BaseDynamicLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type BaseDynamicLayerLayerviewDestroyEventHandler = (event: BaseDynamicLayerLayerviewDestroyEvent) => void; - - export interface BaseTileLayerFetchTileOptions { - allowImageDataAccess?: boolean; - } - - export interface BaseTileLayerLayerviewCreateEvent { - view: View; - layerView: LayerView; - } - - export type BaseTileLayerLayerviewCreateEventHandler = (event: BaseTileLayerLayerviewCreateEvent) => void; - - export interface BaseTileLayerLayerviewDestroyEvent { - view: View; - layerView: LayerView; - } - - export type BaseTileLayerLayerviewDestroyEventHandler = (event: BaseTileLayerLayerviewDestroyEvent) => void; - - export interface CodedValueDomainCodedValues { + export interface FeatureEditResultError { name: string; - code: string | number; - } - - export interface PixelBlockAddDataPlaneData { - pixels: number[][]; - statistics: any[]; - } - - export interface PixelBlockStatistics { - maxValue?: number; - minValue?: number; - noDataValue?: number; - } - - export interface ClassBreaksRendererClassBreakInfos { - minValue: number; - maxValue: number; - symbol: Symbol; - label?: string; - } - - export interface ClassBreaksRendererLegendOptions { - title: string; - } - - export interface UniqueValueRendererLegendOptions { - title?: string; - } - - export interface UniqueValueRendererUniqueValueInfos { - value: string | number; - symbol: Symbol; - label?: string; - } - - export interface PointCloudClassBreaksRendererColorClassBreakInfos { - minValue: number; - maxValue: number; - color: Color; - label?: string; - } - - export interface PointCloudStretchRendererStops { - value: number; - label?: string; - color: Color; - } - - export interface PointCloudUniqueValueRendererColorUniqueValueInfos { - values: number[]; - color: Color; - label?: string; - } - - export interface FillSymbol3DLayerOutline { - color: Color; - size: number; - } - - export interface IconSymbol3DLayerOutline { - color?: Color; - size?: number; - } - - export interface IconSymbol3DLayerResource { - primitive?: string; - href?: string; - } - - export interface ObjectSymbol3DLayerResource { - primitive?: string; - href?: string; - } - - export interface PointSymbol3DVerticalOffsetProperties { - screenLength?: number; - minWorldLength?: number; - maxWorldLength?: number; - } - export interface PointSymbol3DVerticalOffset extends Accessor { - screenLength: number; - minWorldLength?: number; - maxWorldLength?: number; - } - - export interface Symbol3DStyleOrigin { - styleName?: string; - styleUrl?: string; - name: string; - } - - export interface TextSymbol3DLayerFont { - family?: string; - weight?: string; - style?: string; - } - - export interface TextSymbol3DLayerHalo { - color?: Color; - size?: number; - } - - export interface LineCallout3DBorderProperties { - color?: Color; - } - export interface LineCallout3DBorder extends Accessor { - color?: Color; - } - - export interface ClosestFacilityParametersAttributeParameterValues { - attributeName: string; - parameterName: string; - value: string; - } - - export interface GeometryServiceFromGeoCoordinateStringParams { - strings: string[]; - sr: SpatialReference | string; - conversionType: string; - conversionMode?: string; - } - - export interface GeometryServiceToGeoCoordinateStringParams { - sr: SpatialReference | string; - coordinates: number[][]; - conversionType: string; - conversionMode?: string; - numOfDigits?: number; - rounding?: boolean; - addSpaces?: boolean; - } - - export interface ProjectParametersTransformation { - wkid?: number; - wkt?: string; - } - - export interface LocatorAddressToLocationsParams { - address: any; - categories: string[]; - countryCode: string; - distance: number; - forStorage: boolean; - location: Point; - magicKey: string; - maxLocations: number; - outFields: string[]; - searchExtent: Extent; - } - - export interface LocatorAddressesToLocationsParams { - addresses: any[]; - countryCode: string; - categories: string[]; - } - - export interface LocatorSuggestLocationsParams { - categories: string[]; - distance: number; - location: Point; - text: string; - } - - export interface PrintTemplateExportOptions { - width?: number; - height?: number; - dpi?: number; - } - - export interface PrintTemplateLayoutOptions { - titleText: string; - authorText: string; - copyrightText: string; - scalebarUnit: string; - legendLayers: LegendLayer[]; - customTextElements: any[]; - } - - export interface MapViewDragEventOrigin { - x: number; - y: number; - } - - export interface MapViewClickEvent { - mapPoint: Point; - x: number; - y: number; - button: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewClickEventHandler = (event: MapViewClickEvent) => void; - - export interface MapViewDoubleClickEvent { - mapPoint: Point; - x: number; - y: number; - button: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewDoubleClickEventHandler = (event: MapViewDoubleClickEvent) => void; - - export interface MapViewDragEvent { - action: string; - x: number; - y: number; - origin: MapViewDragEventOrigin; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewDragEventHandler = (event: MapViewDragEvent) => void; - - export interface MapViewHoldEvent { - mapPoint: Point; - x: number; - y: number; - button: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewHoldEventHandler = (event: MapViewHoldEvent) => void; - - export interface MapViewKeyDownEvent { - repeat: boolean; - key: string; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewKeyDownEventHandler = (event: MapViewKeyDownEvent) => void; - - export interface MapViewKeyUpEvent { - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewKeyUpEventHandler = (event: MapViewKeyUpEvent) => void; - - export interface MapViewLayerviewCreateEvent { - layer: Layer; - layerView: LayerView; - } - - export type MapViewLayerviewCreateEventHandler = (event: MapViewLayerviewCreateEvent) => void; - - export interface MapViewLayerviewDestroyEvent { - layer: Layer; - layerView: LayerView; - } - - export type MapViewLayerviewDestroyEventHandler = (event: MapViewLayerviewDestroyEvent) => void; - - export interface MapViewConstraints { - lods?: LOD[]; - minScale?: number; - maxScale?: number; - minZoom?: number; - maxZoom?: number; - snapToZoom?: boolean; - rotationEnabled?: boolean; - effectiveLODs?: LOD[]; - effectiveMinZoom?: number; - effectiveMaxZoom?: number; - effectiveMinScale?: number; - effectiveMaxScale?: number; - } - - export interface MapViewGoToOptions { - animate?: boolean; - duration?: number; - easing?: string | Function; - } - - export interface MapViewHitTestScreenPoint { - x: number; - y: number; - } - - export interface MapViewToMapScreenPoint { - x: number; - y: number; - } - - export interface MapViewMouseWheelEvent { - x: number; - y: number; - deltaY: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewMouseWheelEventHandler = (event: MapViewMouseWheelEvent) => void; - - export interface MapViewPointerDownEvent { - pointerId: number; - pointerType: string; - x: number; - y: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewPointerDownEventHandler = (event: MapViewPointerDownEvent) => void; - - export interface MapViewPointerMoveEvent { - pointerId: number; - pointerType: string; - x: number; - y: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewPointerMoveEventHandler = (event: MapViewPointerMoveEvent) => void; - - export interface MapViewPointerUpEvent { - pointerId: number; - pointerType: string; - x: number; - y: number; - type: string; - stopPropagation: Function; - timestamp: number; - native: any; - } - - export type MapViewPointerUpEventHandler = (event: MapViewPointerUpEvent) => void; - - export interface MapViewResizeEvent { - oldWidth: number; - oldHeight: number; - width: number; - height: number; - } - - export type MapViewResizeEventHandler = (event: MapViewResizeEvent) => void; - - export interface AttributeParamValue { - attributeName: string; - parameterName: string; - value: string; - } - - export interface ConfigurationTaskGetDataWorkspaceDetailsParams { - dataWorkspaceId: string; - user: string; - } - - export interface ConfigurationTaskGetUserJobQueryDetailsParams { - queryId: number; - user: string; - } - - export interface AuxRecordDescription { - properties: any; - recordId: number; - tableName: string; - } - - export interface JobCreationParameters { - loi: Geometry; - assignedTo: string; - autoCommitWorkflow: boolean; - autoExecute: boolean; - dataWorkspaceId: string; - description: string; - dueDate: Date; - jobTypeId: number; - assignedType: string; - name: string; - numJobs: string; - ownedBy: string; - parentJobId: number; - parentVersion: string; - priority: number; - startDate: Date; - user: string; - } - - export interface JobQueryParameters { - aliases: string; - fields: string; - orderBy: string; - tables: string; - where: string; - user: string; - } - - export interface JobTaskAddEmbeddedAttachmentParams { - jobId: number; - form: any; - user: string; - } - - export interface JobTaskAddLinkedAttachmentParams { - jobId: number; - attachmentType: number; - path: string; - user: string; - } - - export interface JobTaskAddLinkedRecordParams { - jobId: number; - tableName: string; - user: string; - } - - export interface JobTaskAssignJobsParams { - jobIds: number[]; - assignedType: string; - assignedTo: string; - user: string; - } - - export interface JobTaskCloseJobsParams { - jobIds: number[]; - user: string; - } - - export interface JobTaskCreateDependencyParams { - jobId: number; - heldOnType: string; - heldOnValue: number; - depJobId: number; - depOnType: string; - depOnValue: number; - user: string; - } - - export interface JobTaskCreateHoldParams { - jobId: number; - holdTypeId: number; - comments: string; - user: string; - } - - export interface JobTaskCreateJobVersionParams { - jobId: number; - name: string; - parent: string; - user: string; - } - - export interface JobTaskDeleteAttachmentParams { - jobId: number; - attachmentId: number; - user: string; - } - - export interface JobTaskDeleteDependencyParams { - jobId: number; - dependencyId: number; - user: string; - } - - export interface JobTaskDeleteJobsParams { - jobIds: number[]; - deleteHistory?: boolean; - user: string; - } - - export interface JobTaskDeleteLinkedRecordParams { - jobId: number; - tableName: string; - recordId: number; - user: string; - } - - export interface JobTaskGetAttachmentContentUrlParams { - jobId: number; - attachmentId: number; - } - - export interface JobTaskListFieldValuesParams { - jobId: number; - tableName: string; - field: string; - user: string; - } - - export interface JobTaskListMultiLevelFieldValuesParams { - field: string; - previousSelectedValues: string[]; - user: string; - } - - export interface JobTaskLogActionParams { - jobId: number; - activityTypeId: number; - comments: string; - user: string; - } - - export interface JobTaskQueryJobsParams { - queryId: number; - user: string; - } - - export interface JobTaskQueryMultiLevelSelectedValuesParams { - field: string; - user: string; - } - - export interface JobTaskReleaseHoldParams { - jobId: number; - holdId: number; - } - - export interface JobTaskReopenClosedJobsParams { - jobIds: number[]; - user: string; - } - - export interface JobTaskSearchJobsParams { - text: string; - user: string; - } - - export interface JobTaskUnassignJobsParams { - jobIds: number[]; - user: string; - } - - export interface JobTaskUpdateNotesParams { - jobId: number; - notes: string; - user: string; - } - - export interface JobTaskUpdateRecordParams { - jobId: number; - record: AuxRecordDescription; - user: string; - } - - export interface JobUpdateParameters { - ownedBy: string; - assignedTo: string; - dataWorkspaceId: string; - description: string; - dueDate: Date; - loi: Geometry; - jobId: number; - name: string; - assignedType: string; - parentJobId: number; - parentVersion: string; - percent: number; - priority: number; - startDate: Date; - status: number; - versionName: string; - user: string; - } - - export interface ChangeRule { - description: string; - evaluators: any[]; - id: number; - name: string; - notifier: any; - summarize: boolean; - } - - export interface NotificationTaskAddChangeRuleParams { - rule: ChangeRule; - user: string; - } - - export interface NotificationTaskDeleteChangeRuleParams { - ruleId: string; - user: string; - } - - export interface NotificationTaskNotifySessionParams { - sessionid: string; - deleteAfter: boolean; - user: string; - } - - export interface NotificationTaskQueryChangeRulesParams { - name: string; - description: string; - searchType: string; - user: string; - } - - export interface NotificationTaskRunSpatialNotificationOnHistoryParams { - dataWorkspaceId: string; - from: Date; - to: Date; - logMatches: boolean; - send: boolean; - user: string; - } - - export interface NotificationTaskSendNotificationParams { - jobId: number; - notificationType: string; - user: string; - } - - export interface NotificationTaskSubscribeToNotificationParams { - notificationTypeId: number; - email: string; - user: string; - } - - export interface NotificationTaskUnsubscribeFromNotificationParams { - notificationTypeId: number; - email: string; - user: string; - } - - export interface ReportTaskGenerateReportParams { - reportId: number; - user: string; - } - - export interface ReportTaskGetReportContentUrlParams { - reportId: number; - user: number; - } - - export interface ReportTaskGetReportDataParams { - reportId: number; - user: string; - } - - export interface TokenTaskParseTokensParams { - jobId: any; - stringToParse: string; - user: string; - } - - export interface WorkflowTaskCanRunStepParams { - jobId: number; - stepId: number; - user: string; - } - - export interface WorkflowTaskExecuteStepsParams { - jobId: number; - stepIds: number[]; - auto: boolean; - user: string; - } - - export interface WorkflowTaskGetStepDescriptionParams { - jobId: number; - stepId: number; - } - - export interface WorkflowTaskGetStepFileUrlParams { - jobId: number; - stepId: number; - } - - export interface WorkflowTaskGetStepParams { - jobId: number; - stepId: number; - } - - export interface WorkflowTaskMarkStepsAsDoneParams { - jobId: number; - stepIds: number[]; - user: string; - } - - export interface WorkflowTaskMoveToNextStepParams { - jobId: number; - stepId: number; - returnCode: number; - user: string; - } - - export interface WorkflowTaskRecreateWorkflowParams { - jobId: number; - user: string; - } - - export interface WorkflowTaskResolveConflictParams { - jobId: number; - stepId: number; - optionReturnCode: number; - optionStepIds: number[]; - user: string; - } - - export interface WorkflowTaskSetCurrentStepParams { - jobId: number; - stepId: number; - user: string; - } - - export interface ImageryLayerViewPixelData { - extent?: Extent; - pixelBlock: PixelBlock; - } - - export interface StreamLayerViewDataReceivedEvent { - } - - export type StreamLayerViewDataReceivedEventHandler = (event: StreamLayerViewDataReceivedEvent) => void; - - export interface StreamLayerViewFilter { - geometry?: Extent; - where?: string; - } - - export interface StreamLayerViewUpdateFilterFilter { - geometry?: Extent; - where?: string; - } - - export interface SlideApplyToOptions { - animate: boolean; - speedFactor?: number; - duration?: number; - maxDuration?: number; - easing?: string | EasingFunction; - } - - export interface SlideCreateFromOptions { - screenshot: SlideCreateFromOptionsScreenshot; - } - - export interface SlideCreateFromOptionsScreenshot { - format: string; - quality: number; - width: number; - height: number; - } - - export interface SlideDescriptionProperties { - text?: string; - } - export interface SlideDescription extends Accessor { - text?: string; - } - - export interface SlideThumbnailProperties { - url?: string; - } - export interface SlideThumbnail extends Accessor { - url?: string; - } - - export interface SlideTitleProperties { - text?: string; - } - export interface SlideTitle extends Accessor { - text?: string; - } - - export interface SlideUpdateFromOptions { - screenshot: SlideUpdateFromOptionsScreenshot; - } - - export interface SlideUpdateFromOptionsScreenshot { - format: string; - quality: number; - width: number; - height: number; - } - - export interface SlideVisibleLayers extends Collection { - id: string; - } - - export interface ColorSliderValues { - color: Color; - value: number; - label: string; - } - - export interface LegendLayerInfos { - title?: string; - layer: Layer; - } - - export interface PopupDockOptions { - breakpoint?: any | boolean; - buttonEnabled?: boolean; - position?: string | Function; - } - - export interface PopupOpenOptions { - title?: string; - content?: string; - location?: Geometry; - features?: Graphic[]; - promises?: IPromise[]; - updateLocationEnabled?: boolean; - } - - export interface SearchViewModelSearchCompleteEventResults { - results: SearchViewModelSearchCompleteEventResultsResults[]; - sourceIndex: number; - source: any[]; - } - - export interface SearchViewModelSearchCompleteEventResultsResults { - extent: Extent; - feature: Graphic; - name: string; - } - - export interface SearchViewModelSelectResultEventResult { - extent: Extent; - feature: Graphic; - name: string; - } - - export interface SearchViewModelSuggestCompleteEventResults { - results: SearchViewModelSuggestCompleteEventResultsResults[]; - sourceIndex: number; - source: any; - } - - export interface SearchViewModelSuggestCompleteEventResultsResults { - extent: Extent; - feature: Graphic; - name: string; - isCollection: boolean; - magicKey: string; - text: string; - } - - export interface SearchViewModelLoadEvent { - } - - export type SearchViewModelLoadEventHandler = (event: SearchViewModelLoadEvent) => void; - - export interface SearchViewModelSearchClearEvent { - } - - export type SearchViewModelSearchClearEventHandler = (event: SearchViewModelSearchClearEvent) => void; - - export interface SearchViewModelSearchCompleteEvent { - activeSourceIndex: number; - errors: Error[]; - numResults: number; - searchTerm: string; - results: SearchViewModelSearchCompleteEventResults[]; - } - - export type SearchViewModelSearchCompleteEventHandler = (event: SearchViewModelSearchCompleteEvent) => void; - - export interface SearchViewModelSearchStartEvent { - } - - export type SearchViewModelSearchStartEventHandler = (event: SearchViewModelSearchStartEvent) => void; - - export interface SearchViewModelSelectResultEvent { - result: SearchViewModelSelectResultEventResult; - source: any; - sourceIndex: number; - } - - export type SearchViewModelSelectResultEventHandler = (event: SearchViewModelSelectResultEvent) => void; - - export interface SearchViewModelSuggestCompleteEvent { - activeSourceIndex: number; - errors: Error[]; - numResults: number; - searchTerm: string; - results: SearchViewModelSuggestCompleteEventResults[]; - } - - export type SearchViewModelSuggestCompleteEventHandler = (event: SearchViewModelSuggestCompleteEvent) => void; - - export interface SearchViewModelSuggestStartEvent { - } - - export type SearchViewModelSuggestStartEventHandler = (event: SearchViewModelSuggestStartEvent) => void; - - export interface DynamicLayerFetchImageOptions { - allowImageDataAccess?: boolean; - rotation?: number; - pixelRatio?: number; - } - - export interface DynamicLayerGetImageUrlOptions { - pixelRatio?: number; - rotation?: number; - } - - export interface ArcGISDynamicMapServiceGetExportImageParametersOptions { - rotation?: number; - } - - export interface SceneServiceVersion { - major: number; - minor: number; - versionString: string; - } - - export interface BreakpointsOwnerBreakpoints { - xsmall: number; - small: number; - medium: number; - large: number; - } - - export interface configRequest { - corsDetection?: boolean; - corsDetectionTimeout?: number; - corsEnabledServers?: Array; - forceProxy?: boolean; - httpsDomains?: string[]; - maxUrlLength?: number; - proxyUrl?: string; - timeout?: number; - useCors?: string | boolean; - proxyRules?: configRequestProxyRules[]; - } - - export interface configRequestCorsEnabledServers { - host?: string; - withCredentials?: boolean; - } - - export interface configRequestProxyRules { - proxyUrl?: string; - urlPrefix?: string; - } - - export interface configWorkers { - loaderConfig?: configWorkersLoaderConfig; - } - - export interface configWorkersLoaderConfig { - has?: any; - paths?: any; - map?: any; - packages?: any[]; - } - - export interface requestEsriRequestOptions { - callbackParamName?: string; - query?: any; - responseType?: string; - headers?: any; - timeout?: number; - method?: string; - body?: any | any | string; - useProxy?: boolean; - cacheBust?: boolean; - allowImageDataAccess?: boolean; - } - - export interface EachAlwaysResult { - promise: IPromise; - value: any; - error: any; - } - - export interface urlUtilsAddProxyRuleRule { - proxyUrl: string; - urlPrefix: string; - } - - export type EventAttachedCallback = (target: any, propName: string, obj: Accessor, eventName: string) => void; - - export interface PausableWatchHandle { - remove(): void; - pause(): void; - resume(): void; - } - - export interface decoratorsPropertyPropertyMetadata { - dependsOn?: string[]; - type?: Function; - cast?: Function; - readOnly?: boolean; - aliasOf?: string; - value?: any; - } - - export interface colorCreateContinuousRendererParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - theme?: string; - colorScheme?: any; - legendOptions?: colorCreateContinuousRendererParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - defaultSymbolEnabled?: boolean; - view?: SceneView; - symbolType?: string; - colorMixMode?: string; - } - - export interface colorCreateContinuousRendererParamsLegendOptions { - title: string; - } - - export interface colorCreateVisualVariableParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - theme?: string; - colorScheme?: any; - legendOptions?: colorCreateVisualVariableParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - view?: SceneView; - worldScale?: boolean; - } - - export interface colorCreateVisualVariableParamsLegendOptions { - title: string; - } - - export interface locationCreateRendererParams { - layer: FeatureLayer | SceneLayer; - basemap?: string | Basemap; - locationScheme?: any | any | any; - view?: SceneView; - symbolType?: string; - colorMixMode?: string; - } - - export interface sizeCreateContinuousRendererParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - sizeScheme?: any | any | any; - legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - defaultSymbolEnabled?: boolean; - view?: SceneView; - symbolType?: string; - } - - export interface sizeCreateContinuousRendererParamsLegendOptions { - title: string; - } - - export interface sizeCreateVisualVariablesParams { - layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; - basemap?: string | Basemap; - sizeScheme?: any | any | any; - legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; - statistics?: any; - minValue?: number; - maxValue?: number; - view?: SceneView; - worldScale?: boolean; - axis?: boolean; - } - - export interface sizeCreateVisualVariablesParamsLegendOptions { - title: string; - } - - export interface typeCreateRendererParams { - layer: FeatureLayer | SceneLayer; - field: string; - basemap?: string | Basemap; - numTypes?: number; - sortBy?: string; - typeScheme?: any | any | any; - legendOptions?: typeCreateRendererParamsLegendOptions; - defaultSymbolEnabled?: boolean; - view?: SceneView; - symbolType?: string; - statistics?: any; - colorMixMode?: string; - } - - export interface typeCreateRendererParamsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateContinuousRendererParams { - layer: FeatureLayer | SceneLayer; - basemap?: string | Basemap; - field: string; - normalizationField?: string; - statistics?: any; - minValue?: number; - maxValue?: number; - defaultSymbolEnabled?: boolean; - colorOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptions; - sizeOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptions; - view?: SceneView; - symbolType?: string; - } - - export interface univariateColorSizeCreateContinuousRendererParamsColorOptions { - theme?: string; - colorScheme?: any; - legendOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; - } - - export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions { - sizeScheme?: any | any | any; - legendOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; - } - - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateVisualVariablesParams { - layer: FeatureLayer | SceneLayer; - basemap?: string | Basemap; - field: string; - normalizationField?: string; - statistics?: any; - minValue?: number; - maxValue?: number; - colorOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptions; - sizeOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptions; - view?: SceneView; - worldScale?: boolean; - } - - export interface univariateColorSizeCreateVisualVariablesParamsColorOptions { - theme?: string; - colorScheme?: any; - legendOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; - } - - export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions { - title: string; - } - - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { - axis?: boolean; - sizeScheme?: any | any | any; - legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; - } - - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions { - title: string; - } - - export interface classBreaksClassBreaksParams { - layer: FeatureLayer | SceneLayer; - field?: string; - normalizationField?: string; - classificationMethod?: string; - standardDeviationInterval?: number; - minValue?: number; - maxValue?: number; - numClasses?: number; - } - - export interface histogramHistogramParams { - layer: FeatureLayer | SceneLayer; - field?: string; - normalizationField?: string; - classificationMethod?: string; - standardDeviationInterval?: number; - minValue?: number; - maxValue?: number; - numBins?: number; - } - - export interface summaryStatisticsSummaryStatisticsParams { - layer: FeatureLayer | SceneLayer; - field?: string; - normalizationField?: string; - features?: Graphic[]; - minValue?: number; - maxValue?: number; - } - - export interface uniqueValuesUniqueValuesParams { - layer: FeatureLayer | SceneLayer; - field: string; - features?: Graphic[]; - returnAllCodedValues?: boolean; - } - - export interface colorGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - theme: string; - view?: SceneView; - worldScale?: boolean; - } - - export interface locationGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - view?: SceneView; - worldScale?: boolean; - } - - export interface sizeGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - view?: SceneView; - worldScale?: boolean; - } - - export interface typeGetSchemesParams { - basemap: string | Basemap; - geometryType: string; - worldScale?: boolean; - view?: SceneView; - } - - export interface JobQuery { - id: number; - name: string; - } - - export interface GroupMembership { - id: number; - name: string; - } - - export interface JobQueryContainer { - containers: JobQueryContainer[]; - id: number; - name: string; - queries: JobQuery[]; - } - - export interface Privilege { - description: string; - id: number; - name: string; - } - - export interface DataWorkspace { - id: string; - name: string; - } - - export interface HoldType { - description: string; - id: number; - name: string; - } - - export interface JobPriority { - description: string; - name: string; - value: number; - } - - export interface JobStatus { - caption: string; - description: string; - id: number; - name: string; - } - - export interface JobType { - category: string; - description: string; - id: string; - name: string; - state: string; - } - - export interface ActivityType { - desription: string; - id: number; message: string; - name: string; } - export interface NotificationType { - attachJobAttachments: boolean; - id: number; - message: string; - senderEmail: string; - senderName: string; - subject: string; - subscribers: string[]; - type: string; - } - - export interface AuxRecord { - displayProperty: any; - id: number; - recordvalues: AuxRecordValue; - } - - export interface AuxRecordValue { - filter: string; - alias: string; - data: any; - dataType: string; - displayOrder: number; - displayType: string; - domain: string; - canUpdate: boolean; - length: number; - name: string; - required: boolean; - tableListClass: string; - tableListDisplayField: string; - tableListStoreField: string; - userVisible: boolean; - } - - export interface JobVersionInfo { - dataWorkspaceId: string; - name: string; - parent: string; - created: boolean; - owner: string; - } - - export interface QueryFieldInfo { - alias: string; - length: string; - name: string; - type: string; - } - - export interface DatasetConfiguration { - changeCondition: number; - changeFields: string; - dataset: string; - dataWorkspaceId: string; - name: string; - whereConditions: WhereCondition[]; - } - - export interface WhereCondition { - compareValue: any; - field: string; - operator: string; - } - - export interface ReportDataGroup { - aggregateLabel: string; - aggregateValue: string; - row: string[]; - value: string; - } - - export interface WorkflowConflicts { - jobID: number; - options: WorkflowOption[]; - spawnsConcurrency: boolean; - stepId: number; - } - - export interface WorkflowOption { - returnCode: number; - steps: WorkflowStepInfo[]; - } - - export interface WorkflowStepInfo { - id: number; - name: string; - } - - export interface StepType { - program: string; - arguments: string; - executionType: string; - id: number; - name: string; - description: string; - stepDescriptionLink: string; - stepDescriptionType: string; - stepIndicatorType: string; - supportedPlatform: string; - visible: boolean; - } - - export interface WorkflowAnnotationDisplayDetails { - centerX: number; - centerY: number; - fillColor: any; - height: number; - label: string; - labelColor: any; - OutlineColor: any; - width: number; - } - - export interface WorkflowPathDisplayDetails { - destStepId: number; - sourceStepID: number; - label: string; - labelColor: any; - labelX: number; - labelY: number; - lineColor: any; - pathObject: any; - } - - export interface WorkflowStepDisplayDetails { - labelColor: any; - centerX: number; - fillColor: any; - height: number; - label: string; - centerY: number; - OutlineColor: any; - shape: string; - stepId: number; - stepType: string; - width: number; - } - - export interface ColorAndIntensity { - color: any; - intensity: number; - } - - export interface RenderCamera { - viewMatrix: any; - viewInverseTransposeMatrix: any; - projectionMatrix: any; - eye: any; - center: any; - up: any; - near: number; - far: number; - fovX: number; - fovY: number; - } - - export interface SunLight { - direction: any; - diffuse: ColorAndIntensity; - ambient: ColorAndIntensity; - } - - interface Basemap extends Accessor, Loadable, JSONSupport { - baseLayers: Collection; - id: string; - loaded: boolean; - portalItem: PortalItem; - referenceLayers: Collection; - thumbnailUrl: string; - title: string; - - clone(): this; - } - - interface BasemapConstructor { - new(properties?: BasemapProperties): Basemap; - - - fromId(id: string): Basemap; - - fromJSON(json: any): Basemap; - } - - export const Basemap: BasemapConstructor; - - interface BasemapProperties extends LoadableProperties { - baseLayers?: Collection | any[]; - id?: string; - loaded?: boolean; - portalItem?: PortalItemProperties; - referenceLayers?: Collection | any[]; - thumbnailUrl?: string; - title?: string; - } - - interface Camera extends Accessor, JSONSupport { - fov: number; - heading: number; - position: Point; - tilt: number; - - clone(): this; - } - - interface CameraConstructor { - new(properties?: CameraProperties): Camera; - - fromJSON(json: any): Camera; - } - - export const Camera: CameraConstructor; - - interface CameraProperties { - fov?: number; - heading?: number; - position?: PointProperties; - tilt?: number; - } - - interface Color { - a: number; - b: number; - g: number; - r: number; - - clone(): this; - setColor(color: string | number[] | any): Color; - toCss(includeAlpha?: boolean): string; - toHex(): string; - toJSON(): any; - toRgb(): number[]; - toRgba(): number[]; - } - - interface ColorConstructor { - - blendColors(start: Color, end: Color, weight: number, obj?: Color): Color; - new(color: string | number[] | any): Color; - fromArray(a: number[], obj?: Color): Color; - fromHex(color: string, obj?: Color): Color; - fromJSON(json: any): Color; - fromRgb(color: string, obj?: Color): Color; - fromString(str: string, obj?: Color): Color; - } - - export const Color: ColorConstructor; - - interface Graphic extends Accessor, JSONSupport { - attributes: any; - geometry: Geometry; - layer: FeatureLayer | GraphicsLayer; - popupTemplate: PopupTemplate; - symbol: Symbol; - visible: boolean; - - clone(): this; - getAttribute(name: string): any; - getEffectivePopupTemplate(): PopupTemplate; - setAttribute(name: string, newValue: any): void; - } - - interface GraphicConstructor { - new(properties?: GraphicProperties): Graphic; - - fromJSON(json: any): Graphic; - } - - export const Graphic: GraphicConstructor; - - interface GraphicProperties { - attributes?: any; - geometry?: GeometryProperties; - layer?: FeatureLayer | GraphicsLayer; - popupTemplate?: PopupTemplateProperties; - symbol?: SymbolProperties; - visible?: boolean; - } - - interface Ground extends Accessor { - layers: Collection; - - clone(): this; - queryElevation(geometry: Point | Multipoint | Polyline, options?: GroundQueryElevationOptions): IPromise; - } - - interface GroundConstructor { - new(properties?: GroundProperties): Ground; - } - - export const Ground: GroundConstructor; - - interface GroundProperties { - layers?: Collection | any[]; - } - - interface Map extends Accessor, LayersMixin { - allLayers: Collection; - basemap: Basemap; - ground: Ground; - } - - interface MapConstructor { - new(properties?: MapProperties): Map; - } - - export const Map: MapConstructor; - - interface MapProperties extends LayersMixinProperties { - allLayers?: Collection | any[]; - basemap?: BasemapProperties; - ground?: GroundProperties; - } - - interface PopupTemplate extends Accessor, JSONSupport { - actions: Collection; - content: string; - expressionInfos: PopupTemplateExpressionInfos[]; - fieldInfos: PopupTemplateFieldInfos[]; - overwriteActions: boolean; - title: string; - - clone(): this; - } - - interface PopupTemplateConstructor { - new(properties?: PopupTemplateProperties): PopupTemplate; - - fromJSON(json: any): PopupTemplate; - } - - export const PopupTemplate: PopupTemplateConstructor; - - interface PopupTemplateProperties { - actions?: Collection | any[]; - content?: string | any[] | Function | IPromise; - expressionInfos?: PopupTemplateExpressionInfos[]; - fieldInfos?: PopupTemplateFieldInfos[]; - overwriteActions?: boolean; - title?: string | Function; - } - - interface Viewpoint extends Accessor, JSONSupport { - camera: Camera; - rotation: number; - scale: number; - targetGeometry: Geometry; - - clone(): this; - } - - interface ViewpointConstructor { - new(properties?: ViewpointProperties): Viewpoint; - - fromJSON(json: any): Viewpoint; - } - - export const Viewpoint: ViewpointConstructor; - - interface ViewpointProperties { - camera?: CameraProperties; - rotation?: number; - scale?: number; - targetGeometry?: GeometryProperties; - } - - interface WebMap extends Map, corePromise { - applicationProperties: any; - bookmarks: any[]; - initialViewProperties: InitialViewProperties; - loaded: boolean; - loadError: Error; - loadStatus: string; - portalItem: PortalItem; - presentation: any; - sourceVersion: WebMapSourceVersion; - tables: any[]; - widgets: any; - - load(): IPromise; - } - - interface WebMapConstructor { - new(properties?: WebMapProperties): WebMap; - } - - export const WebMap: WebMapConstructor; - - interface WebMapProperties extends MapProperties { - applicationProperties?: any; - bookmarks?: any[]; - initialViewProperties?: InitialViewPropertiesProperties; - loaded?: boolean; - loadError?: Error; - loadStatus?: string; - portalItem?: PortalItemProperties; - presentation?: any; - sourceVersion?: WebMapSourceVersion; - tables?: any[]; - widgets?: any; - } - - interface WebScene extends Map, corePromise { - clippingArea: Extent; - clippingEnabled: boolean; - initialViewProperties: websceneInitialViewProperties; - loaded: boolean; - loadError: Error; - loadStatus: string; - portalItem: PortalItem; - presentation: Presentation; - sourceVersion: WebSceneSourceVersion; - - load(): IPromise; - save(options?: WebSceneSaveOptions): IPromise; - saveAs(portalItem: PortalItem, options?: WebSceneSaveAsOptions): IPromise; - toJSON(): any; - updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): void; - } - - interface WebSceneConstructor { - new(properties?: WebSceneProperties): WebScene; - - - fromJSON(json: any): any; - } - - export const WebScene: WebSceneConstructor; - - interface WebSceneProperties extends MapProperties { - clippingArea?: ExtentProperties; - clippingEnabled?: boolean; - initialViewProperties?: websceneInitialViewPropertiesProperties; - loaded?: boolean; - loadError?: Error; - loadStatus?: string; - portalItem?: PortalItemProperties; - presentation?: PresentationProperties; - sourceVersion?: WebSceneSourceVersion; - } - - - - interface Collection extends Accessor, Evented { - length: number; - - add(item: any, index?: number): void; - addMany(items: any[] | Collection, index?: number): void; - clone(): this; - concat(value: any[] | Collection): Collection; - every(callback: ItemTestCallback): boolean; - filter(callback: ItemTestCallback): Collection; - find(callback: ItemTestCallback): any; - findIndex(callback: ItemTestCallback): number; - flatten(callback: ItemCallback): Collection; - forEach(callback: ItemCallback): void; - getItemAt(index: number): any; - includes(searchElement: any): boolean; - indexOf(searchElement: any, fromIndex?: number): number; - join(separator?: string): string; - lastIndexOf(searchElement: any, fromIndex?: number): number; - map(callback: ItemMapCallback): Collection; - pop(): any; - push(item: any): number; - reduce(callback: ItemReduceCallback): any; - reduceRight(callback: ItemReduceCallback, initialValue?: any): any; - remove(item: any): void; - removeAll(): void; - removeAt(index: number): any; - removeMany(items: any[] | Collection): any; - reorder(item: any, index: number): any; - reverse(): Collection; - shift(): any; - slice(begin?: number, end?: number): Collection; - some(callback: ItemCallback): boolean; - sort(compareFunction?: ItemCompareCallback): void; - splice(start: number, deleteCount: number, items: any): any[]; - toArray(): any[]; - unshift(items: any): number; - } - - interface CollectionConstructor { - new(properties?: CollectionProperties): Collection; - - - isCollection(value: any): boolean; - ofType(type: any): any; - } - - export const Collection: CollectionConstructor; - - interface CollectionProperties { - length?: number; - } - - interface Connection { - broadcast(methodName: string, data?: any, buffers?: any[]): IPromise[]; - close(): void; - invoke(methodName: string, data?: any, buffers?: any[]): IPromise; - } - - interface ConnectionConstructor { - new(client: any, id: number): Connection; - } - - export const Connection: ConnectionConstructor; - - interface Circle extends Polygon { - center: Point | number[]; - geodesic: boolean; - numberOfPoints: number; - radius: number; - radiusUnit: string; - } - - interface CircleConstructor { - new(properties?: CircleProperties): Circle; - - fromJSON(json: any): Circle; - } - - export const Circle: CircleConstructor; - - interface CircleProperties extends PolygonProperties { - center?: Point | number[]; - geodesic?: boolean; - numberOfPoints?: number; - radius?: number; - radiusUnit?: string; - } - - interface Extent extends Geometry { - center: Point; - height: number; - mmax: number; - mmin: number; - width: number; - xmax: number; - xmin: number; - ymax: number; - ymin: number; - zmax: number; - zmin: number; - - centerAt(point: Point): Extent; - contains(geometry: Point | Extent): boolean; - equals(extent: Extent): boolean; - expand(factor: number): Extent; - intersection(extent: Extent): Extent; - intersects(geometry: Geometry): boolean; - normalize(): Extent[]; - offset(dx: number, dy: number, dz: number): Extent; - union(extent: Extent): Extent; - } - - interface ExtentConstructor { - new(properties?: ExtentProperties): Extent; - - fromJSON(json: any): Extent; - } - - export const Extent: ExtentConstructor; - - interface ExtentProperties extends GeometryProperties { - center?: PointProperties; - height?: number; - mmax?: number; - mmin?: number; - width?: number; - xmax?: number; - xmin?: number; - ymax?: number; - ymin?: number; - zmax?: number; - zmin?: number; - } - - interface Geometry extends Accessor, JSONSupport { - cache: any; - extent: Extent; - hasM: boolean; - hasZ: boolean; - spatialReference: SpatialReference; - type: string; - - clone(): this; - } - - interface GeometryConstructor { - new(properties?: GeometryProperties): Geometry; - - fromJSON(json: any): Geometry; - } - - export const Geometry: GeometryConstructor; - - interface GeometryProperties { - cache?: any; - extent?: ExtentProperties; - hasM?: boolean; - hasZ?: boolean; - spatialReference?: SpatialReferenceProperties; - type?: string; - } - - interface Multipoint extends Geometry { - points: number[][]; - - addPoint(point: Point | number[]): Multipoint; - getPoint(index: number): Point; - removePoint(index: number): Point; - setPoint(index: number, point: Point): Multipoint; - } - - interface MultipointConstructor { - new(properties?: MultipointProperties): Multipoint; - - fromJSON(json: any): Multipoint; - } - - export const Multipoint: MultipointConstructor; - - interface MultipointProperties extends GeometryProperties { - points?: number[][]; - } - - interface Point extends Geometry { - latitude: number; - longitude: number; - m: number; - x: number; - y: number; - z: number; - - copy(other: Point): void; - distance(other: Point): number; - equals(point: Point): boolean; - normalize(): Point; - } - - interface PointConstructor { - new(properties?: PointProperties): Point; - - fromJSON(json: any): Point; - } - - export const Point: PointConstructor; - - interface PointProperties extends GeometryProperties { - latitude?: number; - longitude?: number; - m?: number; - x?: number; - y?: number; - z?: number; - } - - interface Polygon extends Geometry { - centroid: Point; - isSelfIntersecting: boolean; - rings: number[][][]; - - addRing(ring: Point[] | number[][]): Polygon; - contains(point: Point): boolean; - getPoint(ringIndex: number, pointIndex: number): Point; - insertPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; - isClockwise(ring: Point[] | number[][]): boolean; - removePoint(ringIndex: number, pointIndex: number): Point[]; - removeRing(index: number): Point[]; - setPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; - } - - interface PolygonConstructor { - new(properties?: PolygonProperties): Polygon; - - - fromExtent(extent: Extent): Polygon; - - fromJSON(json: any): Polygon; - } - - export const Polygon: PolygonConstructor; - - interface PolygonProperties extends GeometryProperties { - centroid?: PointProperties; - isSelfIntersecting?: boolean; - rings?: number[][][]; - } - - interface Polyline extends Geometry { - paths: number[][][]; - - addPath(points: number[][]): Polyline; - getPoint(pathIndex: number, pointIndex: number): Point; - insertPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; - removePath(index: number): Point[]; - removePoint(pathIndex: number, pointIndex: number): Point; - setPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; - } - - interface PolylineConstructor { - new(properties?: PolylineProperties): Polyline; - - fromJSON(json: any): Polyline; - } - - export const Polyline: PolylineConstructor; - - interface PolylineProperties extends GeometryProperties { - paths?: number[][][]; - } - - interface ScreenPoint extends Accessor { - x: number; - y: number; - } - - interface ScreenPointConstructor { - new(properties?: ScreenPointProperties): ScreenPoint; - } - - export const ScreenPoint: ScreenPointConstructor; - - interface ScreenPointProperties { - x?: number; - y?: number; - } - - interface SpatialReference extends Accessor, JSONSupport { - isGeographic: boolean; - isWebMercator: boolean; - isWGS84: boolean; - isWrappable: boolean; - WebMercator: SpatialReference; - WGS84: SpatialReference; - wkid: number; - wkt: string; - - clone(): this; - equals(spatialReference: SpatialReference): boolean; - } - - interface SpatialReferenceConstructor { - new(properties?: SpatialReferenceProperties): SpatialReference; - - fromJSON(json: any): SpatialReference; - } - - export const SpatialReference: SpatialReferenceConstructor; - - interface SpatialReferenceProperties { - isGeographic?: boolean; - isWebMercator?: boolean; - isWGS84?: boolean; - isWrappable?: boolean; - WebMercator?: SpatialReferenceProperties; - WGS84?: SpatialReferenceProperties; - wkid?: number; - wkt?: string; - } - - interface Credential extends Accessor { - expires: number; - isAdmin: boolean; - oAuthState: any; - server: string; - ssl: boolean; - token: string; - userId: string; - - destroy(): void; - refreshToken(): void; - } - - interface CredentialConstructor { - new(properties?: CredentialProperties): Credential; - } - - export const Credential: CredentialConstructor; - - interface CredentialProperties { - expires?: number; - isAdmin?: boolean; - oAuthState?: any; - server?: string; - ssl?: boolean; - token?: string; - userId?: string; - } - - interface IdentityManagerBase extends Evented { - tokenValidity: number; - - checkSignInStatus(resUrl: string): IPromise; - destroyCredentials(): void; - findCredential(url: string, userId?: string): Credential; - findOAuthInfo(url: string): OAuthInfo; - findServerInfo(url: string): ServerInfo; - generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerBaseGenerateTokenOptions): IPromise; - getCredential(url: string, options?: IdentityManagerBaseGetCredentialOptions): IPromise; - initialize(json: any): void; - isBusy(): boolean; - oAuthSignIn(resUrl: string, serverInfo: ServerInfo, oAuthInfo: OAuthInfo, options?: IdentityManagerBaseOAuthSignInOptions): IPromise; - registerOAuthInfos(oAuthInfos: OAuthInfo[]): void; - registerServers(serverInfos: ServerInfo[]): void; - registerToken(properties: IdentityManagerBaseRegisterTokenProperties): void; - setProtocolErrorHandler(handlerFunction: IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction): void; - setRedirectionHandler(handlerFunction: IdentityManagerBaseSetRedirectionHandlerHandlerFunction): void; - signIn(url: string, serverInfo: ServerInfo, options?: IdentityManagerBaseSignInOptions): IPromise; - toJSON(): any; - } - - interface IdentityManagerBaseConstructor { - new(): IdentityManagerBase; - } - - export const IdentityManagerBase: IdentityManagerBaseConstructor; - - interface IdentityManager extends IdentityManagerBase { - dialog: any; - - setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; - setOAuthResponseHash(hash: string): void; - - on(name: "credential-create", eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; - on(name: "credential-create", modifiers: string[], eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; - on(name: "credentials-destroy", eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; - on(name: "credentials-destroy", modifiers: string[], eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; - } - - interface IdentityManagerConstructor { - new(): IdentityManager; - } - - export const IdentityManager: IdentityManagerConstructor; - - interface OAuthInfo extends Accessor, JSONSupport { - appId: string; - authNamespace: string; - expiration: number; - locale: string; - minTimeUntilExpiration: number; - popup: boolean; - popupCallbackUrl: string; - popupWindowFeatures: string; - portalUrl: string; - - clone(): this; - } - - interface OAuthInfoConstructor { - new(properties?: OAuthInfoProperties): OAuthInfo; - - fromJSON(json: any): OAuthInfo; - } - - export const OAuthInfo: OAuthInfoConstructor; - - interface OAuthInfoProperties { - appId?: string; - authNamespace?: string; - expiration?: number; - locale?: string; - minTimeUntilExpiration?: number; - popup?: boolean; - popupCallbackUrl?: string; - popupWindowFeatures?: string; - portalUrl?: string; - } - - interface ServerInfo extends Accessor, JSONSupport { - adminTokenServiceUrl: string; - currentVersion: number; - server: string; - shortLivedTokenValidity: number; - tokenServiceUrl: string; - } - - interface ServerInfoConstructor { - new(properties?: ServerInfoProperties): ServerInfo; - - fromJSON(json: any): ServerInfo; - } - - export const ServerInfo: ServerInfoConstructor; - - interface ServerInfoProperties { - adminTokenServiceUrl?: string; - currentVersion?: number; - server?: string; - shortLivedTokenValidity?: number; - tokenServiceUrl?: string; - } - - interface BaseElevationLayer extends Layer { - spatialReference: SpatialReference; - tileInfo: TileInfo; - - addResolvingPromise(promiseToLoad: IPromise): IPromise; - fetchTile(level: number, row: number, column: number, options?: BaseElevationLayerFetchTileOptions): IPromise; - getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; - - on(name: "layerview-create", eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; - } - - interface BaseElevationLayerConstructor { - new(properties?: BaseElevationLayerProperties): BaseElevationLayer; - } - - export const BaseElevationLayer: BaseElevationLayerConstructor; - - interface BaseElevationLayerProperties extends LayerProperties { - spatialReference?: SpatialReferenceProperties; - tileInfo?: TileInfoProperties; - } - - interface CSVLayer extends Layer { - copyright: string; - delimiter: string; - elevationInfo: CSVLayerElevationInfo; - featureReduction: CSVLayerFeatureReduction; - fields: Field[]; - labelingInfo: LabelClass[]; - labelsVisible: boolean; - latitudeField: string; - legendEnabled: boolean; - longitudeField: string; - maxScale: number; - minScale: number; - outFields: string[]; - popupEnabled: boolean; - popupTemplate: PopupTemplate; - renderer: Renderer; - screenSizePerspectiveEnabled: boolean; - url: string; - - on(name: "layerview-create", eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; - } - - interface CSVLayerConstructor { - new(properties?: CSVLayerProperties): CSVLayer; - } - - export const CSVLayer: CSVLayerConstructor; - - interface CSVLayerProperties extends LayerProperties { - copyright?: string; - delimiter?: string; - elevationInfo?: CSVLayerElevationInfo; - featureReduction?: CSVLayerFeatureReduction; - fields?: FieldProperties[]; - labelingInfo?: LabelClassProperties[]; - labelsVisible?: boolean; - latitudeField?: string; - legendEnabled?: boolean; - longitudeField?: string; - maxScale?: number; - minScale?: number; - outFields?: string[]; - popupEnabled?: boolean; - popupTemplate?: PopupTemplateProperties; - renderer?: RendererProperties; - screenSizePerspectiveEnabled?: boolean; - url?: string; - } - - interface ElevationLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { - url: string; - - fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; - queryElevation(geometry: Point | Multipoint | Polyline, options?: ElevationLayerQueryElevationOptions): IPromise; - - on(name: "layerview-create", eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: ElevationLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: ElevationLayerLayerviewDestroyEventHandler): IHandle; - } - - interface ElevationLayerConstructor { - new(properties?: ElevationLayerProperties): ElevationLayer; - - fromJSON(json: any): ElevationLayer; - } - - export const ElevationLayer: ElevationLayerConstructor; - - interface ElevationLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { - url?: string; - } - - interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { - capabilities: FeatureLayerCapabilities; - copyright: string; - definitionExpression: string; - displayField: string; - elevationInfo: FeatureLayerElevationInfo; - featureReduction: FeatureLayerFeatureReduction; - fields: Field[]; - gdbVersion: string; - geometryType: string; - hasAttachments: boolean; - hasM: boolean; - hasZ: boolean; - labelingInfo: LabelClass[]; - labelsVisible: boolean; - layerId: number; - legendEnabled: boolean; - objectIdField: string; - outFields: string[]; - popupEnabled: boolean; - popupTemplate: PopupTemplate; - renderer: Renderer; - returnM: boolean; - returnZ: boolean; - screenSizePerspectiveEnabled: boolean; - source: Collection; - spatialReference: SpatialReference; - templates: FeatureTemplate[]; - token: string; - typeIdField: string; - types: FeatureType[]; - url: string; - version: number; - - applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; - createQuery(): Query; - getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - - on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle; - } - - interface FeatureLayerConstructor { - new(properties?: FeatureLayerProperties): FeatureLayer; - - fromJSON(json: any): FeatureLayer; - } - - export const FeatureLayer: FeatureLayerConstructor; - - interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { - capabilities?: FeatureLayerCapabilities; - copyright?: string; - definitionExpression?: string; - displayField?: string; - elevationInfo?: FeatureLayerElevationInfo; - featureReduction?: FeatureLayerFeatureReduction; - fields?: FieldProperties[]; - gdbVersion?: string; - geometryType?: string; - hasAttachments?: boolean; - hasM?: boolean; - hasZ?: boolean; - labelingInfo?: LabelClassProperties[]; - labelsVisible?: boolean; - layerId?: number; - legendEnabled?: boolean; - objectIdField?: string; - outFields?: string[]; - popupEnabled?: boolean; - popupTemplate?: PopupTemplateProperties; - renderer?: RendererProperties; - returnM?: boolean; - returnZ?: boolean; - screenSizePerspectiveEnabled?: boolean; - source?: Collection | any[]; - spatialReference?: SpatialReferenceProperties; - templates?: FeatureTemplateProperties[]; - token?: string; - typeIdField?: string; - types?: FeatureTypeProperties[]; - url?: string; - version?: number; - } - - interface GeoRSSLayer extends Layer { + interface GeoRSSLayer extends Layer, ScaleRangeLayer { lineSymbol: SimpleLineSymbol; pointSymbol: PictureMarkerSymbol; polygonSymbol: SimpleFillSymbol; @@ -3426,16 +1691,26 @@ declare namespace __esri { export const GeoRSSLayer: GeoRSSLayerConstructor; - interface GeoRSSLayerProperties extends LayerProperties { + interface GeoRSSLayerProperties extends LayerProperties, ScaleRangeLayerProperties { lineSymbol?: SimpleLineSymbolProperties; pointSymbol?: PictureMarkerSymbolProperties; polygonSymbol?: SimpleFillSymbolProperties; url?: string; } + export interface GeoRSSLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface GeoRSSLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + interface GraphicsLayer extends Layer, ScaleRangeLayer { elevationInfo: GraphicsLayerElevationInfo; - graphics: Collection; + graphics: Collection; screenSizePerspectiveEnabled: boolean; add(graphic: Graphic): void; @@ -3458,10 +1733,31 @@ declare namespace __esri { interface GraphicsLayerProperties extends LayerProperties, ScaleRangeLayerProperties { elevationInfo?: GraphicsLayerElevationInfo; - graphics?: Collection | any[]; + graphics?: CollectionProperties; screenSizePerspectiveEnabled?: boolean; } + export interface GraphicsLayerElevationInfo { + mode: string; + offset?: number; + featureExpressionInfo?: GraphicsLayerElevationInfoFeatureExpressionInfo; + unit?: string; + } + + export interface GraphicsLayerElevationInfoFeatureExpressionInfo { + expression?: string; + } + + export interface GraphicsLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface GraphicsLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + interface GroupLayer extends Layer, LayersMixin, PortalLayer { visibilityMode: string; @@ -3483,6 +1779,16 @@ declare namespace __esri { visibilityMode?: string; } + export interface GroupLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface GroupLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + interface ImageryLayer extends Layer, ArcGISImageService, ScaleRangeLayer { pixelFilter: Function; popupEnabled: boolean; @@ -3512,7 +1818,19 @@ declare namespace __esri { token?: string; } + export interface ImageryLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface ImageryLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + interface IntegratedMeshLayer extends Layer, SceneService, PortalLayer { + elevationInfo: IntegratedMeshLayerElevationInfo; + on(name: "layerview-create", eventHandler: IntegratedMeshLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-create", modifiers: string[], eventHandler: IntegratedMeshLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: IntegratedMeshLayerLayerviewDestroyEventHandler): IHandle; @@ -3528,7 +1846,63 @@ declare namespace __esri { export const IntegratedMeshLayer: IntegratedMeshLayerConstructor; interface IntegratedMeshLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + elevationInfo?: IntegratedMeshLayerElevationInfo; + } + export interface IntegratedMeshLayerElevationInfo { + mode: string; + offset?: number; + } + + export interface IntegratedMeshLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface IntegratedMeshLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface KMLLayer extends Layer, PortalLayer, ScaleRangeLayer { + allVisibleMapImages: Collection; + allVisiblePoints: Collection; + allVisiblePolygons: Collection; + allVisiblePolylines: Collection; + sublayers: Collection; + url: string; + + on(name: "layerview-create", eventHandler: KMLLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: KMLLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: KMLLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: KMLLayerLayerviewDestroyEventHandler): IHandle; + } + + interface KMLLayerConstructor { + new(properties?: KMLLayerProperties): KMLLayer; + + fromJSON(json: any): KMLLayer; + } + + export const KMLLayer: KMLLayerConstructor; + + interface KMLLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + allVisibleMapImages?: CollectionProperties; + allVisiblePoints?: CollectionProperties; + allVisiblePolygons?: CollectionProperties; + allVisiblePolylines?: CollectionProperties; + sublayers?: CollectionProperties; + url?: string; + } + + export interface KMLLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface KMLLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface Layer extends Accessor, Loadable, Evented { @@ -3548,8 +1922,8 @@ declare namespace __esri { new(properties?: LayerProperties): Layer; - fromArcGISServerUrl(params: LayerFromArcGISServerUrlParams): IPromise; - fromPortalItem(params: LayerFromPortalItemParams): IPromise; + fromArcGISServerUrl(params: LayerFromArcGISServerUrlParams): IPromise; + fromPortalItem(params: LayerFromPortalItemParams): IPromise; } export const Layer: LayerConstructor; @@ -3565,7 +1939,16 @@ declare namespace __esri { visible?: boolean; } - interface MapImageLayer extends Layer, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer { + export interface LayerFromArcGISServerUrlParams { + url: string; + properties?: any; + } + + export interface LayerFromPortalItemParams { + portalItem: PortalItem; + } + + interface MapImageLayer extends Layer, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer { on(name: "layerview-create", eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-create", modifiers: string[], eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: MapImageLayerLayerviewDestroyEventHandler): IHandle; @@ -3580,11 +1963,21 @@ declare namespace __esri { export const MapImageLayer: MapImageLayerConstructor; - interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties { + interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties, ScaleRangeLayerProperties { } - interface MapNotesLayer extends Layer, PortalLayer { + export interface MapImageLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface MapImageLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { on(name: "layerview-create", eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-create", modifiers: string[], eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: MapNotesLayerLayerviewDestroyEventHandler): IHandle; @@ -3599,10 +1992,225 @@ declare namespace __esri { export const MapNotesLayer: MapNotesLayerConstructor; - interface MapNotesLayerProperties extends LayerProperties, PortalLayerProperties { + interface MapNotesLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { } + export interface MapNotesLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface MapNotesLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface ArcGISCachedService { + tileInfo: TileInfo; + + fromJSON(json: any): any; + toJSON(): any; + } + + interface ArcGISCachedServiceConstructor { + new(properties?: ArcGISCachedServiceProperties): ArcGISCachedService; + + fromJSON(json: any): ArcGISCachedService; + } + + export const ArcGISCachedService: ArcGISCachedServiceConstructor; + + interface ArcGISCachedServiceProperties { + tileInfo?: TileInfoProperties; + } + + interface ArcGISDynamicMapService { + allSublayers: Collection; + dpi: number; + gdbVersion: string; + imageFormat: string; + imageMaxHeight: number; + imageMaxWidth: number; + imageTransparency: boolean; + sublayers: Collection; + + createServiceSublayers(): Collection; + findSublayerById(id: number): Sublayer; + getExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceGetExportImageParametersOptions): any; + } + + interface ArcGISDynamicMapServiceConstructor { + new(): ArcGISDynamicMapService; + } + + export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor; + + interface ArcGISDynamicMapServiceProperties { + allSublayers?: CollectionProperties; + dpi?: number; + gdbVersion?: string; + imageFormat?: string; + imageMaxHeight?: number; + imageMaxWidth?: number; + imageTransparency?: boolean; + sublayers?: CollectionProperties; + } + + export interface ArcGISDynamicMapServiceGetExportImageParametersOptions { + rotation?: number; + } + + interface ArcGISImageService { + compressionQuality: number; + compressionTolerance: number; + copyright: string; + definitionExpression: string; + domainFields: Field[]; + fields: Field[]; + format: string; + fullExtent: Extent; + hasMultidimensions: boolean; + hasRasterAttributeTable: boolean; + imageMaxHeight: number; + imageMaxWidth: number; + mosaicRule: MosaicRule; + multidimensionalInfo: any; + pixelType: string; + popupTemplate: PopupTemplate; + rasterAttributeTable: any; + rasterAttributeTableFieldPrefix: string; + rasterFields: Field[]; + renderingRule: RasterFunction; + spatialReference: SpatialReference; + url: string; + version: number; + + fetchImage(extent: Extent, width: number, height: number): IPromise; + fromJSON(json: any): any; + toJSON(): any; + } + + interface ArcGISImageServiceConstructor { + new(properties?: ArcGISImageServiceProperties): ArcGISImageService; + + fromJSON(json: any): ArcGISImageService; + } + + export const ArcGISImageService: ArcGISImageServiceConstructor; + + interface ArcGISImageServiceProperties { + compressionQuality?: number; + compressionTolerance?: number; + copyright?: string; + definitionExpression?: string; + domainFields?: FieldProperties[]; + fields?: FieldProperties[]; + format?: string; + fullExtent?: ExtentProperties; + hasMultidimensions?: boolean; + hasRasterAttributeTable?: boolean; + imageMaxHeight?: number; + imageMaxWidth?: number; + mosaicRule?: MosaicRuleProperties; + multidimensionalInfo?: any; + pixelType?: string; + popupTemplate?: PopupTemplateProperties; + rasterAttributeTable?: any; + rasterAttributeTableFieldPrefix?: string; + rasterFields?: FieldProperties[]; + renderingRule?: RasterFunctionProperties; + spatialReference?: SpatialReferenceProperties; + url?: string; + version?: number; + } + + interface ArcGISMapService { + copyright: string; + fullExtent: Extent; + spatialReference: SpatialReference; + token: string; + } + + interface ArcGISMapServiceConstructor { + new(properties?: ArcGISMapServiceProperties): ArcGISMapService; + + fromJSON(json: any): ArcGISMapService; + } + + export const ArcGISMapService: ArcGISMapServiceConstructor; + + interface ArcGISMapServiceProperties { + copyright?: string; + fullExtent?: ExtentProperties; + spatialReference?: SpatialReferenceProperties; + token?: string; + } + + interface PortalLayer { + portalItem: PortalItem; + } + + interface PortalLayerConstructor { + new(properties?: PortalLayerProperties): PortalLayer; + + fromJSON(json: any): PortalLayer; + } + + export const PortalLayer: PortalLayerConstructor; + + interface PortalLayerProperties { + portalItem?: PortalItemProperties; + } + + interface ScaleRangeLayer { + maxScale: number; + minScale: number; + } + + interface ScaleRangeLayerConstructor { + new(): ScaleRangeLayer; + } + + export const ScaleRangeLayer: ScaleRangeLayerConstructor; + + interface ScaleRangeLayerProperties { + maxScale?: number; + minScale?: number; + } + + interface SceneService { + copyright: string; + layerId: number; + spatialReference: SpatialReference; + token: string; + url: string; + version: SceneServiceVersion; + } + + interface SceneServiceConstructor { + new(properties?: SceneServiceProperties): SceneService; + + fromJSON(json: any): SceneService; + } + + export const SceneService: SceneServiceConstructor; + + interface SceneServiceProperties { + copyright?: string; + layerId?: number; + spatialReference?: SpatialReferenceProperties; + token?: string; + url?: string; + version?: SceneServiceVersion; + } + + export interface SceneServiceVersion { + major: number; + minor: number; + versionString: string; + } + interface OpenStreetMapLayer extends WebTileLayer { on(name: "layerview-create", eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-create", modifiers: string[], eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; @@ -3622,9 +2230,20 @@ declare namespace __esri { } + export interface OpenStreetMapLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface OpenStreetMapLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + interface PointCloudLayer extends Layer, SceneService, PortalLayer { elevationInfo: PointCloudLayerElevationInfo; fields: Field[]; + legendEnabled: boolean; renderer: PointCloudRenderer; on(name: "layerview-create", eventHandler: PointCloudLayerLayerviewCreateEventHandler): IHandle; @@ -3644,9 +2263,25 @@ declare namespace __esri { interface PointCloudLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { elevationInfo?: PointCloudLayerElevationInfo; fields?: FieldProperties[]; + legendEnabled?: boolean; renderer?: PointCloudRendererProperties; } + export interface PointCloudLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface PointCloudLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + export interface PointCloudLayerElevationInfo { + mode: string; + offset?: number; + } + interface SceneLayer extends Layer, SceneService, PortalLayer { definitionExpression: string; elevationInfo: SceneLayerElevationInfo; @@ -3665,9 +2300,9 @@ declare namespace __esri { createQuery(): Query; getFieldUsageInfo(fieldName: string): any; queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; on(name: "layerview-create", eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-create", modifiers: string[], eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle; @@ -3699,6 +2334,25 @@ declare namespace __esri { screenSizePerspectiveEnabled?: boolean; } + export interface SceneLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface SceneLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + export interface SceneLayerElevationInfo { + mode: string; + offset?: number; + } + + export interface SceneLayerFeatureReduction { + type: string; + } + interface StreamLayer extends FeatureLayer { filter: StreamLayerFilter; geometryDefinition: Extent; @@ -3728,266 +2382,29 @@ declare namespace __esri { purgeOptions?: StreamLayerPurgeOptions; } - interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { - attributionDataUrl: string; - hasAttributionData: boolean; - legendEnabled: boolean; - tileServers: string[]; - url: string; - - fetchTile(level: number, row: number, column: number, options?: TileLayerFetchTileOptions): IPromise; - getTileUrl(level: number, row: number, col: number): string; - - on(name: "layerview-create", eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; + export interface StreamLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } - interface TileLayerConstructor { - new(properties?: TileLayerProperties): TileLayer; - - fromJSON(json: any): TileLayer; + export interface StreamLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export const TileLayer: TileLayerConstructor; - - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { - attributionDataUrl?: string; - hasAttributionData?: boolean; - legendEnabled?: boolean; - tileServers?: string[]; - url?: string; + export interface StreamLayerFilter { + geometry?: Extent; + where?: string; } - interface UnknownLayer extends Layer { - on(name: "layerview-create", eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; + export interface StreamLayerPurgeOptions { + displayCount: number; + age: number; } - interface UnknownLayerConstructor { - new(properties?: UnknownLayerProperties): UnknownLayer; - } - - export const UnknownLayer: UnknownLayerConstructor; - - interface UnknownLayerProperties extends LayerProperties { - - } - - interface UnsupportedLayer extends Layer { - on(name: "layerview-create", eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; - } - - interface UnsupportedLayerConstructor { - new(properties?: UnsupportedLayerProperties): UnsupportedLayer; - } - - export const UnsupportedLayer: UnsupportedLayerConstructor; - - interface UnsupportedLayerProperties extends LayerProperties { - - } - - interface VectorTileLayer extends Layer, PortalLayer, ScaleRangeLayer, TiledLayer { - attributionDataUrl: string; - currentStyleInfo: VectorTileLayerCurrentStyleInfo; - spatialReference: SpatialReference; - token: string; - url: string; - - loadStyle(style: string | any): IPromise; - - on(name: "layerview-create", eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: VectorTileLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: VectorTileLayerLayerviewDestroyEventHandler): IHandle; - } - - interface VectorTileLayerConstructor { - new(properties?: VectorTileLayerProperties): VectorTileLayer; - - fromJSON(json: any): VectorTileLayer; - } - - export const VectorTileLayer: VectorTileLayerConstructor; - - interface VectorTileLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TiledLayerProperties { - attributionDataUrl?: string; - currentStyleInfo?: VectorTileLayerCurrentStyleInfo; - spatialReference?: SpatialReferenceProperties; - token?: string; - url?: string | any; - } - - interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer { - copyright: string; - spatialReference: SpatialReference; - subDomains: string[]; - tileServers: string[]; - urlTemplate: string; - - on(name: "layerview-create", eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; - } - - interface WebTileLayerConstructor { - new(properties?: WebTileLayerProperties): WebTileLayer; - - fromJSON(json: any): WebTileLayer; - } - - export const WebTileLayer: WebTileLayerConstructor; - - interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties { - copyright?: string; - spatialReference?: SpatialReferenceProperties; - subDomains?: string[]; - tileServers?: string[]; - urlTemplate?: string; - } - - interface WMSLayer extends Layer, PortalLayer { - copyright: string; - customLayerParameters: any; - customParameters: any; - description: string; - featureInfoFormat: string; - featureInfoUrl: string; - fullExtents: Extent[]; - imageFormat: string; - imageMaxHeight: number; - imageMaxWidth: number; - imageTransparency: boolean; - spatialReference: SpatialReference; - spatialReferences: number[]; - sublayers: Collection; - version: string; - - fetchImage(extent: Extent, width: number, height: number, options?: WMSLayerFetchImageOptions): IPromise; - findSublayerById(id: number): WMSSublayer; - - on(name: "layerview-create", eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; - } - - interface WMSLayerConstructor { - new(properties?: WMSLayerProperties): WMSLayer; - - fromJSON(json: any): WMSLayer; - } - - export const WMSLayer: WMSLayerConstructor; - - interface WMSLayerProperties extends LayerProperties, PortalLayerProperties { - copyright?: string; - customLayerParameters?: any; - customParameters?: any; - description?: string; - featureInfoFormat?: string; - featureInfoUrl?: string; - fullExtents?: ExtentProperties[]; - imageFormat?: string; - imageMaxHeight?: number; - imageMaxWidth?: number; - imageTransparency?: boolean; - spatialReference?: SpatialReferenceProperties; - spatialReferences?: number[]; - sublayers?: Collection | any[]; - version?: string; - } - - interface WMTSLayer extends Layer, PortalLayer { - activeLayer: WMTSSublayer; - copyright: string; - customLayerParameters: any; - customParameters: any; - serviceMode: string; - sublayers: Collection; - url: string; - version: string; - - findSublayerById(id: string): WMTSSublayer; - - on(name: "layerview-create", eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; - } - - interface WMTSLayerConstructor { - new(properties?: WMTSLayerProperties): WMTSLayer; - - fromJSON(json: any): WMTSLayer; - } - - export const WMTSLayer: WMTSLayerConstructor; - - interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties { - activeLayer?: WMTSSublayerProperties; - copyright?: string; - customLayerParameters?: any; - customParameters?: any; - serviceMode?: string; - sublayers?: Collection | any[]; - url?: string; - version?: string; - } - - interface BaseDynamicLayer extends Layer { - addResolvingPromise(promiseToLoad: IPromise): IPromise; - fetchImage(extent: Extent, width: number, height: number, options?: BaseDynamicLayerFetchImageOptions): IPromise; - getImageUrl(extent: Extent, width: number, height: number): IPromise | string; - - on(name: "layerview-create", eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; - } - - interface BaseDynamicLayerConstructor { - new(properties?: BaseDynamicLayerProperties): BaseDynamicLayer; - } - - export const BaseDynamicLayer: BaseDynamicLayerConstructor; - - interface BaseDynamicLayerProperties extends LayerProperties { - - } - - interface BaseTileLayer extends Layer { - spatialReference: SpatialReference; - tileInfo: TileInfo; - - addResolvingPromise(promiseToLoad: IPromise): IPromise; - fetchTile(level: number, row: number, column: number, options?: BaseTileLayerFetchTileOptions): IPromise; - getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; - getTileUrl(level: number, row: number, column: number): string | IPromise; - - on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-create", modifiers: string[], eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; - on(name: "layerview-destroy", eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; - on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; - } - - interface BaseTileLayerConstructor { - new(properties?: BaseTileLayerProperties): BaseTileLayer; - } - - export const BaseTileLayer: BaseTileLayerConstructor; - - interface BaseTileLayerProperties extends LayerProperties { - spatialReference?: SpatialReferenceProperties; - tileInfo?: TileInfoProperties; + export interface StreamLayerUpdateFilterFilterChanges { + geometry: Extent; + where: string; } interface CodedValueDomain extends Domain { @@ -4008,6 +2425,11 @@ declare namespace __esri { codedValues?: CodedValueDomainCodedValues[]; } + export interface CodedValueDomainCodedValues { + name: string; + code: string | number; + } + interface DimensionalDefinition { dimensionName: string; isSlice: boolean; @@ -4041,6 +2463,59 @@ declare namespace __esri { type?: string; } + interface FeatureTemplate extends Accessor, JSONSupport { + description: string; + drawingTool: string; + name: string; + prototype: any; + thumbnail: FeatureTemplateThumbnail; + } + + interface FeatureTemplateConstructor { + new(properties?: FeatureTemplateProperties): FeatureTemplate; + + fromJSON(json: any): FeatureTemplate; + } + + export const FeatureTemplate: FeatureTemplateConstructor; + + interface FeatureTemplateProperties { + description?: string; + drawingTool?: string; + name?: string; + prototype?: any; + thumbnail?: FeatureTemplateThumbnail; + } + + export interface FeatureTemplateThumbnail { + contentType: any; + imageData: string; + height: number; + width: number; + } + + interface FeatureType extends Accessor, JSONSupport { + domains: any; + id: number | string; + name: string; + templates: FeatureTemplate[]; + } + + interface FeatureTypeConstructor { + new(properties?: FeatureTypeProperties): FeatureType; + + fromJSON(json: any): FeatureType; + } + + export const FeatureType: FeatureTypeConstructor; + + interface FeatureTypeProperties { + domains?: any; + id?: number | string; + name?: string; + templates?: FeatureTemplateProperties[]; + } + interface Field extends Accessor, JSONSupport { alias: string; domain: Domain; @@ -4069,52 +2544,6 @@ declare namespace __esri { type?: string; } - interface FeatureTemplate extends Accessor, JSONSupport { - description: string; - drawingTool: string; - name: string; - prototype: any; - thumbnail: FeatureTemplateThumbnail; - } - - interface FeatureTemplateConstructor { - new(properties?: FeatureTemplateProperties): FeatureTemplate; - - fromJSON(json: any): FeatureTemplate; - } - - export const FeatureTemplate: FeatureTemplateConstructor; - - interface FeatureTemplateProperties { - description?: string; - drawingTool?: string; - name?: string; - prototype?: any; - thumbnail?: FeatureTemplateThumbnail; - } - - interface FeatureType extends Accessor, JSONSupport { - domains: any; - id: number | string; - name: string; - templates: FeatureTemplate[]; - } - - interface FeatureTypeConstructor { - new(properties?: FeatureTypeProperties): FeatureType; - - fromJSON(json: any): FeatureType; - } - - export const FeatureType: FeatureTypeConstructor; - - interface FeatureTypeProperties { - domains?: any; - id?: number | string; - name?: string; - templates?: FeatureTemplateProperties[]; - } - interface ImageParameters extends Accessor { dpi: number; extent: Extent; @@ -4164,6 +2593,56 @@ declare namespace __esri { } + interface KMLSublayer extends Accessor, JSONSupport { + description: string; + id: number; + layer: KMLLayer; + mapImages: Collection; + networkLink: KMLSublayerNetworkLink; + points: Collection; + polygons: Collection; + polylines: Collection; + sublayers: Collection; + title: string; + visible: boolean; + } + + interface KMLSublayerConstructor { + new(properties?: KMLSublayerProperties): KMLSublayer; + + fromJSON(json: any): KMLSublayer; + } + + export const KMLSublayer: KMLSublayerConstructor; + + interface KMLSublayerProperties { + description?: string; + id?: number; + layer?: KMLLayerProperties; + mapImages?: CollectionProperties; + networkLink?: KMLSublayerNetworkLink; + points?: CollectionProperties; + polygons?: CollectionProperties; + polylines?: CollectionProperties; + sublayers?: CollectionProperties; + title?: string; + visible?: boolean; + } + + export interface KMLSublayerNetworkLink { + id: number; + name: string; + description: string; + visibility: number; + refreshMode: string; + refreshInterval: number; + viewRefreshMode: string; + viewRefreshTime: number; + viewBoundScale: number; + viewFormat: string; + httpQuery: string; + } + interface LabelClass extends Accessor, JSONSupport { labelExpression: string; labelExpressionInfo: LabelClassLabelExpressionInfo; @@ -4174,7 +2653,7 @@ declare namespace __esri { useCodedValues: boolean; where: string; - clone(): this; + clone(): LabelClass; } interface LabelClassConstructor { @@ -4191,11 +2670,16 @@ declare namespace __esri { labelPlacement?: string; maxScale?: number; minScale?: number; - symbol?: TextSymbol | LabelSymbol3D; + symbol?: TextSymbolProperties | LabelSymbol3DProperties; useCodedValues?: boolean; where?: string; } + export interface LabelClassLabelExpressionInfo { + value?: string; + expression: string; + } + interface LOD extends Accessor, JSONSupport { level: number; levelValue: string; @@ -4221,7 +2705,7 @@ declare namespace __esri { interface MapImage extends Accessor, JSONSupport { extent: Extent; height: number; - href: number; + href: string; opacity: number; scale: number; visible: boolean; @@ -4239,7 +2723,7 @@ declare namespace __esri { interface MapImageProperties { extent?: ExtentProperties; height?: number; - href?: number; + href?: string; opacity?: number; scale?: number; visible?: boolean; @@ -4309,6 +2793,17 @@ declare namespace __esri { width?: number; } + export interface PixelBlockAddDataPlaneData { + pixels: number[][]; + statistics: any[]; + } + + export interface PixelBlockStatistics { + maxValue?: number; + minValue?: number; + noDataValue?: number; + } + interface RangeDomain extends Domain { maxValue: number; minValue: number; @@ -4361,15 +2856,15 @@ declare namespace __esri { opacity: number; popupTemplate: PopupTemplate; renderer: Renderer; - source: any | any; - sublayers: Collection; + source: DynamicMapLayer | DynamicDataLayer; + sublayers: Collection; title: string; url: string; visible: boolean; - clone(): this; + clone(): Sublayer; createQuery(): Query; - queryFeatures(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; } interface SublayerConstructor { @@ -4390,16 +2885,65 @@ declare namespace __esri { opacity?: number; popupTemplate?: PopupTemplateProperties; renderer?: RendererProperties; - source?: any | any; - sublayers?: Collection | any[]; + source?: DynamicMapLayer | DynamicDataLayer; + sublayers?: CollectionProperties; title?: string; url?: string; visible?: boolean; } + export interface DynamicDataLayer { + type: string; + dataSource: TableDataSource | QueryTableDataSource | RasterDataSource | JoinTableDataSource; + fields: DynamicDataLayerFields[]; + } + + export interface DynamicMapLayer { + type: string; + mapLayerId: number; + gdbVersion: string; + } + + export interface JoinTableDataSource { + type: string; + leftTableKey: string; + rightTableKey: string; + leftTableSource: DynamicMapLayer | DynamicDataLayer; + rightTableSource: DynamicMapLayer | DynamicDataLayer; + joinType: string; + } + + export interface QueryTableDataSource { + type: string; + workspaceId: string; + query: string; + oidFields: string; + spatialReference: SpatialReference; + geometryType: string; + } + + export interface RasterDataSource { + type: string; + workspaceId: string; + dataSourceName: string; + } + + export interface TableDataSource { + type: string; + workspaceId: string; + dataSourceName: string; + gdbVersion: string; + } + + export interface DynamicDataLayerFields { + name: string; + alias: string; + } + interface TileInfo extends Accessor, JSONSupport { dpi: number; format: string; + isWrappable: boolean; lods: LOD[]; origin: Point; size: number[]; @@ -4417,6 +2961,7 @@ declare namespace __esri { interface TileInfoProperties { dpi?: number; format?: string; + isWrappable?: boolean; lods?: LODProperties[]; origin?: PointProperties; size?: number[]; @@ -4428,7 +2973,7 @@ declare namespace __esri { id: string; tileInfo: TileInfo; - clone(): this; + clone(): TileMatrixSet; } interface TileMatrixSetConstructor { @@ -4450,14 +2995,17 @@ declare namespace __esri { fullExtent: Extent; id: number; layer: WMSLayer; + legendEnabled: boolean; + legendUrl: string; name: string; popupEnabled: boolean; + queryable: boolean; spatialReferences: number[]; - sublayers: Collection; + sublayers: Collection; title: string; visible: boolean; - clone(): this; + clone(): WMSSublayer; } interface WMSSublayerConstructor { @@ -4472,7 +3020,7 @@ declare namespace __esri { legendUrl: string; title: string; - clone(): this; + clone(): WMTSStyle; } interface WMTSStyleConstructor { @@ -4498,12 +3046,13 @@ declare namespace __esri { imageFormats: string[]; layer: WMTSLayer; styleId: string; - styles: Collection; + styles: Collection; + tileMatrixSet: TileMatrixSet; tileMatrixSetId: string; - tileMatrixSets: Collection; + tileMatrixSets: Collection; title: string; - clone(): this; + clone(): WMTSSublayer; } interface WMTSSublayerConstructor { @@ -4522,12 +3071,446 @@ declare namespace __esri { imageFormats?: string[]; layer?: WMTSLayerProperties; styleId?: string; - styles?: Collection | any[]; + styles?: CollectionProperties; + tileMatrixSet?: TileMatrixSetProperties; tileMatrixSetId?: string; - tileMatrixSets?: Collection | any[]; + tileMatrixSets?: CollectionProperties; title?: string; } + interface TiledLayer { + tileInfo: TileInfo; + } + + interface TiledLayerConstructor { + new(properties?: TiledLayerProperties): TiledLayer; + + fromJSON(json: any): TiledLayer; + } + + export const TiledLayer: TiledLayerConstructor; + + interface TiledLayerProperties { + tileInfo?: TileInfoProperties; + } + + interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, ScaleRangeLayer, PortalLayer, TiledLayer { + attributionDataUrl: string; + hasAttributionData: boolean; + legendEnabled: boolean; + tileServers: string[]; + url: string; + + fetchTile(level: number, row: number, column: number, options?: TileLayerFetchTileOptions): IPromise; + getTileUrl(level: number, row: number, col: number): string; + + on(name: "layerview-create", eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; + } + + interface TileLayerConstructor { + new(properties?: TileLayerProperties): TileLayer; + + fromJSON(json: any): TileLayer; + } + + export const TileLayer: TileLayerConstructor; + + interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, ScaleRangeLayerProperties, PortalLayerProperties, TiledLayerProperties { + attributionDataUrl?: string; + hasAttributionData?: boolean; + legendEnabled?: boolean; + tileServers?: string[]; + url?: string; + } + + export interface TileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface TileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + export interface TileLayerFetchTileOptions { + allowImageDataAccess?: boolean; + } + + interface UnknownLayer extends Layer { + on(name: "layerview-create", eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; + } + + interface UnknownLayerConstructor { + new(properties?: UnknownLayerProperties): UnknownLayer; + } + + export const UnknownLayer: UnknownLayerConstructor; + + interface UnknownLayerProperties extends LayerProperties { + + } + + export interface UnknownLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface UnknownLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface UnsupportedLayer extends Layer { + on(name: "layerview-create", eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; + } + + interface UnsupportedLayerConstructor { + new(properties?: UnsupportedLayerProperties): UnsupportedLayer; + } + + export const UnsupportedLayer: UnsupportedLayerConstructor; + + interface UnsupportedLayerProperties extends LayerProperties { + + } + + export interface UnsupportedLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface UnsupportedLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface VectorTileLayer extends Layer, PortalLayer, ScaleRangeLayer, TiledLayer { + attributionDataUrl: string; + currentStyleInfo: VectorTileLayerCurrentStyleInfo; + spatialReference: SpatialReference; + token: string; + url: string | any; + + loadStyle(style: string | any): IPromise; + + on(name: "layerview-create", eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: VectorTileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: VectorTileLayerLayerviewDestroyEventHandler): IHandle; + } + + interface VectorTileLayerConstructor { + new(properties?: VectorTileLayerProperties): VectorTileLayer; + + fromJSON(json: any): VectorTileLayer; + } + + export const VectorTileLayer: VectorTileLayerConstructor; + + interface VectorTileLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TiledLayerProperties { + attributionDataUrl?: string; + currentStyleInfo?: VectorTileLayerCurrentStyleInfo; + spatialReference?: SpatialReferenceProperties; + token?: string; + url?: string | any; + } + + export interface VectorTileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface VectorTileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + export interface VectorTileLayerCurrentStyleInfo { + serviceUrl: string; + styleUrl: string; + spriteUrl: string; + glyphsUrl: string; + style: any; + layerDefinition: any; + } + + interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer { + copyright: string; + spatialReference: SpatialReference; + subDomains: string[]; + tileServers: string[]; + urlTemplate: string; + + on(name: "layerview-create", eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; + } + + interface WebTileLayerConstructor { + new(properties?: WebTileLayerProperties): WebTileLayer; + + fromJSON(json: any): WebTileLayer; + } + + export const WebTileLayer: WebTileLayerConstructor; + + interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties { + copyright?: string; + spatialReference?: SpatialReferenceProperties; + subDomains?: string[]; + tileServers?: string[]; + urlTemplate?: string; + } + + export interface WebTileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface WebTileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface WMSLayer extends Layer, PortalLayer, ScaleRangeLayer { + copyright: string; + customLayerParameters: any; + customParameters: any; + description: string; + featureInfoFormat: string; + featureInfoUrl: string; + fullExtents: Extent[]; + imageFormat: string; + imageMaxHeight: number; + imageMaxWidth: number; + imageTransparency: boolean; + legendEnabled: boolean; + spatialReference: SpatialReference; + spatialReferences: number[]; + sublayers: Collection; + url: string; + version: string; + + fetchImage(extent: Extent, width: number, height: number, options?: WMSLayerFetchImageOptions): IPromise; + findSublayerById(id: number): WMSSublayer; + + on(name: "layerview-create", eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; + } + + interface WMSLayerConstructor { + new(properties?: WMSLayerProperties): WMSLayer; + + fromJSON(json: any): WMSLayer; + } + + export const WMSLayer: WMSLayerConstructor; + + interface WMSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + copyright?: string; + customLayerParameters?: any; + customParameters?: any; + description?: string; + featureInfoFormat?: string; + featureInfoUrl?: string; + fullExtents?: ExtentProperties[]; + imageFormat?: string; + imageMaxHeight?: number; + imageMaxWidth?: number; + imageTransparency?: boolean; + legendEnabled?: boolean; + spatialReference?: SpatialReferenceProperties; + spatialReferences?: number[]; + sublayers?: CollectionProperties; + url?: string; + version?: string; + } + + export interface WMSLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface WMSLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + export interface WMSLayerFetchImageOptions { + allowImageDataAccess?: boolean; + pixelRatio?: number; + rotation?: number; + } + + interface WMTSLayer extends Layer, PortalLayer, ScaleRangeLayer { + activeLayer: WMTSSublayer; + copyright: string; + customLayerParameters: any; + customParameters: any; + serviceMode: string; + sublayers: Collection; + url: string; + version: string; + + findSublayerById(id: string): WMTSSublayer; + + on(name: "layerview-create", eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; + } + + interface WMTSLayerConstructor { + new(properties?: WMTSLayerProperties): WMTSLayer; + + fromJSON(json: any): WMTSLayer; + } + + export const WMTSLayer: WMTSLayerConstructor; + + interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + activeLayer?: WMTSSublayerProperties; + copyright?: string; + customLayerParameters?: any; + customParameters?: any; + serviceMode?: string; + sublayers?: CollectionProperties; + url?: string; + version?: string; + } + + export interface WMTSLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; + } + + export interface WMTSLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; + } + + interface Map extends Accessor, LayersMixin { + allLayers: Collection; + basemap: Basemap; + ground: Ground; + } + + interface MapConstructor { + new(properties?: MapProperties): Map; + } + + export const Map: MapConstructor; + + interface MapProperties extends LayersMixinProperties { + allLayers?: CollectionProperties; + basemap?: BasemapProperties; + ground?: GroundProperties; + } + + interface PopupTemplate extends Accessor, JSONSupport { + actions: Collection>; + content: string | any[] | Function | IPromise; + expressionInfos: PopupTemplateExpressionInfos[]; + fieldInfos: PopupTemplateFieldInfos[]; + layerOptions: PopupTemplateLayerOptions; + overwriteActions: boolean; + title: string | Function; + + clone(): PopupTemplate; + } + + interface PopupTemplateConstructor { + new(properties?: PopupTemplateProperties): PopupTemplate; + + fromJSON(json: any): PopupTemplate; + } + + export const PopupTemplate: PopupTemplateConstructor; + + interface PopupTemplateProperties { + actions?: CollectionProperties>; + content?: string | any[] | Function | IPromise; + expressionInfos?: PopupTemplateExpressionInfos[]; + fieldInfos?: PopupTemplateFieldInfos[]; + layerOptions?: PopupTemplateLayerOptions; + overwriteActions?: boolean; + title?: string | Function; + } + + export interface Attachments { + type: string; + } + + export interface Fields { + type: string; + fieldInfos: any[]; + } + + export interface Media { + type: string; + mediaInfos: MediaMediaInfos[]; + } + + export interface PopupTemplateExpressionInfos { + name: string; + title?: string; + expression: string; + returnType?: string; + } + + export interface PopupTemplateFieldInfos { + fieldName: string; + format?: PopupTemplateFieldInfosFormat; + label?: string; + stringFieldOption?: string; + tooltip?: string; + visible?: boolean; + } + + export interface PopupTemplateFieldInfosFormat { + dateFormat?: string; + digitSeparator?: boolean; + places?: number; + } + + export interface PopupTemplateLayerOptions { + showNoDataRecords: boolean; + } + + export interface Text { + type: string; + text: string; + } + + export interface MediaMediaInfos { + title: string; + caption: string; + refreshInterval: number; + type: string; + value: MediaMediaInfosValue; + } + + export interface MediaMediaInfosValue { + sourceURL: string; + fields: string[]; + normalizationField: string; + theme: string; + tooltipField: string; + } + interface Portal extends Accessor, Loadable { access: string; allSSL: boolean; @@ -4589,11 +3572,11 @@ declare namespace __esri { useVectorBasemaps: boolean; vectorBasemapGalleryGroupQuery: string; - fetchBasemaps(): IPromise; - fetchFeaturedGroups(): IPromise; - queryGroups(queryParams: PortalQueryParams): IPromise; - queryItems(queryParams: PortalQueryParams): IPromise; - queryUsers(queryParams: PortalQueryParams): IPromise; + fetchBasemaps(basemapGalleryGroupQuery?: string): IPromise; + fetchFeaturedGroups(): IPromise; + queryGroups(queryParams: PortalQueryParams): IPromise; + queryItems(queryParams: PortalQueryParams): IPromise; + queryUsers(queryParams: PortalQueryParams): IPromise; } interface PortalConstructor { @@ -4623,7 +3606,7 @@ declare namespace __esri { canSignInIDP?: boolean; colorSetsGroupQuery?: string; commentsEnabled?: boolean; - created?: Date; + created?: DateProperties; culture?: string; customBaseUrl?: string; defaultBasemap?: BasemapProperties; @@ -4645,7 +3628,7 @@ declare namespace __esri { layerTemplatesGroupQuery?: string; loaded?: boolean; maxTokenExpirationMinutes?: number; - modified?: Date; + modified?: DateProperties; name?: string; portalHostname?: string; portalMode?: string; @@ -4667,6 +3650,11 @@ declare namespace __esri { vectorBasemapGalleryGroupQuery?: string; } + export interface PortalFeaturedGroups { + owner: string; + title: string; + } + interface PortalFolder extends Accessor { created: Date; id: string; @@ -4682,7 +3670,7 @@ declare namespace __esri { export const PortalFolder: PortalFolderConstructor; interface PortalFolderProperties { - created?: Date; + created?: DateProperties; id?: string; portal?: PortalProperties; title?: string; @@ -4706,7 +3694,7 @@ declare namespace __esri { fetchMembers(): IPromise; getThumbnailUrl(width?: number): string; - queryItems(queryParams?: PortalQueryParams): IPromise; + queryItems(queryParams?: PortalQueryParams): IPromise; } interface PortalGroupConstructor { @@ -4717,11 +3705,11 @@ declare namespace __esri { interface PortalGroupProperties { access?: string; - created?: Date; + created?: DateProperties; description?: string; id?: string; isInvitationOnly?: boolean; - modified?: Date; + modified?: DateProperties; owner?: string; portal?: PortalProperties; snippet?: string; @@ -4761,13 +3749,14 @@ declare namespace __esri { typeKeywords: string[]; url: string; - addRating(rating: number | PortalRating): IPromise; + addRating(rating: number | PortalRating): IPromise; deleteRating(): IPromise; fetchData(responseType?: string): IPromise; - fetchRating(): IPromise; - fetchRelatedItems(params: PortalItemFetchRelatedItemsParams): IPromise; + fetchRating(): IPromise; + fetchRelatedItems(params: PortalItemFetchRelatedItemsParams): IPromise; getThumbnailUrl(width?: number): string; - update(params?: PortalItemUpdateParams): IPromise; + update(params?: PortalItemUpdateParams): IPromise; + updateThumbnail(params: PortalItemUpdateThumbnailParams): IPromise; } interface PortalItemConstructor { @@ -4782,7 +3771,7 @@ declare namespace __esri { access?: string; accessInformation?: string; avgRating?: number; - created?: Date; + created?: DateProperties; culture?: string; description?: string; extent?: ExtentProperties; @@ -4792,7 +3781,7 @@ declare namespace __esri { itemUrl?: string; licenseInfo?: string; loaded?: boolean; - modified?: Date; + modified?: DateProperties; name?: string; numComments?: number; numRatings?: number; @@ -4809,20 +3798,17 @@ declare namespace __esri { url?: string; } - interface PortalRating extends Accessor { - created: Date; - rating: number; + export interface PortalItemFetchRelatedItemsParams { + relationshipType: string; + direction?: string; } - interface PortalRatingConstructor { - new(properties?: PortalRatingProperties): PortalRating; + export interface PortalItemUpdateParams { + data: string | any; } - export const PortalRating: PortalRatingConstructor; - - interface PortalRatingProperties { - created?: Date; - rating?: number; + export interface PortalItemUpdateThumbnailParams { + thumbnail: Blob | string; } interface PortalQueryParams extends Accessor { @@ -4833,7 +3819,7 @@ declare namespace __esri { sortOrder: string; start: number; - clone(): this; + clone(): PortalQueryParams; } interface PortalQueryParamsConstructor { @@ -4871,6 +3857,22 @@ declare namespace __esri { total?: number; } + interface PortalRating extends Accessor { + created: Date; + rating: number; + } + + interface PortalRatingConstructor { + new(properties?: PortalRatingProperties): PortalRating; + } + + export const PortalRating: PortalRatingConstructor; + + interface PortalRatingProperties { + created?: DateProperties; + rating?: number; + } + interface PortalUser extends Accessor { access: string; created: Date; @@ -4890,13 +3892,13 @@ declare namespace __esri { userContentUrl: string; username: string; - addItem(params: PortalUserAddItemParams): IPromise; + addItem(params: PortalUserAddItemParams): IPromise; deleteItem(item: PortalItem): IPromise; - fetchFolders(): IPromise; - fetchGroups(): IPromise; + fetchFolders(): IPromise; + fetchGroups(): IPromise; fetchItems(params: PortalUserFetchItemsParams): IPromise; getThumbnailUrl(width?: number): string; - queryFavorites(queryParams?: PortalQueryParams): IPromise; + queryFavorites(queryParams?: PortalQueryParams): IPromise; } interface PortalUserConstructor { @@ -4907,12 +3909,12 @@ declare namespace __esri { interface PortalUserProperties { access?: string; - created?: Date; + created?: DateProperties; culture?: string; description?: string; email?: string; fullName?: string; - modified?: Date; + modified?: DateProperties; orgId?: string; portal?: PortalProperties; preferredView?: string; @@ -4925,11 +3927,23 @@ declare namespace __esri { username?: string; } + export interface PortalUserAddItemParams { + item: PortalItem; + data?: string | any; + folder?: PortalFolder; + } + + export interface PortalUserFetchItemsParams { + folder: PortalFolder; + num: number; + start: number; + } + interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { backgroundFillSymbol: FillSymbol; classBreakInfos: ClassBreaksRendererClassBreakInfos[]; defaultSymbol: Symbol; - field: string; + field: string | Function; isMaxInclusive: boolean; legendOptions: ClassBreaksRendererLegendOptions; normalizationField: string; @@ -4940,7 +3954,7 @@ declare namespace __esri { valueExpressionTitle: string; addClassBreakInfo(min: number | any, max: number, symbol: Symbol): void; - clone(): this; + clone(): ClassBreaksRenderer; getClassBreakInfo(graphic: Graphic): any; removeClassBreakInfo(min: number, max: number): void; } @@ -4968,8 +3982,166 @@ declare namespace __esri { valueExpressionTitle?: string; } + export interface ClassBreaksRendererClassBreakInfos { + minValue: number; + maxValue: number; + symbol: Symbol; + label?: string; + } + + export interface ClassBreaksRendererLegendOptions { + title: string; + } + + interface PointCloudClassBreaksRenderer extends PointCloudRenderer { + colorClassBreakInfos: PointCloudClassBreaksRendererColorClassBreakInfos[]; + field: string; + fieldTransformType: string; + type: string; + + clone(): PointCloudClassBreaksRenderer; + } + + interface PointCloudClassBreaksRendererConstructor { + new(properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; + + fromJSON(json: any): PointCloudClassBreaksRenderer; + } + + export const PointCloudClassBreaksRenderer: PointCloudClassBreaksRendererConstructor; + + interface PointCloudClassBreaksRendererProperties extends PointCloudRendererProperties { + colorClassBreakInfos?: PointCloudClassBreaksRendererColorClassBreakInfos[]; + field?: string; + fieldTransformType?: string; + type?: string; + } + + export interface PointCloudClassBreaksRendererColorClassBreakInfos { + minValue: number; + maxValue: number; + color: Color; + label?: string; + } + + interface PointCloudRenderer extends Accessor, JSONSupport { + colorModulation: PointCloudRendererColorModulation; + pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; + pointsPerInch: number; + + clone(): PointCloudRenderer; + } + + interface PointCloudRendererConstructor { + new(properties?: PointCloudRendererProperties): PointCloudRenderer; + + fromJSON(json: any): PointCloudRenderer; + } + + export const PointCloudRenderer: PointCloudRendererConstructor; + + interface PointCloudRendererProperties { + colorModulation?: PointCloudRendererColorModulation; + pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; + pointsPerInch?: number; + } + + export interface PointCloudRendererColorModulation { + field: string; + minValue?: number; + maxValue?: number; + } + + export interface PointCloudRendererPointSizeAlgorithm { + type: string; + useRealWorldSymbolSizes?: boolean; + size?: number; + scaleFactor?: number; + minSize?: number; + } + + interface PointCloudRGBRenderer extends PointCloudRenderer { + field: string; + type: string; + + clone(): PointCloudRGBRenderer; + } + + interface PointCloudRGBRendererConstructor { + new(properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; + + fromJSON(json: any): PointCloudRGBRenderer; + } + + export const PointCloudRGBRenderer: PointCloudRGBRendererConstructor; + + interface PointCloudRGBRendererProperties extends PointCloudRendererProperties { + field?: string; + type?: string; + } + + interface PointCloudStretchRenderer extends PointCloudRenderer { + field: string; + fieldTransformType: string; + stops: PointCloudStretchRendererStops[]; + type: string; + + clone(): PointCloudStretchRenderer; + } + + interface PointCloudStretchRendererConstructor { + new(properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; + + fromJSON(json: any): PointCloudStretchRenderer; + } + + export const PointCloudStretchRenderer: PointCloudStretchRendererConstructor; + + interface PointCloudStretchRendererProperties extends PointCloudRendererProperties { + field?: string; + fieldTransformType?: string; + stops?: PointCloudStretchRendererStops[]; + type?: string; + } + + export interface PointCloudStretchRendererStops { + value: number; + label?: string; + color: Color; + } + + interface PointCloudUniqueValueRenderer extends PointCloudRenderer { + colorUniqueValueInfos: PointCloudUniqueValueRendererColorUniqueValueInfos[]; + field: string; + fieldTransformType: string; + type: string; + + clone(): PointCloudUniqueValueRenderer; + } + + interface PointCloudUniqueValueRendererConstructor { + new(properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; + + fromJSON(json: any): PointCloudUniqueValueRenderer; + } + + export const PointCloudUniqueValueRenderer: PointCloudUniqueValueRendererConstructor; + + interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties { + colorUniqueValueInfos?: PointCloudUniqueValueRendererColorUniqueValueInfos[]; + field?: string; + fieldTransformType?: string; + type?: string; + } + + export interface PointCloudUniqueValueRendererColorUniqueValueInfos { + values: number[]; + color: Color; + label?: string; + } + interface Renderer extends Accessor, JSONSupport { - authoringInfo: any; + authoringInfo: AuthoringInfo; } interface RendererConstructor { @@ -4981,7 +4153,107 @@ declare namespace __esri { export const Renderer: RendererConstructor; interface RendererProperties { - authoringInfo?: any; + authoringInfo?: AuthoringInfo; + } + + export interface AuthoringInfo { + type: string; + fields: string[]; + classificationMethod: string; + standardDeviationInterval: number; + visualVariables: AuthoringInfoVisualVariables[]; + } + + export interface ColorVisualVariable { + type: string; + field: string | Function; + normalizationField: string; + valueExpression: string; + valueExpressionTitle: string; + legendOptions: ColorVisualVariableLegendOptions; + stops: ColorVisualVariableStops[]; + } + + export interface OpacityVisualVariable { + type: string; + field: string | Function; + normalizationField: string; + valueExpression: string; + valueExpressionTitle: string; + legendOptions: OpacityVisualVariableLegendOptions; + stops: OpacityVisualVariableStops[]; + } + + export interface RotationVisualVariable { + type: string; + field: string | Function; + valueExpression: string; + axis: string; + rotationType: string; + } + + export interface SizeVisualVariable { + maxDataValue: number; + type: string; + normalizationField: string; + valueExpression: string; + valueExpressionTitle: string; + legendOptions: SizeVisualVariableLegendOptions; + axis: string; + expression: string; + field: string | Function; + minDataValue: number; + maxSize: string | number | SizeVisualVariable; + minSize: string | number | SizeVisualVariable; + stops: SizeVisualVariableStops[]; + valueUnit: string; + valueRepresentation: string; + useSymbolValue: boolean; + } + + export interface AuthoringInfoVisualVariables { + type: string; + field: string; + minSliderValue: number; + maxSliderValue: number; + theme: string; + style: string; + units: string; + startTime: string | number; + endTime: string | number; + } + + export interface ColorVisualVariableLegendOptions { + title: string; + showLegend: boolean; + } + + export interface ColorVisualVariableStops { + value: number; + color: Color; + label: string; + } + + export interface OpacityVisualVariableLegendOptions { + title: string; + showLegend: boolean; + } + + export interface OpacityVisualVariableStops { + value: number; + opacity: number; + label: string; + } + + export interface SizeVisualVariableLegendOptions { + title: string; + showLegend: boolean; + } + + export interface SizeVisualVariableStops { + value: number; + size: string | number | any; + label: string; } interface SimpleRenderer extends Renderer, VisualVariablesMixin { @@ -4989,7 +4261,7 @@ declare namespace __esri { symbol: Symbol; type: string; - clone(): this; + clone(): SimpleRenderer; } interface SimpleRendererConstructor { @@ -5006,10 +4278,666 @@ declare namespace __esri { type?: string; } + interface color { + createContinuousRenderer(params: colorCreateContinuousRendererParams): IPromise; + createPCContinuousRenderer(params: colorCreatePCContinuousRendererParams): IPromise; + createPCTrueColorRenderer(params: colorCreatePCTrueColorRendererParams): IPromise; + createVisualVariable(params: colorCreateVisualVariableParams): IPromise; + } + + export const color: color; + + export interface colorCreateContinuousRendererParams { + layer: FeatureLayer | SceneLayer; + field: string; + normalizationField?: string; + basemap?: string | Basemap; + theme?: string; + colorScheme?: ColorScheme; + legendOptions?: colorCreateContinuousRendererParamsLegendOptions; + statistics?: SummaryStatisticsResult; + minValue?: number; + maxValue?: number; + defaultSymbolEnabled?: boolean; + view?: SceneView; + symbolType?: string; + colorMixMode?: string; + } + + export interface colorCreateContinuousRendererParamsLegendOptions { + title: string; + } + + export interface colorCreatePCContinuousRendererParams { + layer: PointCloudLayer; + field: string; + basemap?: string | Basemap; + size?: string; + density?: number; + colorScheme?: ColorScheme; + statistics?: SummaryStatisticsResult; + } + + export interface colorCreatePCTrueColorRendererParams { + layer: PointCloudLayer; + size?: string; + density?: number; + } + + export interface colorCreateVisualVariableParams { + layer: FeatureLayer | SceneLayer; + field: string; + normalizationField?: string; + basemap?: string | Basemap; + theme?: string; + colorScheme?: ColorScheme; + legendOptions?: colorCreateVisualVariableParamsLegendOptions; + statistics?: SummaryStatisticsResult; + minValue?: number; + maxValue?: number; + view?: SceneView; + worldScale?: boolean; + } + + export interface colorCreateVisualVariableParamsLegendOptions { + title: string; + } + + export interface ContinuousRendererResult { + renderer: ClassBreaksRenderer; + visualVariable: ColorVisualVariable; + colorScheme: ColorScheme; + defaultValuesUsed: boolean; + statistics: SummaryStatisticsResult; + basemapId: string; + } + + export interface PCContinuousRendererResult { + renderer: PointCloudStretchRenderer; + colorScheme: ColorScheme; + defaultValuesUsed: boolean; + statistics: SummaryStatisticsResult; + basemapId: string; + } + + export interface PCTrueColorRendererResult { + renderer: PointCloudRGBRenderer; + } + + export interface VisualVariableResult { + visualVariable: ColorVisualVariable; + colorScheme: ColorScheme; + statistics: SummaryStatisticsResult; + defaultValuesUsed: boolean; + basemapId: string; + authoringInfo: AuthoringInfo; + } + + interface location { + createRenderer(params: locationCreateRendererParams): IPromise; + } + + export const location: location; + + export interface locationCreateRendererParams { + layer: FeatureLayer | SceneLayer; + basemap?: string | Basemap; + locationScheme?: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + view?: SceneView; + symbolType?: string; + colorMixMode?: string; + } + + export interface RendererResult { + renderer: SimpleRenderer; + locationScheme: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + basemapId: string; + } + + interface size { + createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; + createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; + } + + export const size: size; + + export interface sizeContinuousRendererResult { + renderer: ClassBreaksRenderer; + visualVariables: SizeVisualVariable[]; + sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + defaultValuesUsed: boolean; + statistics: SummaryStatisticsResult; + basemapId: string; + } + + export interface sizeCreateContinuousRendererParams { + layer: FeatureLayer | SceneLayer; + field: string; + normalizationField?: string; + basemap?: string | Basemap; + sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; + statistics?: SummaryStatisticsResult; + minValue?: number; + maxValue?: number; + defaultSymbolEnabled?: boolean; + view?: SceneView; + symbolType?: string; + } + + export interface sizeCreateContinuousRendererParamsLegendOptions { + title: string; + } + + export interface sizeCreateVisualVariablesParams { + layer: FeatureLayer | SceneLayer; + field: string; + normalizationField?: string; + basemap?: string | Basemap; + sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; + statistics?: SummaryStatisticsResult; + minValue?: number; + maxValue?: number; + view?: SceneView; + worldScale?: boolean; + axis?: boolean; + } + + export interface sizeCreateVisualVariablesParamsLegendOptions { + title: string; + } + + export interface sizeVisualVariableResult { + visualVariables: SizeVisualVariable[]; + sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + defaultValuesUsed: boolean; + statistics: SummaryStatisticsResult; + basemapId: string; + authoringInfo: AuthoringInfo; + } + + interface type { + createPCClassRenderer(params: typeCreatePCClassRendererParams): IPromise; + createRenderer(params: typeCreateRendererParams): IPromise; + } + + export const type: type; + + export interface PCClassRendererResult { + renderer: PointCloudUniqueValueRenderer; + } + + export interface typeRendererResult { + renderer: UniqueValueRenderer; + uniqueValueInfos: RendererResultUniqueValueInfos[]; + excludedUniqueValueInfos: any[]; + typeScheme: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme; + basemapId: string; + } + + export interface typeCreatePCClassRendererParams { + layer: PointCloudLayer; + field: string; + size?: string; + density?: number; + typeScheme?: PointTypeScheme; + statistics?: UniqueValuesResult; + } + + export interface typeCreateRendererParams { + layer: FeatureLayer | SceneLayer; + field: string; + basemap?: string | Basemap; + numTypes?: number; + sortBy?: string; + typeScheme?: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme; + legendOptions?: typeCreateRendererParamsLegendOptions; + defaultSymbolEnabled?: boolean; + view?: SceneView; + symbolType?: string; + statistics?: UniqueValuesResult; + colorMixMode?: string; + } + + export interface typeCreateRendererParamsLegendOptions { + title: string; + } + + export interface RendererResultUniqueValueInfos { + value: string | number; + count: number; + label: string; + symbol: Symbol; + } + + interface univariateColorSize { + createContinuousRenderer(params: univariateColorSizeCreateContinuousRendererParams): IPromise; + createVisualVariables(params: univariateColorSizeCreateVisualVariablesParams): IPromise; + } + + export const univariateColorSize: univariateColorSize; + + export interface univariateColorSizeContinuousRendererResult { + renderer: ClassBreaksRenderer; + color: ContinuousRendererResultColor; + size: ContinuousRendererResultSize; + defaultValuesUsed: boolean; + statistics: SummaryStatisticsResult; + basemapId: string; + } + + export interface univariateColorSizeCreateContinuousRendererParams { + layer: FeatureLayer | SceneLayer; + basemap?: string | Basemap; + field: string; + normalizationField?: string; + statistics?: SummaryStatisticsResult; + minValue?: number; + maxValue?: number; + defaultSymbolEnabled?: boolean; + colorOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptions; + sizeOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptions; + view?: SceneView; + symbolType?: string; + } + + export interface univariateColorSizeCreateContinuousRendererParamsColorOptions { + theme?: string; + colorScheme?: ColorScheme; + legendOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; + } + + export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions { + title: string; + } + + export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions { + sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + legendOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; + } + + export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions { + title: string; + } + + export interface univariateColorSizeCreateVisualVariablesParams { + layer: FeatureLayer | SceneLayer; + basemap?: string | Basemap; + field: string; + normalizationField?: string; + statistics?: SummaryStatisticsResult; + minValue?: number; + maxValue?: number; + colorOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptions; + sizeOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptions; + view?: SceneView; + worldScale?: boolean; + } + + export interface univariateColorSizeCreateVisualVariablesParamsColorOptions { + theme?: string; + colorScheme?: ColorScheme; + legendOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; + } + + export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions { + title: string; + } + + export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { + axis?: boolean; + sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; + } + + export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions { + title: string; + } + + export interface VisualVariablesResult { + color: VisualVariablesResultColor; + size: VisualVariablesResultSize; + defaultValuesUsed: boolean; + statistics: SummaryStatisticsResult; + basemapId: string; + authoringInfo: AuthoringInfo; + } + + export interface ContinuousRendererResultColor { + visualVariable: ColorVisualVariable; + colorScheme: ColorScheme; + } + + export interface ContinuousRendererResultSize { + visualVariables: SizeVisualVariable[]; + sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + } + + export interface VisualVariablesResultColor { + visualVariable: ColorVisualVariable; + colorScheme: ColorScheme; + } + + export interface VisualVariablesResultSize { + visualVariables: SizeVisualVariable[]; + sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + } + + interface classBreaks { + classBreaks(params: classBreaksClassBreaksParams): IPromise; + } + + const __classBreaksMapped: classBreaks; + export const classBreaks: typeof __classBreaksMapped.classBreaks; + + + export interface classBreaksClassBreaksParams { + layer: FeatureLayer | SceneLayer; + field?: string; + normalizationField?: string; + classificationMethod?: string; + standardDeviationInterval?: number; + minValue?: number; + maxValue?: number; + numClasses?: number; + } + + export interface ClassBreaksResult { + classBreaksInfos: ClassBreaksResultClassBreaksInfos[]; + minValue: number; + maxValue: number; + } + + export interface ClassBreaksResultClassBreaksInfos { + label: string; + minValue: number; + maxValue: number; + } + + interface histogram { + histogram(params: histogramHistogramParams): IPromise; + } + + const __histogramMapped: histogram; + export const histogram: typeof __histogramMapped.histogram; + + + export interface histogramHistogramParams { + layer: FeatureLayer | SceneLayer | PointCloudLayer; + field?: string; + normalizationField?: string; + classificationMethod?: string; + standardDeviationInterval?: number; + minValue?: number; + maxValue?: number; + numBins?: number; + } + + export interface HistogramResult { + bins: HistogramResultBins[]; + minValue: number; + maxValue: number; + } + + export interface HistogramResultBins { + count: number; + minValue: number; + maxValue: number; + } + + interface summaryStatistics { + summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; + } + + const __summaryStatisticsMapped: summaryStatistics; + export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; + + + export interface SummaryStatisticsResult { + avg: number; + count: number; + max: number; + min: number; + stddev: number; + sum: number; + variance: number; + } + + export interface summaryStatisticsSummaryStatisticsParams { + layer: FeatureLayer | SceneLayer | PointCloudLayer; + field?: string; + normalizationField?: string; + features?: Graphic[]; + minValue?: number; + maxValue?: number; + } + + interface uniqueValues { + uniqueValues(params: uniqueValuesUniqueValuesParams): IPromise; + } + + const __uniqueValuesMapped: uniqueValues; + export const uniqueValues: typeof __uniqueValuesMapped.uniqueValues; + + + export interface UniqueValuesResult { + uniqueValueInfos: UniqueValuesResultUniqueValueInfos[]; + } + + export interface uniqueValuesUniqueValuesParams { + layer: FeatureLayer | SceneLayer | PointCloudLayer; + field: string; + features?: Graphic[]; + returnAllCodedValues?: boolean; + } + + export interface UniqueValuesResultUniqueValueInfos { + value: string | number; + count: number; + } + + interface symbologyColor { + cloneScheme(scheme: ColorScheme): ColorScheme; + flipColors(scheme: ColorScheme): ColorScheme; + getSchemes(params: colorGetSchemesParams): any; + getThemes(basemap?: string | Basemap): any[]; + } + + export const symbologyColor: symbologyColor; + + export interface colorGetSchemesParams { + basemap: string | Basemap; + geometryType: string; + theme: string; + view?: SceneView; + worldScale?: boolean; + } + + export interface ColorScheme { + id: string; + theme: string; + colors: Color[]; + noDataColor: Color; + colorsForClassBreaks: ColorSchemeColorsForClassBreaks[]; + outline: ColorSchemeOutline; + size: number; + width: number; + opacity: number; + } + + export interface ColorSchemeColorsForClassBreaks { + colors: Color[]; + numClasses: number; + } + + export interface ColorSchemeOutline { + color: Color; + width: number; + } + + interface symbologyLocation { + cloneScheme(scheme: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme): PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + getSchemes(params: locationGetSchemesParams): any; + } + + export const symbologyLocation: symbologyLocation; + + export interface locationGetSchemesParams { + basemap: string | Basemap; + geometryType: string; + view?: SceneView; + worldScale?: boolean; + } + + export interface PointLocationScheme { + color: Color; + outline: PointLocationSchemeOutline; + size: number; + opacity: number; + } + + export interface PolygonLocationScheme { + color: Color; + outline: PolygonLocationSchemeOutline; + opacity: number; + } + + export interface PolylineLocationScheme { + color: Color; + width: number; + opacity: number; + } + + export interface PointLocationSchemeOutline { + color: Color; + width: number; + } + + export interface PolygonLocationSchemeOutline { + color: Color; + width: number; + } + + interface symbologySize { + cloneScheme(scheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme): any; + getSchemes(params: sizeGetSchemesParams): any; + } + + export const symbologySize: symbologySize; + + export interface PointSizeScheme { + color: Color; + noDataColor: Color; + outline: PointSizeSchemeOutline; + size: number; + noDataSize: number; + minSize: number; + maxSize: number; + opacity: number; + } + + export interface PolygonSizeScheme { + marker: PointSizeScheme; + background: PolygonSizeSchemeBackground; + opacity: number; + } + + export interface PolylineSizeScheme { + color: Color; + noDataColor: Color; + width: number; + noDataWidth: number; + minWidth: number; + maxWidth: number; + opacity: number; + } + + export interface sizeGetSchemesParams { + basemap: string | Basemap; + geometryType: string; + view?: SceneView; + worldScale?: boolean; + } + + export interface PointSizeSchemeOutline { + color: Color; + width: number; + } + + export interface PolygonSizeSchemeBackground { + color: Color; + outline: PolygonSizeSchemeBackgroundOutline; + } + + export interface PolygonSizeSchemeBackgroundOutline { + color: Color; + width: number; + } + + interface symbologyType { + cloneScheme(scheme: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme): any; + getSchemes(params: typeGetSchemesParams): any; + } + + export const symbologyType: symbologyType; + + export interface MeshTypeScheme { + colors: Color[]; + noDataColor: Color; + opacity: number; + } + + export interface PointTypeScheme { + colors: Color[]; + noDataColor: Color; + outline: PointTypeSchemeOutline; + size: number; + opacity: number; + } + + export interface PolygonTypeScheme { + colors: Color[]; + noDataColor: Color; + outline: PolygonTypeSchemeOutline; + opacity: number; + } + + export interface PolylineTypeScheme { + colors: Color[]; + noDataColor: Color; + width: number; + opacity: number; + } + + export interface typeGetSchemesParams { + basemap: string | Basemap; + geometryType: string; + theme?: string; + worldScale?: boolean; + view?: SceneView; + } + + export interface PointTypeSchemeOutline { + color: Color; + width: number; + } + + export interface PolygonTypeSchemeOutline { + color: Color; + width: number; + } + + interface supportJsonUtils { + fromJSON(json: any): Renderer; + } + + export const supportJsonUtils: supportJsonUtils; + interface UniqueValueRenderer extends Renderer, VisualVariablesMixin { defaultLabel: string; defaultSymbol: Symbol; - field: string; + field: string | Function; field2: string; field3: string; fieldDelimiter: string; @@ -5020,7 +4948,7 @@ declare namespace __esri { valueExpressionTitle: string; addUniqueValueInfo(valueOrInfo: string | number | any, symbol?: Symbol): void; - clone(): this; + clone(): UniqueValueRenderer; getUniqueValueInfo(graphic: Graphic): any; removeUniqueValueInfo(value: string): void; } @@ -5047,110 +4975,63 @@ declare namespace __esri { valueExpressionTitle?: string; } - interface PointCloudRenderer extends Accessor, JSONSupport { - colorModulation: PointCloudRendererColorModulation; - pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; - pointsPerInch: number; - - clone(): this; + export interface UniqueValueRendererLegendOptions { + title?: string; } - interface PointCloudRendererConstructor { - new(properties?: PointCloudRendererProperties): PointCloudRenderer; - - fromJSON(json: any): PointCloudRenderer; + export interface UniqueValueRendererUniqueValueInfos { + value: string | number; + symbol: Symbol; + label?: string; } - export const PointCloudRenderer: PointCloudRendererConstructor; - - interface PointCloudRendererProperties { - colorModulation?: PointCloudRendererColorModulation; - pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; - pointsPerInch?: number; + interface VisualVariablesMixin { + visualVariables: any[]; } - interface PointCloudClassBreaksRenderer extends PointCloudRenderer { - colorClassBreakInfos: PointCloudClassBreaksRendererColorClassBreakInfos[]; - field: string; - fieldTransformType: string; - type: string; + interface VisualVariablesMixinConstructor { + new(): VisualVariablesMixin; } - interface PointCloudClassBreaksRendererConstructor { - new(properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; + export const VisualVariablesMixin: VisualVariablesMixinConstructor; - fromJSON(json: any): PointCloudClassBreaksRenderer; + interface VisualVariablesMixinProperties { + visualVariables?: any[]; } - export const PointCloudClassBreaksRenderer: PointCloudClassBreaksRendererConstructor; - - interface PointCloudClassBreaksRendererProperties extends PointCloudRendererProperties { - colorClassBreakInfos?: PointCloudClassBreaksRendererColorClassBreakInfos[]; - field?: string; - fieldTransformType?: string; - type?: string; + interface request { + esriRequest(url: string, options?: requestEsriRequestOptions): IPromise; } - interface PointCloudRGBRenderer extends PointCloudRenderer { - field: string; - type: string; + const __requestMapped: request; + export const request: typeof __requestMapped.esriRequest; + + + export interface EsriErrorDetails { + getHeader: GetHeader; + httpStatus: number; + messageCode: string; + messages: string[]; + requestOptions: any; + ssl: boolean; + subCode: number; + url: string; } - interface PointCloudRGBRendererConstructor { - new(properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; + export type GetHeader = (headerName: string) => string; - fromJSON(json: any): PointCloudRGBRenderer; - } - - export const PointCloudRGBRenderer: PointCloudRGBRendererConstructor; - - interface PointCloudRGBRendererProperties extends PointCloudRendererProperties { - field?: string; - type?: string; - } - - interface PointCloudStretchRenderer extends PointCloudRenderer { - field: string; - fieldTransformType: string; - stops: PointCloudStretchRendererStops[]; - type: string; - } - - interface PointCloudStretchRendererConstructor { - new(properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; - - fromJSON(json: any): PointCloudStretchRenderer; - } - - export const PointCloudStretchRenderer: PointCloudStretchRendererConstructor; - - interface PointCloudStretchRendererProperties extends PointCloudRendererProperties { - field?: string; - fieldTransformType?: string; - stops?: PointCloudStretchRendererStops[]; - type?: string; - } - - interface PointCloudUniqueValueRenderer extends PointCloudRenderer { - colorUniqueValueInfos: PointCloudUniqueValueRendererColorUniqueValueInfos[]; - field: string; - fieldTransformType: string; - type: string; - } - - interface PointCloudUniqueValueRendererConstructor { - new(properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; - - fromJSON(json: any): PointCloudUniqueValueRenderer; - } - - export const PointCloudUniqueValueRenderer: PointCloudUniqueValueRendererConstructor; - - interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties { - colorUniqueValueInfos?: PointCloudUniqueValueRendererColorUniqueValueInfos[]; - field?: string; - fieldTransformType?: string; - type?: string; + export interface requestEsriRequestOptions { + callbackParamName?: string; + query?: any; + responseType?: string; + headers?: any; + timeout?: number; + method?: string; + body?: FormData | HTMLFormElement | string; + useProxy?: boolean; + cacheBust?: boolean; + allowImageDataAccess?: boolean; + authMode?: string; } interface Action extends Accessor { @@ -5160,7 +5041,7 @@ declare namespace __esri { title: string; visible: boolean; - clone(): this; + clone(): Action; } interface ActionConstructor { @@ -5177,10 +5058,79 @@ declare namespace __esri { visible?: boolean; } + interface LayersMixin { + layers: Collection; + + add(layers: Layer, index?: number): void; + addMany(layers: Layer[], index?: number): void; + findLayerById(layerId: string): Layer; + remove(layer: Layer): Layer; + removeAll(): Layer[]; + removeMany(layers: Layer[]): Layer[]; + reorder(layer: Layer, index: number): Layer; + } + + interface LayersMixinConstructor { + new(): LayersMixin; + } + + export const LayersMixin: LayersMixinConstructor; + + interface LayersMixinProperties { + layers?: CollectionProperties; + } + + interface Callout3D extends Accessor, JSONSupport { + clone(): Callout3D; + } + + interface Callout3DConstructor { + new(properties?: Callout3DProperties): Callout3D; + + fromJSON(json: any): Callout3D; + } + + export const Callout3D: Callout3DConstructor; + + interface Callout3DProperties { + + } + + interface LineCallout3D extends Callout3D { + border: LineCallout3DBorder; + color: Color; + size: number; + type: string; + + clone(): LineCallout3D; + } + + interface LineCallout3DConstructor { + new(properties?: LineCallout3DProperties): LineCallout3D; + + fromJSON(json: any): LineCallout3D; + } + + export const LineCallout3D: LineCallout3DConstructor; + + interface LineCallout3DProperties extends Callout3DProperties { + border?: LineCallout3DBorderProperties; + color?: Color; + size?: number; + type?: string; + } + + export interface LineCallout3DBorderProperties { + color?: Color; + } + export interface LineCallout3DBorder extends Accessor { + color?: Color; + } + interface ExtrudeSymbol3DLayer extends Symbol3DLayer { size: number; - clone(): this; + clone(): ExtrudeSymbol3DLayer; } interface ExtrudeSymbol3DLayerConstructor { @@ -5214,7 +5164,7 @@ declare namespace __esri { interface FillSymbol3DLayer extends Symbol3DLayer { outline: FillSymbol3DLayerOutline; - clone(): this; + clone(): FillSymbol3DLayer; } interface FillSymbol3DLayerConstructor { @@ -5229,8 +5179,13 @@ declare namespace __esri { outline?: FillSymbol3DLayerOutline; } + export interface FillSymbol3DLayerOutline { + color: Color; + size: number; + } + interface Font extends Accessor, JSONSupport { - clone(): this; + clone(): Font; } interface FontConstructor { @@ -5251,7 +5206,7 @@ declare namespace __esri { resource: IconSymbol3DLayerResource; size: number; - clone(): this; + clone(): IconSymbol3DLayer; } interface IconSymbol3DLayerConstructor { @@ -5269,11 +5224,21 @@ declare namespace __esri { size?: number; } + export interface IconSymbol3DLayerOutline { + color?: Color; + size?: number; + } + + export interface IconSymbol3DLayerResource { + primitive?: string; + href?: string; + } + interface LabelSymbol3D extends Symbol3D { callout: Callout3D; verticalOffset: LabelSymbol3DVerticalOffset; - clone(): this; + clone(): LabelSymbol3D; } interface LabelSymbol3DConstructor { @@ -5289,6 +5254,17 @@ declare namespace __esri { verticalOffset?: LabelSymbol3DVerticalOffsetProperties; } + export interface LabelSymbol3DVerticalOffsetProperties { + screenLength?: number; + minWorldLength?: number; + maxWorldLength?: number; + } + export interface LabelSymbol3DVerticalOffset extends Accessor { + screenLength: number; + minWorldLength?: number; + maxWorldLength?: number; + } + interface LineSymbol extends Symbol { color: Color; width: number; @@ -5308,7 +5284,7 @@ declare namespace __esri { } interface LineSymbol3D extends Symbol3D { - clone(): this; + clone(): LineSymbol3D; } interface LineSymbol3DConstructor { @@ -5326,7 +5302,7 @@ declare namespace __esri { interface LineSymbol3DLayer extends Symbol3DLayer { size: number; - clone(): this; + clone(): LineSymbol3DLayer; } interface LineSymbol3DLayerConstructor { @@ -5362,7 +5338,7 @@ declare namespace __esri { } interface MeshSymbol3D extends Symbol3D { - clone(): this; + clone(): MeshSymbol3D; } interface MeshSymbol3DConstructor { @@ -5387,7 +5363,7 @@ declare namespace __esri { tilt: number; width: number; - clone(): this; + clone(): ObjectSymbol3DLayer; } interface ObjectSymbol3DLayerConstructor { @@ -5409,6 +5385,29 @@ declare namespace __esri { width?: number; } + export interface ObjectSymbol3DLayerResource { + primitive?: string; + href?: string; + } + + interface PathSymbol3DLayer extends Symbol3DLayer { + size: number; + + clone(): PathSymbol3DLayer; + } + + interface PathSymbol3DLayerConstructor { + new(properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; + + fromJSON(json: any): PathSymbol3DLayer; + } + + export const PathSymbol3DLayer: PathSymbol3DLayerConstructor; + + interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { + size?: number; + } + interface PictureFillSymbol extends FillSymbol { height: number; url: string; @@ -5418,7 +5417,7 @@ declare namespace __esri { yoffset: number; yscale: number; - clone(): this; + clone(): PictureFillSymbol; } interface PictureFillSymbolConstructor { @@ -5444,7 +5443,7 @@ declare namespace __esri { url: string; width: number; - clone(): this; + clone(): PictureMarkerSymbol; } interface PictureMarkerSymbolConstructor { @@ -5461,29 +5460,11 @@ declare namespace __esri { width?: number; } - interface PathSymbol3DLayer extends Symbol3DLayer { - size: number; - - clone(): this; - } - - interface PathSymbol3DLayerConstructor { - new(properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; - - fromJSON(json: any): PathSymbol3DLayer; - } - - export const PathSymbol3DLayer: PathSymbol3DLayerConstructor; - - interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { - size?: number; - } - interface PointSymbol3D extends Symbol3D { callout: Callout3D; verticalOffset: PointSymbol3DVerticalOffset; - clone(): this; + clone(): PointSymbol3D; } interface PointSymbol3DConstructor { @@ -5499,8 +5480,19 @@ declare namespace __esri { verticalOffset?: PointSymbol3DVerticalOffsetProperties; } + export interface PointSymbol3DVerticalOffsetProperties { + screenLength?: number; + minWorldLength?: number; + maxWorldLength?: number; + } + export interface PointSymbol3DVerticalOffset extends Accessor { + screenLength: number; + minWorldLength?: number; + maxWorldLength?: number; + } + interface PolygonSymbol3D extends Symbol3D { - clone(): this; + clone(): PolygonSymbol3D; } interface PolygonSymbol3DConstructor { @@ -5519,7 +5511,7 @@ declare namespace __esri { color: Color; style: string; - clone(): this; + clone(): SimpleFillSymbol; } interface SimpleFillSymbolConstructor { @@ -5541,7 +5533,7 @@ declare namespace __esri { miterLimit: number; style: string; - clone(): this; + clone(): SimpleLineSymbol; } interface SimpleLineSymbolConstructor { @@ -5566,7 +5558,7 @@ declare namespace __esri { size: number; style: string; - clone(): this; + clone(): SimpleMarkerSymbol; } interface SimpleMarkerSymbolConstructor { @@ -5585,6 +5577,12 @@ declare namespace __esri { style?: string; } + interface symbolsSupportJsonUtils { + fromJSON(json: any): Symbol; + } + + export const symbolsSupportJsonUtils: symbolsSupportJsonUtils; + interface Symbol extends Accessor, JSONSupport { type: string; } @@ -5603,7 +5601,7 @@ declare namespace __esri { interface Symbol3D extends Symbol { styleOrigin: Symbol3DStyleOrigin; - symbolLayers: Collection; + symbolLayers: Collection; } interface Symbol3DConstructor { @@ -5616,7 +5614,13 @@ declare namespace __esri { interface Symbol3DProperties extends SymbolProperties { styleOrigin?: Symbol3DStyleOrigin; - symbolLayers?: Collection | any[]; + symbolLayers?: CollectionProperties; + } + + export interface Symbol3DStyleOrigin { + styleName?: string; + styleUrl?: string; + name: string; } interface Symbol3DLayer extends Accessor, JSONSupport { @@ -5654,7 +5658,7 @@ declare namespace __esri { xoffset: number; yoffset: number; - clone(): this; + clone(): TextSymbol; } interface TextSymbolConstructor { @@ -5689,7 +5693,7 @@ declare namespace __esri { size: number; text: string; - clone(): this; + clone(): TextSymbol3DLayer; } interface TextSymbol3DLayerConstructor { @@ -5707,14 +5711,25 @@ declare namespace __esri { text?: string; } + export interface TextSymbol3DLayerFont { + family?: string; + weight?: string; + style?: string; + } + + export interface TextSymbol3DLayerHalo { + color?: Color; + size?: number; + } + interface WebStyleSymbol extends Symbol { name: string; portal: Portal; styleName: string; styleUrl: string; - clone(): this; - fetchSymbol(): IPromise; + clone(): WebStyleSymbol; + fetchSymbol(): IPromise; } interface WebStyleSymbolConstructor { @@ -5732,46 +5747,8 @@ declare namespace __esri { styleUrl?: string; } - interface Callout3D extends Accessor, JSONSupport { - clone(): this; - } - - interface Callout3DConstructor { - new(properties?: Callout3DProperties): Callout3D; - - fromJSON(json: any): Callout3D; - } - - export const Callout3D: Callout3DConstructor; - - interface Callout3DProperties { - - } - - interface LineCallout3D extends Callout3D { - border: LineCallout3DBorder; - color: Color; - size: number; - type: string; - } - - interface LineCallout3DConstructor { - new(properties?: LineCallout3DProperties): LineCallout3D; - - fromJSON(json: any): LineCallout3D; - } - - export const LineCallout3D: LineCallout3DConstructor; - - interface LineCallout3DProperties extends Callout3DProperties { - border?: LineCallout3DBorderProperties; - color?: Color; - size?: number; - type?: string; - } - interface ClosestFacilityTask extends Task { - solve(params: ClosestFacilityParameters, requestOptions?: any): IPromise; + solve(params: ClosestFacilityParameters, requestOptions?: any): IPromise; } interface ClosestFacilityTaskConstructor { @@ -5802,26 +5779,26 @@ declare namespace __esri { interface GeometryService extends Task { areasAndLengths(areasAndLengthsParameters: AreasAndLengthsParameters, requestOptions?: any): IPromise; - autoComplete(polygons: Polygon[], polylines: Polyline[], requestOptions?: any): IPromise; - buffer(bufferParameters: BufferParameters, requestOptions?: any): IPromise; - convexHull(geometries: Geometry[], requestOptions?: any): IPromise; + autoComplete(polygons: Polygon[], polylines: Polyline[], requestOptions?: any): IPromise; + buffer(bufferParameters: BufferParameters, requestOptions?: any): IPromise; + convexHull(geometries: Geometry[], requestOptions?: any): IPromise; cut(geometries: Geometry[], cutter: Polyline, requestOptions?: any): IPromise; - densify(densifyParameters: DensifyParameters, requestOptions?: any): IPromise; - difference(geometries: Geometry[], geometry: Geometry, requestOptions?: any): IPromise; - distance(params: DistanceParameters, requestOptions?: any): IPromise; + densify(densifyParameters: DensifyParameters, requestOptions?: any): IPromise; + difference(geometries: Geometry[], geometry: Geometry, requestOptions?: any): IPromise; + distance(params: DistanceParameters, requestOptions?: any): IPromise; fromGeoCoordinateString(params: GeometryServiceFromGeoCoordinateStringParams, requestOptions?: any): IPromise; - generalize(params: GeneralizeParameters, requestOptions?: any): IPromise; - intersect(geometries: Geometry[], intersector: Geometry, requestOptions?: any): IPromise; - labelPoints(polygons: Polygon[], requestOptions?: any): IPromise; + generalize(params: GeneralizeParameters, requestOptions?: any): IPromise; + intersect(geometries: Geometry[], intersector: Geometry, requestOptions?: any): IPromise; + labelPoints(polygons: Polygon[], requestOptions?: any): IPromise; lengths(params: LengthsParameters, requestOptions?: any): IPromise; - offset(params: OffsetParameters, requestOptions?: any): IPromise; - project(params: ProjectParameters, requestOptions?: any): IPromise; - relation(params: RelationParameters, requestOptions?: any): IPromise; - reshape(targetGeometry: Geometry, reshaper: Geometry, requestOptions?: any): IPromise; - simplify(geometries: Geometry[], requestOptions?: any): IPromise; - toGeoCoordinateString(params: GeometryServiceToGeoCoordinateStringParams, requestOptions?: any): IPromise; - trimExtend(params: TrimExtendParameters, requestOptions?: any): IPromise; - union(geometries: Geometry[], requestOptions?: any): IPromise; + offset(params: OffsetParameters, requestOptions?: any): IPromise; + project(params: ProjectParameters, requestOptions?: any): IPromise; + relation(params: RelationParameters, requestOptions?: any): IPromise; + reshape(targetGeometry: Geometry, reshaper: Geometry, requestOptions?: any): IPromise; + simplify(geometries: Geometry[], requestOptions?: any): IPromise; + toGeoCoordinateString(params: GeometryServiceToGeoCoordinateStringParams, requestOptions?: any): IPromise; + trimExtend(params: TrimExtendParameters, requestOptions?: any): IPromise; + union(geometries: Geometry[], requestOptions?: any): IPromise; } interface GeometryServiceConstructor { @@ -5834,6 +5811,23 @@ declare namespace __esri { } + export interface GeometryServiceFromGeoCoordinateStringParams { + strings: string[]; + sr: SpatialReference | string; + conversionType: string; + conversionMode?: string; + } + + export interface GeometryServiceToGeoCoordinateStringParams { + sr: SpatialReference | string; + coordinates: number[][]; + conversionType: string; + conversionMode?: string; + numOfDigits?: number; + rounding?: boolean; + addSpaces?: boolean; + } + interface Geoprocessor extends Task { outSpatialReference: SpatialReference; processSpatialReference: SpatialReference; @@ -5878,7 +5872,7 @@ declare namespace __esri { } interface ImageServiceIdentifyTask extends Task { - execute(params: ImageServiceIdentifyParameters, requestOptions?: any): IPromise; + execute(params: ImageServiceIdentifyParameters, requestOptions?: any): IPromise; } interface ImageServiceIdentifyTaskConstructor { @@ -5896,10 +5890,10 @@ declare namespace __esri { countryCode: string; outSpatialReference: SpatialReference; - addressesToLocations(params: LocatorAddressesToLocationsParams, requestOptions?: any): IPromise; - addressToLocations(params: LocatorAddressToLocationsParams, requestOptions?: any): IPromise; - locationToAddress(location: Point, distance?: number, requestOptions?: any): IPromise; - suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; + addressesToLocations(params: LocatorAddressesToLocationsParams, requestOptions?: any): IPromise; + addressToLocations(params: LocatorAddressToLocationsParams, requestOptions?: any): IPromise; + locationToAddress(location: Point, distance?: number, requestOptions?: any): IPromise; + suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; } interface LocatorConstructor { @@ -5914,24 +5908,36 @@ declare namespace __esri { outSpatialReference?: SpatialReferenceProperties; } - interface QueryTask extends Task { - gdbVersion: string; - - execute(params: Query, requestOptions?: any): IPromise; - executeForCount(params: Query, requestOptions?: any): IPromise; - executeForExtent(params: Query, requestOptions?: any): IPromise; - executeForIds(params: Query, requestOptions?: any): IPromise; - executeRelationshipQuery(params: RelationshipQuery, requestOptions?: any): IPromise; + export interface LocatorAddressesToLocationsParams { + addresses: any[]; + countryCode: string; + categories: string[]; } - interface QueryTaskConstructor { - new(properties?: QueryTaskProperties): QueryTask; + export interface LocatorAddressToLocationsParams { + address: any; + categories: string[]; + countryCode: string; + distance: number; + forStorage: boolean; + location: Point; + magicKey: string; + maxLocations: number; + outFields: string[]; + searchExtent: Extent; } - export const QueryTask: QueryTaskConstructor; + export interface LocatorSuggestLocationsParams { + categories: string[]; + distance: number; + location: Point; + text: string; + } - interface QueryTaskProperties extends TaskProperties { - gdbVersion?: string; + export interface SuggestionResult { + isCollection: boolean; + magicKey: string; + text: string; } interface PrintTask extends Task { @@ -5952,8 +5958,28 @@ declare namespace __esri { updateDelay?: number; } + interface QueryTask extends Task { + gdbVersion: string; + + execute(params: Query, requestOptions?: any): IPromise; + executeForCount(params: Query, requestOptions?: any): IPromise; + executeForExtent(params: Query, requestOptions?: any): IPromise; + executeForIds(params: Query, requestOptions?: any): IPromise; + executeRelationshipQuery(params: RelationshipQuery, requestOptions?: any): IPromise; + } + + interface QueryTaskConstructor { + new(properties?: QueryTaskProperties): QueryTask; + } + + export const QueryTask: QueryTaskConstructor; + + interface QueryTaskProperties extends TaskProperties { + gdbVersion?: string; + } + interface RouteTask extends Task { - solve(params: RouteParameters, requestOptions?: any): IPromise; + solve(params: RouteParameters, requestOptions?: any): IPromise; } interface RouteTaskConstructor { @@ -5967,7 +5993,7 @@ declare namespace __esri { } interface ServiceAreaTask extends Task { - solve(params: ServiceAreaParameters, requestOptions?: any): IPromise; + solve(params: ServiceAreaParameters, requestOptions?: any): IPromise; } interface ServiceAreaTaskConstructor { @@ -5980,22 +6006,6 @@ declare namespace __esri { } - interface Task extends Accessor { - requestOptions: any; - url: string; - } - - interface TaskConstructor { - new(properties?: TaskProperties): Task; - } - - export const Task: TaskConstructor; - - interface TaskProperties { - requestOptions?: any; - url?: string; - } - interface AddressCandidate extends Accessor, JSONSupport { address: string; attributes: any; @@ -6087,7 +6097,7 @@ declare namespace __esri { outputGeometryPrecision: number; outputGeometryPrecisionUnits: string; outputLines: string; - outSpatialReference: SpatialReference; + outSpatialReference: SpatialReference | string; pointBarriers: DataLayer | FeatureSet; polygonBarriers: DataLayer | FeatureSet; polylineBarriers: DataLayer | FeatureSet; @@ -6125,16 +6135,16 @@ declare namespace __esri { directionsStyleName?: string; directionsTimeAttribute?: string; doNotLocateOnRestrictedElements?: boolean; - facilities?: DataLayer | FeatureSet; + facilities?: DataLayerProperties | FeatureSetProperties; impedanceAttribute?: string; - incidents?: DataLayer | FeatureSet; + incidents?: DataLayerProperties | FeatureSetProperties; outputGeometryPrecision?: number; outputGeometryPrecisionUnits?: string; outputLines?: string; - outSpatialReference?: SpatialReference | string; - pointBarriers?: DataLayer | FeatureSet; - polygonBarriers?: DataLayer | FeatureSet; - polylineBarriers?: DataLayer | FeatureSet; + outSpatialReference?: SpatialReferenceProperties | string; + pointBarriers?: DataLayerProperties | FeatureSetProperties; + polygonBarriers?: DataLayerProperties | FeatureSetProperties; + polylineBarriers?: DataLayerProperties | FeatureSetProperties; restrictionAttributes?: string[]; restrictUTurns?: string; returnDirections?: boolean; @@ -6144,12 +6154,18 @@ declare namespace __esri { returnPolygonBarriers?: boolean; returnPolylineBarriers?: boolean; returnRoutes?: boolean; - timeOfDay?: Date; + timeOfDay?: DateProperties; timeOfDayUsage?: string; travelDirection?: string; useHierarchy?: boolean; } + export interface ClosestFacilityParametersAttributeParameterValues { + attributeName: string; + parameterName: string; + value: string; + } + interface ClosestFacilitySolveResult extends Accessor, JSONSupport { directions: DirectionsFeatureSet; facilities: Point[]; @@ -6234,7 +6250,7 @@ declare namespace __esri { export const supportDate: supportDateConstructor; interface supportDateProperties { - date?: Date; + date?: DateProperties; format?: string; } @@ -6513,7 +6529,7 @@ declare namespace __esri { export const ImageServiceIdentifyParameters: ImageServiceIdentifyParametersConstructor; interface ImageServiceIdentifyParametersProperties { - geometry?: Point | Polygon; + geometry?: PointProperties | PolygonProperties; mosaicRule?: MosaicRuleProperties; noData?: string | number; pixelSize?: SymbolProperties; @@ -6738,6 +6754,21 @@ declare namespace __esri { showLabels?: boolean; } + export interface PrintTemplateExportOptions { + width?: number; + height?: number; + dpi?: number; + } + + export interface PrintTemplateLayoutOptions { + titleText: string; + authorText: string; + copyrightText: string; + scalebarUnit: string; + legendLayers: LegendLayer[]; + customTextElements: any[]; + } + interface ProjectParameters extends Accessor { geometries: Geometry[]; outSpatialReference: SpatialReference; @@ -6762,6 +6793,11 @@ declare namespace __esri { transformForward?: boolean; } + export interface ProjectParametersTransformation { + wkid?: number; + wkt?: string; + } + interface Query extends Accessor { distance: number; geometry: Geometry; @@ -6822,6 +6858,13 @@ declare namespace __esri { where?: string; } + export interface QueryQuantizationParameters { + extent?: Extent; + mode?: string; + originPosition?: string; + tolerance?: number; + } + interface RasterData extends Accessor, JSONSupport { format: string; itemId: string; @@ -6942,7 +6985,7 @@ declare namespace __esri { interface RouteParametersProperties { accumulateAttributes?: string[]; attributeParameterValues?: AttributeParamValue; - barriers?: DataLayer | FeatureSet; + barriers?: DataLayerProperties | FeatureSetProperties; directionsLanguage?: string; directionsLengthUnits?: string; directionsOutputType?: string; @@ -6956,8 +6999,8 @@ declare namespace __esri { outputGeometryPrecisionUnits?: string; outputLines?: string; outSpatialReference?: SpatialReferenceProperties; - polygonBarriers?: DataLayer | FeatureSet; - polylineBarriers?: DataLayer | FeatureSet; + polygonBarriers?: DataLayerProperties | FeatureSetProperties; + polylineBarriers?: DataLayerProperties | FeatureSetProperties; preserveFirstStop?: boolean; preserveLastStop?: boolean; restrictionAttributes?: string[]; @@ -6969,13 +7012,19 @@ declare namespace __esri { returnRoutes?: boolean; returnStops?: boolean; returnZ?: boolean; - startTime?: Date; + startTime?: DateProperties; startTimeIsUTC?: boolean; - stops?: DataLayer | FeatureSet; + stops?: DataLayerProperties | FeatureSetProperties; useHierarchy?: boolean; useTimeWindows?: boolean; } + export interface AttributeParamValue { + attributeName: string; + parameterName: string; + value: string; + } + interface RouteResult extends Accessor, JSONSupport { directions: DirectionsFeatureSet; route: Graphic; @@ -7047,7 +7096,7 @@ declare namespace __esri { defaultBreaks?: number[]; doNotLocateOnRestrictedElements?: boolean; excludeSourcesFromPolygons?: string[]; - facilities?: DataLayer | FeatureSet; + facilities?: DataLayerProperties | FeatureSetProperties; impedanceAttribute?: string; mergeSimilarPolygonRanges?: boolean; outputGeometryPrecision?: number; @@ -7057,9 +7106,9 @@ declare namespace __esri { outSpatialReference?: SpatialReferenceProperties; overlapLines?: boolean; overlapPolygons?: boolean; - pointBarriers?: DataLayer | FeatureSet; - polygonBarriers?: DataLayer | FeatureSet; - polylineBarriers?: DataLayer | FeatureSet; + pointBarriers?: DataLayerProperties | FeatureSetProperties; + polygonBarriers?: DataLayerProperties | FeatureSetProperties; + polylineBarriers?: DataLayerProperties | FeatureSetProperties; restrictionAttributes?: string[]; restrictUTurns?: string; returnFacilities?: boolean; @@ -7068,7 +7117,7 @@ declare namespace __esri { returnPolylineBarriers?: boolean; splitLinesAtBreaks?: boolean; splitPolygonsAtBreaks?: boolean; - timeOfDay?: Date; + timeOfDay?: DateProperties; travelDirection?: string; trimOuterPolygon?: boolean; trimPolygonDistance?: number; @@ -7144,20 +7193,36 @@ declare namespace __esri { trimExtendTo?: PolylineProperties; } + interface Task extends Accessor { + requestOptions: any; + url: string; + } + + interface TaskConstructor { + new(properties?: TaskProperties): Task; + } + + export const Task: TaskConstructor; + + interface TaskProperties { + requestOptions?: any; + url?: string; + } + interface ConfigurationTask extends Task { url: string; - getAllGroups(requestOptions?: any): IPromise; - getAllUsers(requestOptions?: any): IPromise; - getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; - getGroup(groupId: number, requestOptions?: any): IPromise; - getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; - getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; - getServiceInfo(requestOptions?: any): IPromise; - getTableRelationshipsDetails(requestOptions?: any): IPromise; - getUser(user: string, requestOptions?: any): IPromise; - getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; - getVisibleJobTypes(user: string, requestOptions?: any): IPromise; + getAllGroups(requestOptions?: any): IPromise; + getAllUsers(requestOptions?: any): IPromise; + getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + getGroup(groupId: number, requestOptions?: any): IPromise; + getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; + getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; + getServiceInfo(requestOptions?: any): IPromise; + getTableRelationshipsDetails(requestOptions?: any): IPromise; + getUser(user: string, requestOptions?: any): IPromise; + getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + getVisibleJobTypes(user: string, requestOptions?: any): IPromise; } interface ConfigurationTaskConstructor { @@ -7170,44 +7235,218 @@ declare namespace __esri { url?: string; } + export interface ConfigurationTaskGetDataWorkspaceDetailsParams { + dataWorkspaceId: string; + user: string; + } + + export interface ConfigurationTaskGetUserJobQueryDetailsParams { + queryId: number; + user: string; + } + + export interface DataWorkspace { + id: string; + name: string; + } + + export interface GroupMembership { + id: number; + name: string; + } + + export interface HoldType { + description: string; + id: number; + name: string; + } + + export interface JobPriority { + description: string; + name: string; + value: number; + } + + export interface JobQuery { + id: number; + name: string; + } + + export interface JobQueryContainer { + containers: JobQueryContainer[]; + id: number; + name: string; + queries: JobQuery[]; + } + + export interface JobQueryDetails { + aliases: string[]; + fields: string[]; + id: number; + name: string; + orderBy: string; + tables: string[]; + where: string; + } + + export interface JobStatus { + caption: string; + description: string; + id: number; + name: string; + } + + export interface JobType { + category: string; + description: string; + id: string; + name: string; + state: string; + } + + export interface JobTypeDetails { + defaultParentVersionName: string; + autoExecuteCreatedJobs: boolean; + category: string; + defaultAssignedTo: string; + defaultAssignedType: string; + defaultDataWorkspaceId: string; + defaultDescription: string; + defaultDueDate: string; + defaultJobDuration: number; + canDataWorkspaceChange: boolean; + defaultPriority: string; + defaultStartDate: Date; + description: string; + id: string; + jobNamingScheme: string; + jobVersionNamingScheme: string; + mxdNamingScheme: string; + name: string; + state: string; + } + + export interface Privilege { + description: string; + id: number; + name: string; + } + + export interface TableRelationship { + cardinality: string; + linkField: string; + tableAlias: string; + tableName: string; + } + + export interface UserDetails { + lastName: string; + address: string; + faxNumber: string; + firstName: string; + fullName: string; + groups: GroupMembership[]; + email: string; + phoneNumber: string; + privileges: Privilege[]; + roomNumber: string; + userName: string; + userQueries: JobQueryContainer[]; + zipCode: string; + } + + export interface VersionInfo { + access: string; + name: string; + parent: string; + } + + export interface WorkflowManagerServiceInfo { + jobPriorities: JobPriority[]; + activityTypes: ActivityType[]; + currentVersion: number; + dataWorkspaces: DataWorkspace[]; + holdTypes: HoldType[]; + configProperties: WorkflowManagerServiceInfoConfigProperties; + jobStatuses: JobStatus[]; + jobTypes: JobType[]; + notificationTypes: NotificationType[]; + privileges: Privilege[]; + publicQueries: JobQueryContainer[]; + } + + export interface WorkflowManagerServiceInfoConfigProperties { + AOIOVERLAP: string; + AOISELECTIONCOLOR: number; + AUTOASSIGNJOB: boolean; + AUTOCLOSEJOB: boolean; + AUTOCOMMITWORKFLOW: boolean; + AUTOSTATUSASSIGN: boolean; + CONFIRMPROCEDURALCHECK: boolean; + DEFAULT_SENDER_EMAIL: string; + DEFAULT_SENDER_NAME: string; + HTML_SUPPORT: string; + JOB_ID_START_VALUE: string; + PENDING_DAYS_USE_HOLDS: boolean; + PROMPTSDEPWD: boolean; + REQUIREPROCEDURALCHECKSTART: number; + RESTRICT_AOI_OPTION: string; + SEND_SN_CUSTOM_POST: boolean; + SHOW_STEP_IDS: boolean; + SHOW_STEP_PERCENT_COMPLETE: boolean; + SMTP_PASSWORD: string; + SHOW_PENDING_DAYS: boolean; + SMTP_PORT: string; + SMTP_PROTOCOL: string; + SMTP_SERVER: string; + SMTP_USERNAME: string; + USE_STEP_STATUS: boolean; + USER_STORE: string; + USEUSERDOMAIN: boolean; + WF_SEL_STEP_FILL_COLOR: number; + WF_SEL_STEP_OUTLINE_COLOR: number; + WF_SEL_STEP_OUTLINE_WIDTH: number; + ZOOMTOAOI: boolean; + } + interface JobTask extends Task { url: string; - addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; - addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; - addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; - assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; - closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; - createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; - createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; - createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; - createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; - deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; - deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; - deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; - deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; - getActivityLog(jobId: number, requestOptions?: any): IPromise; + addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; + addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; + addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; + assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; + closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; + createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; + createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; + createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; + createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; + deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; + deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; + deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; + deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; + getActivityLog(jobId: number, requestOptions?: any): IPromise; getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; - getAttachments(jobId: number, requestOptions?: any): IPromise; - getDependencies(jobId: number, requestOptions?: any): IPromise; - getExtendedProperties(jobId: number, requestOptions?: any): IPromise; - getHolds(jobId: number, requestOptions?: any): IPromise; - getJob(jobId: number, requestOptions?: any): IPromise; - getJobIds(requestOptions?: any): IPromise; - getNotes(jobId: number, requestOptions?: any): IPromise; - listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; - listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; - logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; - queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; - queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; - queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; - releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; - reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; - searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; - unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; - updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; - updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; - updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; + getAttachments(jobId: number, requestOptions?: any): IPromise; + getDependencies(jobId: number, requestOptions?: any): IPromise; + getExtendedProperties(jobId: number, requestOptions?: any): IPromise; + getHolds(jobId: number, requestOptions?: any): IPromise; + getJob(jobId: number, requestOptions?: any): IPromise; + getJobIds(requestOptions?: any): IPromise; + getNotes(jobId: number, requestOptions?: any): IPromise; + listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; + listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; + queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; + queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; + queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; + reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; + searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; + unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; + updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; + updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; + updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; } interface JobTaskConstructor { @@ -7220,22 +7459,332 @@ declare namespace __esri { url?: string; } + export interface ActivityType { + desription: string; + id: number; + message: string; + name: string; + } + + export interface AuxRecord { + displayProperty: any; + id: number; + recordvalues: AuxRecordValue; + } + + export interface AuxRecordContainer { + records: AuxRecord; + relationshipType: string; + tableAlias: string; + tableName: string; + } + + export interface AuxRecordDescription { + properties: any; + recordId: number; + tableName: string; + } + + export interface AuxRecordValue { + filter: string; + alias: string; + data: any; + dataType: string; + displayOrder: number; + displayType: string; + domain: string; + canUpdate: boolean; + length: number; + name: string; + required: boolean; + tableListClass: string; + tableListDisplayField: string; + tableListStoreField: string; + userVisible: boolean; + } + + export interface FieldValue { + description: string; + value: any; + } + + export interface JobAttachment { + filename: string; + folder: string; + id: number; + storageType: string; + } + + export interface JobCreationParameters { + loi: Geometry; + assignedTo: string; + autoCommitWorkflow: boolean; + autoExecute: boolean; + dataWorkspaceId: string; + description: string; + dueDate: Date; + jobTypeId: number; + assignedType: string; + name: string; + numJobs: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + priority: number; + startDate: Date; + user: string; + } + + export interface JobDependency { + depJobId: number; + depOnType: string; + depOnValue: string; + heldOnValue: number; + holdOnType: string; + id: number; + jobID: string; + } + + export interface JobTaskJobInfo { + name: string; + assignedTo: string; + childJobIds: number[]; + createdBy: string; + createdDate: Date; + dataWorkspaceId: string; + description: string; + dueDate: Date; + endDate: Date; + id: number; + jobTypeId: number; + loi: Geometry; + assignedType: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + pendingDays: number; + percentageComplete: number; + priority: number; + stage: string; + startDate: Date; + status: number; + versionExists: boolean; + versionInfo: JobVersionInfo; + versionName: string; + } + + export interface JobQueryParameters { + aliases: string; + fields: string; + orderBy: string; + tables: string; + where: string; + user: string; + } + + export interface JobTaskAddEmbeddedAttachmentParams { + jobId: number; + form: any; + user: string; + } + + export interface JobTaskAddLinkedAttachmentParams { + jobId: number; + attachmentType: number; + path: string; + user: string; + } + + export interface JobTaskAddLinkedRecordParams { + jobId: number; + tableName: string; + user: string; + } + + export interface JobTaskAssignJobsParams { + jobIds: number[]; + assignedType: string; + assignedTo: string; + user: string; + } + + export interface JobTaskCloseJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskCreateDependencyParams { + jobId: number; + heldOnType: string; + heldOnValue: number; + depJobId: number; + depOnType: string; + depOnValue: number; + user: string; + } + + export interface JobTaskCreateHoldParams { + jobId: number; + holdTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskCreateJobVersionParams { + jobId: number; + name: string; + parent: string; + user: string; + } + + export interface JobTaskDeleteAttachmentParams { + jobId: number; + attachmentId: number; + user: string; + } + + export interface JobTaskDeleteDependencyParams { + jobId: number; + dependencyId: number; + user: string; + } + + export interface JobTaskDeleteJobsParams { + jobIds: number[]; + deleteHistory?: boolean; + user: string; + } + + export interface JobTaskDeleteLinkedRecordParams { + jobId: number; + tableName: string; + recordId: number; + user: string; + } + + export interface JobTaskGetAttachmentContentUrlParams { + jobId: number; + attachmentId: number; + } + + export interface JobTaskListFieldValuesParams { + jobId: number; + tableName: string; + field: string; + user: string; + } + + export interface JobTaskListMultiLevelFieldValuesParams { + field: string; + previousSelectedValues: string[]; + user: string; + } + + export interface JobTaskLogActionParams { + jobId: number; + activityTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskQueryJobsParams { + queryId: number; + user: string; + } + + export interface JobTaskQueryMultiLevelSelectedValuesParams { + field: string; + user: string; + } + + export interface JobTaskReleaseHoldParams { + jobId: number; + holdId: number; + } + + export interface JobTaskReopenClosedJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskSearchJobsParams { + text: string; + user: string; + } + + export interface JobTaskUnassignJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskUpdateNotesParams { + jobId: number; + notes: string; + user: string; + } + + export interface JobTaskUpdateRecordParams { + jobId: number; + record: AuxRecordDescription; + user: string; + } + + export interface JobUpdateParameters { + ownedBy: string; + assignedTo: string; + dataWorkspaceId: string; + description: string; + dueDate: Date; + loi: Geometry; + jobId: number; + name: string; + assignedType: string; + parentJobId: number; + parentVersion: string; + percent: number; + priority: number; + startDate: Date; + status: number; + versionName: string; + user: string; + } + + export interface JobVersionInfo { + dataWorkspaceId: string; + name: string; + parent: string; + created: boolean; + owner: string; + } + + export interface QueryFieldInfo { + alias: string; + length: string; + name: string; + type: string; + } + + export interface QueryResult { + fields: QueryFieldInfo[]; + rows: string[]; + } + interface NotificationTask extends Task { url: string; - addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; - deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; - getAllChangeRules(requestOptions?: any): IPromise; - getChangeRule(ruleId: string, requestOptions?: any): IPromise; - getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; - getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; - getSessionMatches(sessionId: string, requestOptions?: any): IPromise; - notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; - queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; - runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; - sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; - subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; - unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; + addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; + deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; + getAllChangeRules(requestOptions?: any): IPromise; + getChangeRule(ruleId: string, requestOptions?: any): IPromise; + getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; + getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; + getSessionMatches(sessionId: string, requestOptions?: any): IPromise; + notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; + queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; + runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; + subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; } interface NotificationTaskConstructor { @@ -7248,14 +7797,135 @@ declare namespace __esri { url?: string; } + export interface AOIEvaluator { + aoi: Polygon; + inverse: boolean; + name: string; + relation: string; + type: string; + useJobAOI: boolean; + } + + export interface ChangeRule { + description: string; + evaluators: any[]; + id: number; + name: string; + notifier: any; + summarize: boolean; + } + + export interface ChangeRuleMatch { + changeTime: Date; + changeType: string; + dataset: string; + dataWorkspaceId: string; + id: string; + jobID: string; + ruleID: string; + } + + export interface DatasetConfiguration { + changeCondition: number; + changeFields: string; + dataset: string; + dataWorkspaceId: string; + name: string; + whereConditions: WhereCondition[]; + } + + export interface DataSetEvaluator { + dataSetConfigurations: DatasetConfiguration[]; + name: string; + type: string; + } + + export interface EmailNotifier { + attachJobAttachments: boolean; + message: string; + name: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface NotificationTaskAddChangeRuleParams { + rule: ChangeRule; + user: string; + } + + export interface NotificationTaskDeleteChangeRuleParams { + ruleId: string; + user: string; + } + + export interface NotificationTaskNotifySessionParams { + sessionid: string; + deleteAfter: boolean; + user: string; + } + + export interface NotificationTaskQueryChangeRulesParams { + name: string; + description: string; + searchType: string; + user: string; + } + + export interface NotificationTaskRunSpatialNotificationOnHistoryParams { + dataWorkspaceId: string; + from: Date; + to: Date; + logMatches: boolean; + send: boolean; + user: string; + } + + export interface NotificationTaskSendNotificationParams { + jobId: number; + notificationType: string; + user: string; + } + + export interface NotificationTaskSubscribeToNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface NotificationTaskUnsubscribeFromNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface NotificationType { + attachJobAttachments: boolean; + id: number; + message: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface WhereCondition { + compareValue: any; + field: string; + operator: string; + } + interface ReportTask extends Task { url: string; - generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; - getAllReports(requestOptions?: any): IPromise; + generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; + getAllReports(requestOptions?: any): IPromise; getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; - getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; - getReportStylesheet(reportId: number, requestOptions?: any): IPromise; + getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; + getReportStylesheet(reportId: number, requestOptions?: any): IPromise; } interface ReportTaskConstructor { @@ -7268,8 +7938,45 @@ declare namespace __esri { url?: string; } + export interface Report { + description: string; + hierarchy: string; + id: number; + name: string; + title: string; + } + + export interface ReportData { + columns: string[]; + description: string; + groups: ReportDataGroup[]; + title: string; + } + + export interface ReportDataGroup { + aggregateLabel: string; + aggregateValue: string; + row: string[]; + value: string; + } + + export interface ReportTaskGenerateReportParams { + reportId: number; + user: string; + } + + export interface ReportTaskGetReportContentUrlParams { + reportId: number; + user: number; + } + + export interface ReportTaskGetReportDataParams { + reportId: number; + user: string; + } + interface TokenTask extends Task { - parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; + parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; } interface TokenTaskConstructor { @@ -7282,23 +7989,29 @@ declare namespace __esri { } + export interface TokenTaskParseTokensParams { + jobId: any; + stringToParse: string; + user: string; + } + interface WorkflowTask extends Task { url: string; - canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; - executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; - getAllSteps(jobId: number, requestOptions?: any): IPromise; - getCurrentSteps(jobId: number, requestOptions?: any): IPromise; - getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; - getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; + canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; + executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; + getAllSteps(jobId: number, requestOptions?: any): IPromise; + getCurrentSteps(jobId: number, requestOptions?: any): IPromise; + getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; + getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; - getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; + getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; getWorkflowImageUrl(jobId: number): string; - markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; - moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; - recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; - resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; - setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; + markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; + moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; + recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; + resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; + setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; } interface WorkflowTaskConstructor { @@ -7311,19 +8024,641 @@ declare namespace __esri { url?: string; } - interface MapView extends View { + export interface ExecuteInfo { + conflicts: WorkflowConflicts; + errorCode: number; + errorDescription: string; + executionResult: string; + hasConflicts: boolean; + hasReturnCode: boolean; + jobID: number; + returnCode: number; + stepID: number; + threwError: boolean; + } + + export interface Step { + hasBeenExecuted: boolean; + assignedTo: string; + async: boolean; + autoRun: boolean; + canSkip: boolean; + canSpawnConcurrency: boolean; + commonId: number; + defaultPercentComplete: number; + assignedType: string; + hasBeenStarted: boolean; + id: number; + name: string; + selfCheck: boolean; + statusId: number; + stepPercentComplete: number; + notificationType: string; + stepType: StepType; + } + + export interface StepType { + program: string; + arguments: string; + executionType: string; + id: number; + name: string; + description: string; + stepDescriptionLink: string; + stepDescriptionType: string; + stepIndicatorType: string; + supportedPlatform: string; + visible: boolean; + } + + export interface WorkflowAnnotationDisplayDetails { + centerX: number; + centerY: number; + fillColor: Color; + height: number; + label: string; + labelColor: Color; + OutlineColor: Color; + width: number; + } + + export interface WorkflowConflicts { + jobID: number; + options: WorkflowOption[]; + spawnsConcurrency: boolean; + stepId: number; + } + + export interface WorkflowDisplayDetails { + annotations: WorkflowAnnotationDisplayDetails[]; + paths: WorkflowPathDisplayDetails[]; + steps: WorkflowStepDisplayDetails[]; + } + + export interface WorkflowOption { + returnCode: number; + steps: WorkflowStepInfo[]; + } + + export interface WorkflowPathDisplayDetails { + destStepId: number; + sourceStepID: number; + label: string; + labelColor: Color; + labelX: number; + labelY: number; + lineColor: Color; + pathObject: any; + } + + export interface WorkflowStepDisplayDetails { + labelColor: Color; + centerX: number; + fillColor: Color; + height: number; + label: string; + centerY: number; + OutlineColor: Color; + shape: string; + stepId: number; + stepType: string; + width: number; + } + + export interface WorkflowStepInfo { + id: number; + name: string; + } + + export interface WorkflowTaskCanRunStepParams { + jobId: number; + stepId: number; + user: string; + } + + export interface WorkflowTaskExecuteStepsParams { + jobId: number; + stepIds: number[]; + auto: boolean; + user: string; + } + + export interface WorkflowTaskGetStepDescriptionParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepFileUrlParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskMarkStepsAsDoneParams { + jobId: number; + stepIds: number[]; + user: string; + } + + export interface WorkflowTaskMoveToNextStepParams { + jobId: number; + stepId: number; + returnCode: number; + user: string; + } + + export interface WorkflowTaskRecreateWorkflowParams { + jobId: number; + user: string; + } + + export interface WorkflowTaskResolveConflictParams { + jobId: number; + stepId: number; + optionReturnCode: number; + optionStepIds: number[]; + user: string; + } + + export interface WorkflowTaskSetCurrentStepParams { + jobId: number; + stepId: number; + user: string; + } + + interface Viewpoint extends Accessor, JSONSupport { + camera: Camera; + rotation: number; + scale: number; + targetGeometry: Geometry; + + clone(): Viewpoint; + } + + interface ViewpointConstructor { + new(properties?: ViewpointProperties): Viewpoint; + + fromJSON(json: any): Viewpoint; + } + + export const Viewpoint: ViewpointConstructor; + + interface ViewpointProperties { + camera?: CameraProperties; + rotation?: number; + scale?: number; + targetGeometry?: GeometryProperties; + } + + interface Draw extends Accessor { + activeAction: PointDrawAction | PolygonDrawAction | PolylineDrawAction; + view: MapView; + + create(drawAction: string): PointDrawAction | PolygonDrawAction | PolylineDrawAction; + } + + interface DrawConstructor { + new(properties?: DrawProperties): Draw; + } + + export const Draw: DrawConstructor; + + interface DrawProperties { + activeAction?: PointDrawActionProperties | PolygonDrawActionProperties | PolylineDrawActionProperties; + view?: MapViewProperties; + } + + interface PointDrawAction extends Accessor, Evented { + view: MapView; + + complete(): void; + + on(name: "cursor-update", eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; + } + + interface PointDrawActionConstructor { + new(properties?: PointDrawActionProperties): PointDrawAction; + } + + export const PointDrawAction: PointDrawActionConstructor; + + interface PointDrawActionProperties { + view?: MapViewProperties; + } + + export interface PointDrawActionCursorUpdateEvent { + coordinates: number[]; + defaultPrevented: boolean; + preventDefault: Function; + type: string; + } + + export interface PointDrawActionDrawCompleteEvent { + coordinates: number[]; + defaultPrevented: boolean; + preventDefault: Function; + type: string; + } + + interface PolygonDrawAction extends Accessor, Evented { + vertices: number[][]; + view: MapView; + + canRedo(): boolean; + canUndo(): boolean; + complete(): void; + redo(): void; + undo(): void; + + on(name: "cursor-update", eventHandler: PolygonDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PolygonDrawActionCursorUpdateEventHandler): IHandle; + on(name: "vertex-add", eventHandler: PolygonDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-add", modifiers: string[], eventHandler: PolygonDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-remove", eventHandler: PolygonDrawActionVertexRemoveEventHandler): IHandle; + on(name: "vertex-remove", modifiers: string[], eventHandler: PolygonDrawActionVertexRemoveEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PolygonDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PolygonDrawActionDrawCompleteEventHandler): IHandle; + } + + interface PolygonDrawActionConstructor { + new(properties?: PolygonDrawActionProperties): PolygonDrawAction; + } + + export const PolygonDrawAction: PolygonDrawActionConstructor; + + interface PolygonDrawActionProperties { + vertices?: number[][]; + view?: MapViewProperties; + } + + export interface PolygonDrawActionCursorUpdateEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; + } + + export interface PolygonDrawActionDrawCompleteEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertices: number[][]; + } + + export interface PolygonDrawActionVertexAddEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; + } + + export interface PolygonDrawActionVertexRemoveEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; + } + + interface PolylineDrawAction extends Accessor, Evented { + vertices: number[][]; + view: MapView; + + canRedo(): boolean; + canUndo(): boolean; + complete(): void; + redo(): void; + undo(): void; + + on(name: "cursor-update", eventHandler: PolylineDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PolylineDrawActionCursorUpdateEventHandler): IHandle; + on(name: "vertex-add", eventHandler: PolylineDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-add", modifiers: string[], eventHandler: PolylineDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-remove", eventHandler: PolylineDrawActionVertexRemoveEventHandler): IHandle; + on(name: "vertex-remove", modifiers: string[], eventHandler: PolylineDrawActionVertexRemoveEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PolylineDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PolylineDrawActionDrawCompleteEventHandler): IHandle; + } + + interface PolylineDrawActionConstructor { + new(properties?: PolylineDrawActionProperties): PolylineDrawAction; + } + + export const PolylineDrawAction: PolylineDrawActionConstructor; + + interface PolylineDrawActionProperties { + vertices?: number[][]; + view?: MapViewProperties; + } + + export interface PolylineDrawActionCursorUpdateEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; + } + + export interface PolylineDrawActionDrawCompleteEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertices: number[][]; + } + + export interface PolylineDrawActionVertexAddEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; + } + + export interface PolylineDrawActionVertexRemoveEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; + } + + interface externalRenderers { + add(view: SceneView, renderer: ExternalRenderer): void; + fromRenderCoordinates(view: SceneView, srcCoordinates: number[] | any, srcStart: number, destCoordinates: number[] | any, destStart: number, destSpatialReference: SpatialReference, count: number): number[] | any; + remove(view: SceneView, renderer: ExternalRenderer): void; + renderCoordinateTransformAt(view: SceneView, origin: number[] | any, srcSpatialReference?: SpatialReference, dest?: number[] | any): number[] | any; + requestRender(view: SceneView): void; + toRenderCoordinates(view: SceneView, srcCoordinates: number[] | any, srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[] | any, destStart: number, count: number): number[] | any; + } + + export const externalRenderers: externalRenderers; + + export interface ColorAndIntensity { + color: any; + intensity: number; + } + + export interface ExternalRenderer { + setup(): void; + render(): void; + dispose(): void; + } + + export interface RenderCamera { + viewMatrix: any; + viewInverseTransposeMatrix: any; + projectionMatrix: any; + eye: any; + center: any; + up: any; + near: number; + far: number; + fovX: number; + fovY: number; + } + + export interface RenderContext { + gl: any; + camera: RenderCamera; + sunLight: SunLight; + + resetWebGLState(): void; + bindRenderTarget(): void; + } + + export interface SunLight { + direction: any; + diffuse: ColorAndIntensity; + ambient: ColorAndIntensity; + } + + interface BreakpointsOwner { + breakpoints: BreakpointsOwnerBreakpoints; + heightBreakpoint: string; + orientation: string; + widthBreakpoint: string; + } + + interface BreakpointsOwnerConstructor { + new(): BreakpointsOwner; + } + + export const BreakpointsOwner: BreakpointsOwnerConstructor; + + interface BreakpointsOwnerProperties { + breakpoints?: BreakpointsOwnerBreakpoints; + heightBreakpoint?: string; + orientation?: string; + widthBreakpoint?: string; + } + + export interface BreakpointsOwnerBreakpoints { + xsmall: number; + small: number; + medium: number; + large: number; + } + + interface DOMContainer { + container: HTMLDivElement | string; + height: number; + popup: Popup; + resizing: boolean; + size: number[]; + suspended: boolean; + ui: DefaultUI; + width: number; + } + + interface DOMContainerConstructor { + new(): DOMContainer; + } + + export const DOMContainer: DOMContainerConstructor; + + interface DOMContainerProperties { + container?: HTMLDivElement | string; + height?: number; + popup?: PopupProperties; + resizing?: boolean; + size?: number[]; + suspended?: boolean; + ui?: DefaultUIProperties; + width?: number; + } + + interface CSVLayerView extends LayerView { + highlight(target?: Graphic | Graphic[]): any; + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + } + + interface CSVLayerViewConstructor { + new(properties?: CSVLayerViewProperties): CSVLayerView; + } + + export const CSVLayerView: CSVLayerViewConstructor; + + interface CSVLayerViewProperties extends LayerViewProperties { + + } + + interface FeatureLayerView extends LayerView { + highlight(target?: Graphic | Graphic[] | number | number[]): any; + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + } + + interface FeatureLayerViewConstructor { + new(properties?: FeatureLayerViewProperties): FeatureLayerView; + } + + export const FeatureLayerView: FeatureLayerViewConstructor; + + interface FeatureLayerViewProperties extends LayerViewProperties { + + } + + interface GraphicsLayerView extends LayerView { + highlight(target?: Graphic | Graphic[] | number | number[]): any; + queryGraphics(): IPromise; + } + + interface GraphicsLayerViewConstructor { + new(properties?: GraphicsLayerViewProperties): GraphicsLayerView; + } + + export const GraphicsLayerView: GraphicsLayerViewConstructor; + + interface GraphicsLayerViewProperties extends LayerViewProperties { + + } + + interface ImageryLayerView extends LayerView { + pixelData: ImageryLayerViewPixelData; + } + + interface ImageryLayerViewConstructor { + new(properties?: ImageryLayerViewProperties): ImageryLayerView; + } + + export const ImageryLayerView: ImageryLayerViewConstructor; + + interface ImageryLayerViewProperties extends LayerViewProperties { + pixelData?: ImageryLayerViewPixelData; + } + + export interface ImageryLayerViewPixelData { + extent?: Extent; + pixelBlock: PixelBlock; + } + + interface LayerView extends Accessor, corePromise { + layer: Layer; + suspended: boolean; + updating: boolean; + visible: boolean; + } + + interface LayerViewConstructor { + new(properties?: LayerViewProperties): LayerView; + } + + export const LayerView: LayerViewConstructor; + + interface LayerViewProperties { + layer?: LayerProperties; + suspended?: boolean; + updating?: boolean; + visible?: boolean; + } + + interface SceneLayerView extends LayerView { + highlight(target?: Graphic | Graphic[] | number | number[]): any; + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + } + + interface SceneLayerViewConstructor { + new(properties?: SceneLayerViewProperties): SceneLayerView; + } + + export const SceneLayerView: SceneLayerViewConstructor; + + interface SceneLayerViewProperties extends LayerViewProperties { + + } + + interface StreamLayerView extends LayerView, Evented { + connectionError: Error; + connectionStatus: string; + filter: StreamLayerViewFilter; + graphics: Collection; + + connect(): IPromise; + disconnect(): void; + updateFilter(filter: StreamLayerViewUpdateFilterFilter): IPromise; + + on(name: "data-received", eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; + on(name: "data-received", modifiers: string[], eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; + } + + interface StreamLayerViewConstructor { + new(properties?: StreamLayerViewProperties): StreamLayerView; + } + + export const StreamLayerView: StreamLayerViewConstructor; + + interface StreamLayerViewProperties extends LayerViewProperties { + connectionError?: Error; + connectionStatus?: string; + filter?: StreamLayerViewFilter; + graphics?: CollectionProperties; + } + + export interface StreamLayerViewDataReceivedEvent { + } + + export interface StreamLayerViewFilter { + geometry?: Extent; + where?: string; + } + + export interface StreamLayerViewUpdateFilterFilter { + geometry?: Extent; + where?: string; + } + + interface MapView extends View, BreakpointsOwner { center: Point; constraints: MapViewConstraints; extent: Extent; + highlightOptions: MapViewHighlightOptions; resizeAlign: string; rotation: number; scale: number; viewpoint: Viewpoint; zoom: number; - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | any, options?: MapViewGoToOptions): IPromise; + focus(): void; + goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | MapViewGoToTarget, options?: MapViewGoToOptions): IPromise; hasEventListener(type: string): boolean; - hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; + hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; toMap(screenPoint: MapViewToMapScreenPoint): Point; toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; @@ -7362,10 +8697,11 @@ declare namespace __esri { export const MapView: MapViewConstructor; - interface MapViewProperties extends ViewProperties { + interface MapViewProperties extends ViewProperties, BreakpointsOwnerProperties { center?: PointProperties; constraints?: MapViewConstraints; extent?: ExtentProperties; + highlightOptions?: MapViewHighlightOptions; resizeAlign?: string; rotation?: number; scale?: number; @@ -7373,7 +8709,185 @@ declare namespace __esri { zoom?: number; } - interface SceneView extends View { + export interface MapViewClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewDoubleClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewDragEvent { + action: string; + native: any; + origin: MapViewDragEventOrigin; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface HitTestResult { + results: HitTestResultResults[]; + } + + export interface MapViewHoldEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewKeyDownEvent { + key: string; + native: any; + repeat: boolean; + stopPropagation: Function; + timestamp: number; + type: string; + } + + export interface MapViewKeyUpEvent { + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + } + + export interface MapViewLayerviewCreateEvent { + layer: Layer; + layerView: LayerView; + } + + export interface MapViewLayerviewDestroyEvent { + layer: Layer; + layerView: LayerView; + } + + export interface MapViewConstraints { + lods?: LOD[]; + minScale?: number; + maxScale?: number; + minZoom?: number; + maxZoom?: number; + snapToZoom?: boolean; + rotationEnabled?: boolean; + effectiveLODs?: LOD[]; + effectiveMinZoom?: number; + effectiveMaxZoom?: number; + effectiveMinScale?: number; + effectiveMaxScale?: number; + } + + export interface MapViewGoToOptions { + animate?: boolean; + duration?: number; + easing?: string | Function; + } + + export interface MapViewGoToTarget { + target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint; + center?: number[]; + scale?: number; + zoom?: number; + } + + export interface MapViewHighlightOptions { + color?: Color; + haloOpacity?: number; + fillOpacity?: number; + } + + export interface MapViewHitTestScreenPoint { + x: number; + y: number; + } + + export interface MapViewToMapScreenPoint { + x: number; + y: number; + } + + export interface MapViewMouseWheelEvent { + deltaY: number; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewPointerDownEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewPointerMoveEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewPointerUpEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface MapViewResizeEvent { + height: number; + oldHeight: number; + oldWidth: number; + width: number; + } + + export interface MapViewDragEventOrigin { + x: number; + y: number; + } + + export interface HitTestResultResults { + graphic: Graphic; + mapPoint: Point; + } + + interface SceneView extends View, BreakpointsOwner { camera: Camera; center: Point; clippingArea: Extent; @@ -7387,9 +8901,10 @@ declare namespace __esri { viewpoint: Viewpoint; zoom: number; - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | any, options?: SceneViewGoToOptions): IPromise; + focus(): void; + goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | SceneViewGoToTarget, options?: SceneViewGoToOptions): IPromise; hasEventListener(type: string): boolean; - hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; + hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; toMap(screenPoint: SceneViewToMapScreenPoint, mapPoint?: Point): Point; toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; @@ -7428,7 +8943,7 @@ declare namespace __esri { export const SceneView: SceneViewConstructor; - interface SceneViewProperties extends ViewProperties { + interface SceneViewProperties extends ViewProperties, BreakpointsOwnerProperties { camera?: CameraProperties; center?: PointProperties; clippingArea?: ExtentProperties; @@ -7443,12 +8958,318 @@ declare namespace __esri { zoom?: number; } - interface View extends Accessor, corePromise, BreakpointsOwner, DOMContainer { - allLayerViews: Collection; + export interface SceneViewClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewDoubleClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewDragEvent { + action: string; + native: any; + origin: SceneViewDragEventOrigin; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export type EasingFunction = (t: number, duration: number) => number; + + export interface SceneViewHitTestResult { + results: SceneViewHitTestResultResults[]; + } + + export interface SceneViewHoldEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewKeyDownEvent { + key: string; + native: any; + repeat: boolean; + stopPropagation: Function; + timestamp: number; + type: string; + } + + export interface SceneViewKeyUpEvent { + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + } + + export interface SceneViewLayerviewCreateEvent { + layer: Layer; + layerView: LayerView; + } + + export interface SceneViewLayerviewDestroyEvent { + layer: Layer; + layerView: LayerView; + } + + export interface SceneViewMouseWheelEvent { + deltaY: number; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewPointerDownEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewPointerMoveEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewPointerUpEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; + } + + export interface SceneViewResizeEvent { + height: number; + oldHeight: number; + oldWidth: number; + width: number; + } + + export interface SceneViewConstraintsProperties { + altitude?: SceneViewConstraintsAltitudeProperties; + clipDistance?: SceneViewConstraintsClipDistanceProperties; + collision?: SceneViewConstraintsCollision; + tilt?: SceneViewConstraintsTiltProperties; + } + export interface SceneViewConstraints extends Accessor { + altitude?: SceneViewConstraintsAltitude; + clipDistance?: SceneViewConstraintsClipDistance; + collision?: SceneViewConstraintsCollision; + tilt?: SceneViewConstraintsTilt; + } + + export interface SceneViewConstraintsAltitudeProperties { + min?: number; + max?: number; + } + export interface SceneViewConstraintsAltitude extends Accessor { + min?: number; + max?: number; + } + + export interface SceneViewConstraintsClipDistanceProperties { + near?: number; + far?: number; + mode?: string; + } + export interface SceneViewConstraintsClipDistance extends Accessor { + near?: number; + far?: number; + mode?: string; + } + + export interface SceneViewConstraintsCollision { + enabled?: boolean; + } + + export interface SceneViewConstraintsTiltProperties { + max?: number; + mode?: string; + } + export interface SceneViewConstraintsTilt extends Accessor { + max?: number; + mode?: string; + } + + export interface SceneViewEnvironmentProperties { + lighting?: SceneViewEnvironmentLightingProperties; + atmosphereEnabled?: boolean; + atmosphere?: SceneViewEnvironmentAtmosphereProperties; + starsEnabled?: boolean; + } + export interface SceneViewEnvironment extends Accessor { + lighting?: SceneViewEnvironmentLighting; + atmosphereEnabled?: boolean; + atmosphere?: SceneViewEnvironmentAtmosphere; + starsEnabled?: boolean; + } + + export interface SceneViewEnvironmentAtmosphereProperties { + quality?: string; + } + export interface SceneViewEnvironmentAtmosphere extends Accessor { + quality?: string; + } + + export interface SceneViewEnvironmentLightingProperties { + date?: DateProperties; + directShadowsEnabled?: boolean; + ambientOcclusionEnabled?: boolean; + cameraTrackingEnabled?: boolean; + } + export interface SceneViewEnvironmentLighting extends Accessor { + date?: Date; + directShadowsEnabled?: boolean; + ambientOcclusionEnabled?: boolean; + cameraTrackingEnabled?: boolean; + } + + export interface SceneViewGoToOptions { + animate?: boolean; + speedFactor?: number; + duration?: number; + maxDuration?: number; + easing?: string | EasingFunction; + } + + export interface SceneViewGoToTarget { + target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera; + center?: number[]; + scale?: number; + zoom?: number; + heading?: number; + tilt?: number; + position?: number; + } + + export interface SceneViewHighlightOptions { + color?: Color; + haloOpacity?: number; + fillOpacity?: number; + } + + export interface SceneViewHitTestScreenPoint { + x: number; + y: number; + } + + export interface SceneViewToMapScreenPoint { + x: number; + y: number; + } + + export interface SceneViewDragEventOrigin { + x: number; + y: number; + } + + export interface SceneViewHitTestResultResults { + graphic: Graphic; + mapPoint: Point; + } + + interface DefaultUI extends UI { + components: string[]; + } + + interface DefaultUIConstructor { + new(properties?: DefaultUIProperties): DefaultUI; + } + + export const DefaultUI: DefaultUIConstructor; + + interface DefaultUIProperties extends UIProperties { + components?: string[]; + } + + interface UI extends Accessor { + container: HTMLElement; + height: number; + padding: any | number; + view: MapView | SceneView; + width: number; + + add(component: Widget | HTMLElement | string | any[] | UIAddComponent, position?: string | UIAddPosition): void; + empty(position?: string): void; + move(component: Widget | HTMLElement | string | any[] | UIMoveComponent, position?: string): void; + remove(component: Widget | HTMLElement | string | any[]): void; + } + + interface UIConstructor { + new(properties?: UIProperties): UI; + } + + export const UI: UIConstructor; + + interface UIProperties { + container?: HTMLElement; + height?: number; + padding?: any | number; + view?: MapViewProperties | SceneViewProperties; + width?: number; + } + + export interface UIAddComponent { + component: Widget | HTMLElement | string; + position?: string; + index?: number; + } + + export interface UIAddPosition { + position?: string; + index: number; + } + + export interface UIMoveComponent { + component: Widget | HTMLElement | string; + position?: string; + } + + interface View extends Accessor, corePromise, DOMContainer { + allLayerViews: Collection; animation: ViewAnimation; - graphics: Collection; + graphics: Collection; interacting: boolean; - layerViews: Collection; + layerViews: Collection; map: Map; padding: ViewPadding; ready: boolean; @@ -7457,7 +9278,7 @@ declare namespace __esri { type: string; updating: boolean; - whenLayerView(layer: Layer): IPromise; + whenLayerView(layer: Layer): IPromise; } interface ViewConstructor { @@ -7466,12 +9287,12 @@ declare namespace __esri { export const View: ViewConstructor; - interface ViewProperties extends BreakpointsOwnerProperties, DOMContainerProperties { - allLayerViews?: Collection | any[]; + interface ViewProperties extends DOMContainerProperties { + allLayerViews?: CollectionProperties; animation?: ViewAnimationProperties; - graphics?: Collection | any[]; + graphics?: CollectionProperties; interacting?: boolean; - layerViews?: Collection | any[]; + layerViews?: CollectionProperties; map?: MapProperties; padding?: ViewPadding; ready?: boolean; @@ -7481,6 +9302,13 @@ declare namespace __esri { updating?: boolean; } + export interface ViewPadding { + left?: number; + top?: number; + right?: number; + bottom?: number; + } + interface ViewAnimation extends Accessor, corePromise { state: string; target: Viewpoint; @@ -7500,182 +9328,47 @@ declare namespace __esri { target?: ViewpointProperties; } - interface LayerView extends Accessor, corePromise { - layer: Layer; - suspended: boolean; - updating: boolean; - visible: boolean; + interface WebMap extends Map, corePromise { + applicationProperties: any; + bookmarks: any[]; + initialViewProperties: InitialViewProperties; + loaded: boolean; + loadError: Error; + loadStatus: string; + portalItem: PortalItem; + presentation: any; + sourceVersion: WebMapSourceVersion; + tables: any[]; + widgets: any; + + load(): IPromise; } - interface LayerViewConstructor { - new(properties?: LayerViewProperties): LayerView; + interface WebMapConstructor { + new(properties?: WebMapProperties): WebMap; } - export const LayerView: LayerViewConstructor; + export const WebMap: WebMapConstructor; - interface LayerViewProperties { - layer?: LayerProperties; - suspended?: boolean; - updating?: boolean; - visible?: boolean; - } - - interface CSVLayerView extends LayerView { - highlight(target?: Graphic | Graphic[]): any; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - } - - interface CSVLayerViewConstructor { - new(properties?: CSVLayerViewProperties): CSVLayerView; - } - - export const CSVLayerView: CSVLayerViewConstructor; - - interface CSVLayerViewProperties extends LayerViewProperties { - - } - - interface FeatureLayerView extends LayerView { - highlight(target?: Graphic | Graphic[] | number | number[]): any; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - } - - interface FeatureLayerViewConstructor { - new(properties?: FeatureLayerViewProperties): FeatureLayerView; - } - - export const FeatureLayerView: FeatureLayerViewConstructor; - - interface FeatureLayerViewProperties extends LayerViewProperties { - - } - - interface GraphicsLayerView extends LayerView { - highlight(target?: Graphic | Graphic[] | number | number[]): any; - queryGraphics(): IPromise; - } - - interface GraphicsLayerViewConstructor { - new(properties?: GraphicsLayerViewProperties): GraphicsLayerView; - } - - export const GraphicsLayerView: GraphicsLayerViewConstructor; - - interface GraphicsLayerViewProperties extends LayerViewProperties { - - } - - interface ImageryLayerView extends LayerView { - pixelData: ImageryLayerViewPixelData; - } - - interface ImageryLayerViewConstructor { - new(properties?: ImageryLayerViewProperties): ImageryLayerView; - } - - export const ImageryLayerView: ImageryLayerViewConstructor; - - interface ImageryLayerViewProperties extends LayerViewProperties { - pixelData?: ImageryLayerViewPixelData; - } - - interface SceneLayerView extends LayerView { - highlight(target?: Graphic | Graphic[] | number | number[]): any; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; - } - - interface SceneLayerViewConstructor { - new(properties?: SceneLayerViewProperties): SceneLayerView; - } - - export const SceneLayerView: SceneLayerViewConstructor; - - interface SceneLayerViewProperties extends LayerViewProperties { - - } - - interface StreamLayerView extends Accessor, Evented { - connectionError: Error; - connectionStatus: string; - filter: StreamLayerViewFilter; - graphics: Collection; - - connect(): IPromise; - disconnect(): void; - updateFilter(filter: StreamLayerViewUpdateFilterFilter): IPromise; - - on(name: "data-received", eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; - on(name: "data-received", modifiers: string[], eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; - } - - interface StreamLayerViewConstructor { - new(properties?: StreamLayerViewProperties): StreamLayerView; - } - - export const StreamLayerView: StreamLayerViewConstructor; - - interface StreamLayerViewProperties { - connectionError?: Error; - connectionStatus?: string; - filter?: StreamLayerViewFilter; - graphics?: Collection | any[]; - } - - interface UI extends Accessor { - container: any; - height: number; - padding: any; - view: MapView | SceneView; - width: number; - - add(component: Widget | any | string | any | any, position?: string | any): void; - empty(position?: string): void; - move(component: Widget | any | string | any | any, position?: string): void; - remove(component: any | any[]): void; - } - - interface UIConstructor { - new(properties?: UIProperties): UI; - } - - export const UI: UIConstructor; - - interface UIProperties { - container?: any; - height?: number; - padding?: any | number; - view?: MapView | SceneView; - width?: number; - } - - interface DefaultUI extends UI { - components: string[]; - } - - interface DefaultUIConstructor { - new(properties?: DefaultUIProperties): DefaultUI; - } - - export const DefaultUI: DefaultUIConstructor; - - interface DefaultUIProperties extends UIProperties { - components?: string[]; + interface WebMapProperties extends MapProperties { + applicationProperties?: any; + bookmarks?: any[]; + initialViewProperties?: InitialViewPropertiesProperties; + loaded?: boolean; + loadError?: Error; + loadStatus?: string; + portalItem?: PortalItemProperties; + presentation?: any; + sourceVersion?: WebMapSourceVersion; + tables?: any[]; + widgets?: any; } interface InitialViewProperties extends Accessor, corePromise { spatialReference: SpatialReference; viewpoint: Viewpoint; - clone(): this; + clone(): InitialViewProperties; } interface InitialViewPropertiesConstructor { @@ -7689,10 +9382,56 @@ declare namespace __esri { viewpoint?: ViewpointProperties; } + export interface WebMapSourceVersion { + major: number; + minor: number; + } + + interface WebScene extends Map, corePromise { + clippingArea: Extent; + clippingEnabled: boolean; + heightModelInfo: HeightModelInfo; + initialViewProperties: websceneInitialViewProperties; + loaded: boolean; + loadError: Error; + loadStatus: string; + portalItem: PortalItem; + presentation: Presentation; + sourceVersion: WebSceneSourceVersion; + + load(): IPromise; + save(options?: WebSceneSaveOptions): IPromise; + saveAs(portalItem: PortalItem, options?: WebSceneSaveAsOptions): IPromise; + toJSON(): any; + updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): void; + } + + interface WebSceneConstructor { + new(properties?: WebSceneProperties): WebScene; + + + fromJSON(json: any): any; + } + + export const WebScene: WebSceneConstructor; + + interface WebSceneProperties extends MapProperties { + clippingArea?: ExtentProperties; + clippingEnabled?: boolean; + heightModelInfo?: HeightModelInfoProperties; + initialViewProperties?: websceneInitialViewPropertiesProperties; + loaded?: boolean; + loadError?: Error; + loadStatus?: string; + portalItem?: PortalItemProperties; + presentation?: PresentationProperties; + sourceVersion?: WebSceneSourceVersion; + } + interface Environment extends Accessor { lighting: Lighting; - clone(): this; + clone(): Environment; } interface EnvironmentConstructor { @@ -7711,7 +9450,7 @@ declare namespace __esri { viewingMode: string; viewpoint: Viewpoint; - clone(): this; + clone(): websceneInitialViewProperties; } interface websceneInitialViewPropertiesConstructor { @@ -7732,7 +9471,7 @@ declare namespace __esri { directShadowsEnabled: boolean; displayUTCOffset: number; - clone(): this; + clone(): Lighting; } interface LightingConstructor { @@ -7742,15 +9481,15 @@ declare namespace __esri { export const Lighting: LightingConstructor; interface LightingProperties { - date?: Date; + date?: DateProperties; directShadowsEnabled?: boolean; displayUTCOffset?: number; } interface Presentation extends Accessor { - slides: Collection; + slides: Collection; - clone(): this; + clone(): Presentation; } interface PresentationConstructor { @@ -7760,42 +9499,119 @@ declare namespace __esri { export const Presentation: PresentationConstructor; interface PresentationProperties { - slides?: Collection | any[]; + slides?: CollectionProperties; } interface Slide extends Accessor { - basemap: Basemap; + basemap: Basemap | string; description: SlideDescription; environment: Environment; id: string; thumbnail: SlideThumbnail; title: SlideTitle; viewpoint: Viewpoint; - visibleLayers: SlideVisibleLayers; + visibleLayers: Collection; - applyTo(view: SceneView, options?: SlideApplyToOptions): IPromise; - clone(): this; - updateFrom(view: SceneView, options?: SlideUpdateFromOptions): IPromise; + applyTo(view: SceneView, options?: SlideApplyToOptions): IPromise; + clone(): Slide; + updateFrom(view: SceneView, options?: SlideUpdateFromOptions): IPromise; } interface SlideConstructor { new(properties?: SlideProperties): Slide; - createFrom(view: SceneView, options?: SlideCreateFromOptions): IPromise; + createFrom(view: SceneView, options?: SlideCreateFromOptions): IPromise; } export const Slide: SlideConstructor; interface SlideProperties { - basemap?: Basemap | string; + basemap?: BasemapProperties | string; description?: SlideDescriptionProperties; environment?: EnvironmentProperties; id?: string; thumbnail?: SlideThumbnailProperties; title?: SlideTitleProperties; viewpoint?: ViewpointProperties; - visibleLayers?: SlideVisibleLayers; + visibleLayers?: CollectionProperties; + } + + export interface SlideApplyToOptions { + animate: boolean; + speedFactor?: number; + duration?: number; + maxDuration?: number; + easing?: string | EasingFunction; + } + + export interface SlideCreateFromOptions { + screenshot: SlideCreateFromOptionsScreenshot; + } + + export interface SlideCreateFromOptionsScreenshot { + format: string; + quality: number; + width: number; + height: number; + } + + export interface SlideDescriptionProperties { + text?: string; + } + export interface SlideDescription extends Accessor { + text?: string; + } + + export interface SlideThumbnailProperties { + url?: string; + } + export interface SlideThumbnail extends Accessor { + url?: string; + } + + export interface SlideTitleProperties { + text?: string; + } + export interface SlideTitle extends Accessor { + text?: string; + } + + export interface SlideUpdateFromOptions { + screenshot: SlideUpdateFromOptionsScreenshot; + } + + export interface SlideUpdateFromOptionsScreenshot { + format: string; + quality: number; + width: number; + height: number; + } + + export interface SlideVisibleLayersProperties { + id?: string; + } + export interface SlideVisibleLayers extends Accessor { + id: string; + } + + export interface WebSceneSaveAsOptions { + folder?: PortalFolder; + ignoreUnsupported?: boolean; + } + + export interface WebSceneSaveOptions { + ignoreUnsupported?: boolean; + } + + export interface WebSceneSourceVersion { + major: number; + minor: number; + } + + export interface WebSceneUpdateFromOptions { + environmentExcluded?: boolean; + viewpointExcluded?: boolean; } interface Attribution extends Widget { @@ -7812,10 +9628,23 @@ declare namespace __esri { export const Attribution: AttributionConstructor; interface AttributionProperties extends WidgetProperties { - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: AttributionViewModel; } + interface AttributionViewModel { + attributionText: string; + itemDelimiter: string; + state: string; + view: MapView | SceneView; + } + + interface AttributionViewModelConstructor { + new(properties?: any): AttributionViewModel; + } + + export const AttributionViewModel: AttributionViewModelConstructor; + interface BasemapGallery extends Widget { activeBasemap: Basemap; source: LocalBasemapsSource | PortalBasemapsSource; @@ -7834,13 +9663,63 @@ declare namespace __esri { interface BasemapGalleryProperties extends WidgetProperties { activeBasemap?: BasemapProperties; source?: LocalBasemapsSource | PortalBasemapsSource; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: BasemapGalleryViewModelProperties; } + interface BasemapGalleryItem { + basemap: Basemap; + error: Error; + state: string; + view: MapView | SceneView; + } + + export const BasemapGalleryItem: BasemapGalleryItem; + + interface BasemapGalleryViewModel extends Accessor { + activeBasemap: Basemap; + items: Collection; + source: LocalBasemapsSource | PortalBasemapsSource; + state: string; + view: MapView | SceneView; + + basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; + } + + interface BasemapGalleryViewModelConstructor { + new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; + } + + export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; + + interface BasemapGalleryViewModelProperties { + activeBasemap?: BasemapProperties; + items?: CollectionProperties; + source?: LocalBasemapsSource | PortalBasemapsSource; + state?: string; + view?: MapViewProperties | SceneViewProperties; + } + + interface LocalBasemapsSource { + basemaps: Collection; + state: string; + } + + export const LocalBasemapsSource: LocalBasemapsSource; + + interface PortalBasemapsSource { + basemaps: Collection; + filterFunction: Function; + portal: Portal; + query: any | string; + state: string; + } + + export const PortalBasemapsSource: PortalBasemapsSource; + interface BasemapToggle extends Widget { activeBasemap: Basemap; - nextBasemap: Basemap; + nextBasemap: Basemap | string; titleVisible: boolean; view: MapView | SceneView; viewModel: BasemapToggleViewModel; @@ -7857,27 +9736,52 @@ declare namespace __esri { interface BasemapToggleProperties extends WidgetProperties { activeBasemap?: BasemapProperties; - nextBasemap?: Basemap | string; + nextBasemap?: BasemapProperties | string; titleVisible?: boolean; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: BasemapToggleViewModelProperties; } + interface BasemapToggleViewModel extends Accessor, Evented { + activeBasemap: Basemap; + nextBasemap: Basemap | string; + state: string; + view: MapView | SceneView; + + toggle(): void; + } + + interface BasemapToggleViewModelConstructor { + new(properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; + + + getThumbnailUrl(basemap: Basemap): string; + } + + export const BasemapToggleViewModel: BasemapToggleViewModelConstructor; + + interface BasemapToggleViewModelProperties { + activeBasemap?: BasemapProperties; + nextBasemap?: BasemapProperties | string; + state?: string; + view?: MapViewProperties | SceneViewProperties; + } + interface ColorSlider extends Accessor, Widgette { handlesVisible: boolean; - histogram: any; + histogram: HistogramResult; histogramVisible: boolean; histogramWidth: number; labelsVisible: boolean; maxValue: number; minValue: number; numHandles: number; - statistics: any; + statistics: ColorSliderStatistics; statisticsVisible: boolean; syncedHandles: boolean; ticksVisible: boolean; values: ColorSliderValues[]; - visualVariable: any; + visualVariable: ColorVisualVariable; } interface ColorSliderConstructor { @@ -7888,19 +9792,32 @@ declare namespace __esri { interface ColorSliderProperties extends WidgetteProperties { handlesVisible?: boolean; - histogram?: any; + histogram?: HistogramResult; histogramVisible?: boolean; histogramWidth?: number; labelsVisible?: boolean; maxValue?: number; minValue?: number; numHandles?: number; - statistics?: any; + statistics?: ColorSliderStatistics; statisticsVisible?: boolean; syncedHandles?: boolean; ticksVisible?: boolean; values?: ColorSliderValues[]; - visualVariable?: any; + visualVariable?: ColorVisualVariable; + } + + export interface ColorSliderStatistics { + avg: number; + max: number; + min: number; + stddev: number; + } + + export interface ColorSliderValues { + color: Color; + value: number; + label: string; } interface Compass extends Widget { @@ -7918,15 +9835,35 @@ declare namespace __esri { export const Compass: CompassConstructor; interface CompassProperties extends WidgetProperties { - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: CompassViewModelProperties; } + interface CompassViewModel extends Accessor { + orientation: any; + state: string; + view: MapView | SceneView; + + reset(): void; + } + + interface CompassViewModelConstructor { + new(properties?: CompassViewModelProperties): CompassViewModel; + } + + export const CompassViewModel: CompassViewModelConstructor; + + interface CompassViewModelProperties { + orientation?: any; + state?: string; + view?: MapViewProperties | SceneViewProperties; + } + interface Expand extends Widget { autoCollapse: boolean; collapseIconClass: string; collapseTooltip: string; - content: any; + content: Node | string | Widget; expanded: boolean; expandIconClass: string; expandTooltip: string; @@ -7950,15 +9887,35 @@ declare namespace __esri { autoCollapse?: boolean; collapseIconClass?: string; collapseTooltip?: string; - content?: any | string | Widget; + content?: Node | string | WidgetProperties; expanded?: boolean; expandIconClass?: string; expandTooltip?: string; iconNumber?: string; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: ExpandViewModelProperties; } + interface ExpandViewModel extends Accessor { + autoCollapse: boolean; + expanded: boolean; + state: string; + view: MapView | SceneView; + } + + interface ExpandViewModelConstructor { + new(properties?: ExpandViewModelProperties): ExpandViewModel; + } + + export const ExpandViewModel: ExpandViewModelConstructor; + + interface ExpandViewModelProperties { + autoCollapse?: boolean; + expanded?: boolean; + state?: string; + view?: MapViewProperties | SceneViewProperties; + } + interface Home extends Widget { view: MapView | SceneView; viewModel: HomeViewModel; @@ -7975,15 +9932,36 @@ declare namespace __esri { export const Home: HomeConstructor; interface HomeProperties extends WidgetProperties { - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: HomeViewModelProperties; viewpoint?: ViewpointProperties; } + interface HomeViewModel extends Accessor, Evented { + state: string; + view: MapView | SceneView; + viewpoint: Viewpoint; + + go(): void; + } + + interface HomeViewModelConstructor { + new(properties?: HomeViewModelProperties): HomeViewModel; + } + + export const HomeViewModel: HomeViewModelConstructor; + + interface HomeViewModelProperties { + state?: string; + view?: MapViewProperties | SceneViewProperties; + viewpoint?: ViewpointProperties; + } + interface LayerList extends Widget { createActionsFunction: Function; listItemCreatedFunction: Function; - operationalItems: Collection; + operationalItems: Collection; + statusIndicatorsVisible: boolean; view: MapView | SceneView; viewModel: LayerListViewModel; @@ -8000,11 +9978,61 @@ declare namespace __esri { interface LayerListProperties extends WidgetProperties { createActionsFunction?: Function; listItemCreatedFunction?: Function; - operationalItems?: Collection | any[]; - view?: MapView | SceneView; + operationalItems?: CollectionProperties; + statusIndicatorsVisible?: boolean; + view?: MapViewProperties | SceneViewProperties; viewModel?: LayerListViewModelProperties; } + interface LayerListViewModel extends Accessor { + createActionsFunction: Function; + listItemCreatedFunction: Function; + operationalItems: Collection; + state: string; + view: MapView | SceneView; + + triggerAction(action: Action, item: ListItem): void; + } + + interface LayerListViewModelConstructor { + new(properties?: LayerListViewModelProperties): LayerListViewModel; + } + + export const LayerListViewModel: LayerListViewModelConstructor; + + interface LayerListViewModelProperties { + createActionsFunction?: Function; + listItemCreatedFunction?: Function; + operationalItems?: CollectionProperties; + state?: string; + view?: MapViewProperties | SceneViewProperties; + } + + interface ListItem { + actionsOpen: boolean; + actionsSections: Collection>; + children: Collection; + error: Error; + layer: Layer; + layerView: LayerView; + open: boolean; + parent: ListItem; + title: string; + updating: boolean; + view: MapView | SceneView; + visibilityMode: string; + visible: boolean; + visibleAtCurrentScale: boolean; + + clone(): ListItem; + } + + interface ListItemConstructor { + new(): ListItem; + } + + export const ListItem: ListItemConstructor; + interface Legend extends Widget { layerInfos: LegendLayerInfos[]; view: MapView | SceneView; @@ -8020,7 +10048,12 @@ declare namespace __esri { interface LegendProperties extends WidgetProperties { layerInfos?: LegendLayerInfos[]; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; + } + + export interface LegendLayerInfos { + title?: string; + layer: Layer; } interface Locate extends Widget { @@ -8044,10 +10077,26 @@ declare namespace __esri { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: LocateViewModelProperties; } + interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { + state: string; + + locate(): IPromise; + } + + interface LocateViewModelConstructor { + new(properties?: LocateViewModelProperties): LocateViewModel; + } + + export const LocateViewModel: LocateViewModelConstructor; + + interface LocateViewModelProperties extends GeolocationPositioningProperties { + state?: string; + } + interface NavigationToggle extends Widget { layout: string; view: SceneView; @@ -8069,9 +10118,31 @@ declare namespace __esri { viewModel?: NavigationToggleViewModelProperties; } - interface Popup extends Accessor, Widgette, Evented { - actions: Collection; - content: string; + interface NavigationToggleViewModel extends Accessor { + navigationMode: string; + state: string; + view: SceneView; + + toggle(): void; + } + + interface NavigationToggleViewModelConstructor { + new(properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; + } + + export const NavigationToggleViewModel: NavigationToggleViewModelConstructor; + + interface NavigationToggleViewModelProperties { + navigationMode?: string; + state?: string; + view?: SceneViewProperties; + } + + interface Popup extends Widget, Evented { + actions: Collection; + autoCloseEnabled: boolean; + collapsed: boolean; + content: string | Node; currentDockPosition: string; dockEnabled: boolean; dockOptions: PopupDockOptions; @@ -8085,12 +10156,14 @@ declare namespace __esri { title: string; view: MapView | SceneView; viewModel: PopupViewModel; + visible: boolean; clear(): void; close(): void; next(): PopupViewModel; open(options?: PopupOpenOptions): void; previous(): PopupViewModel; + render(): any; reposition(): void; triggerAction(actionIndex: number): void; } @@ -8101,9 +10174,11 @@ declare namespace __esri { export const Popup: PopupConstructor; - interface PopupProperties extends WidgetteProperties { - actions?: Collection | any[]; - content?: string | any; + interface PopupProperties extends WidgetProperties { + actions?: CollectionProperties; + autoCloseEnabled?: boolean; + collapsed?: boolean; + content?: string | Node; currentDockPosition?: string; dockEnabled?: boolean; dockOptions?: PopupDockOptions; @@ -8115,8 +10190,80 @@ declare namespace __esri { selectedFeature?: GraphicProperties; selectedFeatureIndex?: number; title?: string; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: PopupViewModelProperties; + visible?: boolean; + } + + interface PopupViewModel extends Accessor, Evented { + actions: Collection>; + autoCloseEnabled: boolean; + content: string | Node; + featureCount: number; + features: Graphic[]; + highlightEnabled: boolean; + location: Point; + pendingPromisesCount: number; + promiseCount: number; + promises: IPromise[]; + selectedFeature: Graphic; + selectedFeatureIndex: number; + state: string; + title: string; + view: MapView | SceneView; + visible: boolean; + + clear(): void; + next(): PopupViewModel; + previous(): PopupViewModel; + triggerAction(actionIndex: number): void; + } + + interface PopupViewModelConstructor { + new(properties?: PopupViewModelProperties): PopupViewModel; + } + + export const PopupViewModel: PopupViewModelConstructor; + + interface PopupViewModelProperties { + actions?: CollectionProperties>; + autoCloseEnabled?: boolean; + content?: string | Node; + featureCount?: number; + features?: GraphicProperties[]; + highlightEnabled?: boolean; + location?: PointProperties; + pendingPromisesCount?: number; + promiseCount?: number; + promises?: IPromise[]; + selectedFeature?: GraphicProperties; + selectedFeatureIndex?: number; + state?: string; + title?: string; + view?: MapViewProperties | SceneViewProperties; + visible?: boolean; + } + + export interface PopupDockOptions { + breakpoint?: boolean | PopupDockOptionsBreakpoint; + buttonEnabled?: boolean; + position?: string | Function; + } + + export interface PopupDockOptionsBreakpoint { + width?: number; + height?: number; + } + + export interface PopupOpenOptions { + title?: string; + content?: string; + location?: Geometry; + features?: Graphic[]; + promises?: IPromise[]; + featureMenuOpen?: boolean; + updateLocationEnabled?: boolean; + collapsed?: boolean; } interface Print extends Widget { @@ -8139,6 +10286,26 @@ declare namespace __esri { viewModel?: PrintViewModelProperties; } + interface PrintViewModel extends Accessor { + printServiceUrl: string; + updateDelay: number; + view: MapView; + + print(printTemplate: PrintTemplate): IPromise; + } + + interface PrintViewModelConstructor { + new(properties?: PrintViewModelProperties): PrintViewModel; + } + + export const PrintViewModel: PrintViewModelConstructor; + + interface PrintViewModelProperties { + printServiceUrl?: string; + updateDelay?: number; + view?: MapViewProperties; + } + interface ScaleBar extends Widget { style: string; unit: string; @@ -8161,12 +10328,26 @@ declare namespace __esri { viewModel?: ScaleBarViewModelProperties; } + interface ScaleBarViewModel extends Accessor { + view: MapView; + } + + interface ScaleBarViewModelConstructor { + new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; + } + + export const ScaleBarViewModel: ScaleBarViewModelConstructor; + + interface ScaleBarViewModelProperties { + view?: MapViewProperties; + } + interface Search extends Widget { activeSource: FeatureLayer | Locator; activeSourceIndex: number; allPlaceholder: string; autoSelect: boolean; - defaultSource: any | any; + defaultSource: LocatorSource | FeatureLayerSource; maxResults: number; maxSuggestions: number; minSuggestCharacters: number; @@ -8179,9 +10360,9 @@ declare namespace __esri { searchAllEnabled: boolean; searching: boolean; searchTerm: string; - selectedResult: any; - sources: Collection; - suggestions: any[]; + selectedResult: SearchResult; + sources: Collection; + suggestions: SuggestResult[]; suggestionsEnabled: boolean; view: MapView | SceneView; viewModel: SearchViewModel; @@ -8190,8 +10371,8 @@ declare namespace __esri { clear(): void; focus(): void; render(): any; - search(searchTerm?: string | Geometry | any | number[][]): IPromise; - suggest(value?: string): IPromise; + search(searchTerm?: string | Geometry | SuggestResult | number[][]): IPromise; + suggest(value?: string): IPromise; } interface SearchConstructor { @@ -8201,11 +10382,11 @@ declare namespace __esri { export const Search: SearchConstructor; interface SearchProperties extends WidgetProperties { - activeSource?: FeatureLayer | Locator; + activeSource?: FeatureLayerProperties | LocatorProperties; activeSourceIndex?: number; allPlaceholder?: string; autoSelect?: boolean; - defaultSource?: any | any; + defaultSource?: LocatorSource | FeatureLayerSource; maxResults?: number; maxSuggestions?: number; minSuggestCharacters?: number; @@ -8218,17 +10399,366 @@ declare namespace __esri { searchAllEnabled?: boolean; searching?: boolean; searchTerm?: string; - selectedResult?: any; - sources?: Collection | any[]; - suggestions?: any[]; + selectedResult?: SearchResult; + sources?: CollectionProperties; + suggestions?: SuggestResult[]; suggestionsEnabled?: boolean; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: SearchViewModelProperties; } + interface SearchViewModel extends Accessor, Evented { + activeSource: FeatureLayer | Locator; + activeSourceIndex: number; + allPlaceholder: string; + autoSelect: boolean; + defaultSource: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + maxInputLength: number; + maxResults: number; + maxSuggestions: number; + minSuggestCharacters: number; + placeholder: string; + popupEnabled: boolean; + popupOpenOnSelect: boolean; + popupTemplate: PopupTemplate; + resultGraphic: Graphic; + resultGraphicEnabled: boolean; + results: any[]; + searchAllEnabled: boolean; + searchTerm: string; + selectedResult: any; + sources: Collection; + suggestionDelay: number; + suggestions: SearchViewModelSuggestResult[]; + suggestionsEnabled: boolean; + view: MapView | SceneView; + + clear(): void; + search(searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][]): IPromise; + suggest(value?: string): IPromise; + + on(name: "search-clear", eventHandler: SearchViewModelSearchClearEventHandler): IHandle; + on(name: "search-clear", modifiers: string[], eventHandler: SearchViewModelSearchClearEventHandler): IHandle; + on(name: "search-start", eventHandler: SearchViewModelSearchStartEventHandler): IHandle; + on(name: "search-start", modifiers: string[], eventHandler: SearchViewModelSearchStartEventHandler): IHandle; + on(name: "suggest-start", eventHandler: SearchViewModelSuggestStartEventHandler): IHandle; + on(name: "suggest-start", modifiers: string[], eventHandler: SearchViewModelSuggestStartEventHandler): IHandle; + on(name: "load", eventHandler: SearchViewModelLoadEventHandler): IHandle; + on(name: "load", modifiers: string[], eventHandler: SearchViewModelLoadEventHandler): IHandle; + on(name: "search-complete", eventHandler: SearchViewModelSearchCompleteEventHandler): IHandle; + on(name: "search-complete", modifiers: string[], eventHandler: SearchViewModelSearchCompleteEventHandler): IHandle; + on(name: "select-result", eventHandler: SearchViewModelSelectResultEventHandler): IHandle; + on(name: "select-result", modifiers: string[], eventHandler: SearchViewModelSelectResultEventHandler): IHandle; + on(name: "suggest-complete", eventHandler: SearchViewModelSuggestCompleteEventHandler): IHandle; + on(name: "suggest-complete", modifiers: string[], eventHandler: SearchViewModelSuggestCompleteEventHandler): IHandle; + } + + interface SearchViewModelConstructor { + new(properties?: SearchViewModelProperties): SearchViewModel; + } + + export const SearchViewModel: SearchViewModelConstructor; + + interface SearchViewModelProperties { + activeSource?: FeatureLayerProperties | LocatorProperties; + activeSourceIndex?: number; + allPlaceholder?: string; + autoSelect?: boolean; + defaultSource?: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + maxInputLength?: number; + maxResults?: number; + maxSuggestions?: number; + minSuggestCharacters?: number; + placeholder?: string; + popupEnabled?: boolean; + popupOpenOnSelect?: boolean; + popupTemplate?: PopupTemplateProperties; + resultGraphic?: GraphicProperties; + resultGraphicEnabled?: boolean; + results?: any[]; + searchAllEnabled?: boolean; + searchTerm?: string; + selectedResult?: any; + sources?: CollectionProperties; + suggestionDelay?: number; + suggestions?: SearchViewModelSuggestResult[]; + suggestionsEnabled?: boolean; + view?: MapViewProperties | SceneViewProperties; + } + + export interface SearchViewModelFeatureLayerSource { + popup: Popup; + autoNavigate: boolean; + exactMatch: boolean; + featureLayer: FeatureLayer; + filter: SearchViewModelFeatureLayerSourceFilter; + maxResults: number; + maxSuggestions: number; + minSuggestCharacters: number; + name: string; + outFields: string[]; + placeholder: string; + displayField: string; + popupEnabled: boolean; + popupOpenOnSelect: boolean; + prefix: string; + resultGraphicEnabled: boolean; + resultSymbol: Symbol; + searchFields: string[]; + suffix: string; + suggestionsEnabled: boolean; + suggestionTemplate: string; + withinViewEnabled: boolean; + zoomScale: number; + } + + export interface SearchViewModelLoadEvent { + } + + export interface SearchViewModelLocatorSource { + placeholder: string; + autoNavigate: boolean; + countryCode: string; + filter: SearchViewModelLocatorSourceFilter; + localSearchOptions: SearchViewModelLocatorSourceLocalSearchOptions; + locationToAddressDistance: number; + locator: Locator; + maxResults: number; + maxSuggestions: number; + minSuggestCharacters: number; + name: string; + outFields: string[]; + categories: string[]; + popup: Popup; + popupEnabled: boolean; + popupOpenOnSelect: boolean; + prefix: string; + resultGraphicEnabled: boolean; + resultSymbol: Symbol; + searchTemplate: string; + singleLineFieldName: string; + suggestionsEnabled: boolean; + suffix: string; + withinViewEnabled: boolean; + zoomScale: number; + } + + export interface SearchViewModelSearchClearEvent { + } + + export interface SearchViewModelSearchCompleteEvent { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + results: SearchViewModelSearchCompleteEventResults[]; + searchTerm: string; + } + + export interface SearchViewModelSearchResponse { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + searchTerm: string; + results: SearchViewModelSearchResponseResults[]; + } + + export interface SearchViewModelSearchResult { + extent: Extent; + feature: Graphic; + name: string; + } + + export interface SearchViewModelSearchStartEvent { + } + + export interface SearchViewModelSelectResultEvent { + result: SearchViewModelSelectResultEventResult; + source: any; + sourceIndex: number; + } + + export interface SearchViewModelSuggestCompleteEvent { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + results: SearchViewModelSuggestCompleteEventResults[]; + searchTerm: string; + } + + export interface SearchViewModelSuggestResponse { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + searchTerm: string; + results: SearchViewModelSuggestResponseResults[]; + } + + export interface SearchViewModelSuggestResult { + key: string; + text: string; + sourceIndex: number; + } + + export interface SearchViewModelSuggestStartEvent { + } + + export interface SearchViewModelFeatureLayerSourceFilter { + where: string; + geometry: Geometry; + } + + export interface SearchViewModelLocatorSourceFilter { + where: string; + geometry: Geometry; + } + + export interface SearchViewModelLocatorSourceLocalSearchOptions { + distance: number; + minScale: number; + } + + export interface SearchViewModelSearchCompleteEventResults { + results: SearchResult[]; + sourceIndex: number; + source: any[]; + } + + export interface SearchViewModelSearchResponseResults { + results: SearchViewModelSearchResult[]; + sourceIndex: number; + source: any; + } + + export interface SearchViewModelSelectResultEventResult { + extent: Extent; + feature: Graphic; + name: string; + } + + export interface SearchViewModelSuggestCompleteEventResults { + results: SearchViewModelSuggestResult[]; + sourceIndex: number; + source: any; + } + + export interface SearchViewModelSuggestResponseResults { + results: SearchViewModelSuggestResult[]; + sourceIndex: number; + source: any; + } + + export interface FeatureLayerSource { + popup: Popup; + autoNavigate: boolean; + exactMatch: boolean; + featureLayer: FeatureLayer; + filter: FeatureLayerSourceFilter; + maxResults: number; + maxSuggestions: number; + minSuggestCharacters: number; + name: string; + outFields: string[]; + placeholder: string; + displayField: string; + popupEnabled: boolean; + popupOpenOnSelect: boolean; + prefix: string; + resultGraphicEnabled: boolean; + resultSymbol: Symbol; + searchFields: string[]; + suffix: string; + suggestionsEnabled: boolean; + suggestionTemplate: string; + withinViewEnabled: boolean; + zoomScale: number; + } + + export interface LocatorSource { + placeholder: string; + autoNavigate: boolean; + countryCode: string; + filter: LocatorSourceFilter; + localSearchOptions: LocatorSourceLocalSearchOptions; + locationToAddressDistance: number; + locator: Locator; + maxResults: number; + maxSuggestions: number; + minSuggestCharacters: number; + name: string; + outFields: string[]; + categories: string[]; + popup: Popup; + popupEnabled: boolean; + popupOpenOnSelect: boolean; + prefix: string; + resultGraphicEnabled: boolean; + resultSymbol: Symbol; + searchTemplate: string; + singleLineFieldName: string; + suggestionsEnabled: boolean; + suffix: string; + withinViewEnabled: boolean; + zoomScale: number; + } + + export interface SearchResponse { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + searchTerm: string; + results: SearchResponseResults[]; + } + + export interface SearchResult { + extent: Extent; + feature: Graphic; + name: string; + } + + export interface SuggestResponse { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + searchTerm: string; + results: SuggestResponseResults[]; + } + + export interface SuggestResult { + key: string; + text: string; + sourceIndex: number; + } + + export interface FeatureLayerSourceFilter { + where: string; + geometry: Geometry; + } + + export interface LocatorSourceFilter { + where: string; + geometry: Geometry; + } + + export interface LocatorSourceLocalSearchOptions { + distance: number; + minScale: number; + } + + export interface SearchResponseResults { + results: SearchResult[]; + sourceIndex: number; + source: any; + } + + export interface SuggestResponseResults { + results: SuggestResult[]; + sourceIndex: number; + source: any; + } + interface SizeSlider extends Accessor, Widgette { handlesVisible: boolean; - histogram: any; + histogram: HistogramResult; histogramVisible: boolean; histogramWidth: number; labelsVisible: boolean; @@ -8236,11 +10766,12 @@ declare namespace __esri { maxValue: number; minSize: number; minValue: number; - statistics: any; + statistics: SizeSliderStatistics; statisticsVisible: boolean; + symbol: SimpleMarkerSymbol | SimpleLineSymbol; ticksVisible: boolean; values: number[]; - visualVariable: any; + visualVariable: SizeVisualVariable; } interface SizeSliderConstructor { @@ -8251,7 +10782,7 @@ declare namespace __esri { interface SizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; - histogram?: any; + histogram?: HistogramResult; histogramVisible?: boolean; histogramWidth?: number; labelsVisible?: boolean; @@ -8259,13 +10790,77 @@ declare namespace __esri { maxValue?: number; minSize?: number; minValue?: number; - statistics?: any; + statistics?: SizeSliderStatistics; statisticsVisible?: boolean; + symbol?: SimpleMarkerSymbolProperties | SimpleLineSymbolProperties; ticksVisible?: boolean; values?: number[]; - visualVariable?: any; + visualVariable?: SizeVisualVariable; } + export interface SizeSliderStatistics { + avg?: number; + max: number; + min: number; + } + + interface SketchViewModel extends Accessor, Evented { + graphic: Graphic; + pointSymbol: SimpleMarkerSymbol; + polygonSymbol: SimpleFillSymbol; + polylineSymbol: SimpleLineSymbol; + state: string; + view: MapView; + + create(drawAction: string): void; + reset(): void; + } + + interface SketchViewModelConstructor { + new(properties?: SketchViewModelProperties): SketchViewModel; + } + + export const SketchViewModel: SketchViewModelConstructor; + + interface SketchViewModelProperties { + graphic?: GraphicProperties; + pointSymbol?: SimpleMarkerSymbolProperties; + polygonSymbol?: SimpleFillSymbolProperties; + polylineSymbol?: SimpleLineSymbolProperties; + state?: string; + view?: MapViewProperties; + } + + interface GeolocationPositioning { + geolocationOptions: any; + goToLocationEnabled: boolean; + graphic: Graphic; + view: MapView | SceneView; + } + + interface GeolocationPositioningConstructor { + new(): GeolocationPositioning; + } + + export const GeolocationPositioning: GeolocationPositioningConstructor; + + interface GeolocationPositioningProperties { + geolocationOptions?: any; + goToLocationEnabled?: boolean; + graphic?: GraphicProperties; + view?: MapViewProperties | SceneViewProperties; + } + + interface widget { + accessibleHandler(): Function; + join(...classNames: string[]): string; + renderable(propertyName?: string | string[]): Function; + tsx(selector: string, properties?: any, children?: any): any; + vmEvent(eventNames: string | string[]): Function; + } + + export const widget: widget; + interface Track extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; @@ -8290,458 +10885,10 @@ declare namespace __esri { goToLocationEnabled?: boolean; graphic?: GraphicProperties; tracking?: boolean; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; viewModel?: TrackViewModelProperties; } - interface UnivariateColorSizeSlider extends Accessor, Widgette { - handlesVisible: boolean; - histogram: any; - histogramVisible: boolean; - histogramWidth: number; - labelsVisible: boolean; - maxSize: number; - maxValue: number; - minSize: number; - minValue: number; - statistics: any; - statisticsVisible: boolean; - ticksVisible: boolean; - values: number[]; - visualVariables: any[]; - } - - interface UnivariateColorSizeSliderConstructor { - new(properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; - } - - export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; - - interface UnivariateColorSizeSliderProperties extends WidgetteProperties { - handlesVisible?: boolean; - histogram?: any; - histogramVisible?: boolean; - histogramWidth?: number; - labelsVisible?: boolean; - maxSize?: number; - maxValue?: number; - minSize?: number; - minValue?: number; - statistics?: any; - statisticsVisible?: boolean; - ticksVisible?: boolean; - values?: number[]; - visualVariables?: any[]; - } - - interface Widget extends Accessor, Evented { - container: string; - destroyed: boolean; - id: string; - - destroy(): void; - own(handles: any[]): void; - postInitialize(): void; - renderNow(): void; - scheduleRender(): void; - startup(): void; - } - - interface WidgetConstructor { - new(properties?: WidgetProperties): Widget; - } - - export const Widget: WidgetConstructor; - - interface WidgetProperties { - container?: string | any; - destroyed?: boolean; - id?: string; - } - - interface Zoom extends Widget { - view: MapView | SceneView; - viewModel: ZoomViewModel; - - render(): any; - zoomIn(): void; - zoomOut(): void; - } - - interface ZoomConstructor { - new(properties?: ZoomProperties): Zoom; - } - - export const Zoom: ZoomConstructor; - - interface ZoomProperties extends WidgetProperties { - view?: MapView | SceneView; - viewModel?: ZoomViewModelProperties; - } - - interface AttributionViewModel { - attributionText: string; - itemDelimiter: string; - state: string; - view: MapView | SceneView; - } - - interface AttributionViewModelConstructor { - new(properties?: any): AttributionViewModel; - } - - export const AttributionViewModel: AttributionViewModelConstructor; - - interface BasemapGalleryViewModel extends Accessor { - activeBasemap: Basemap; - items: Collection; - source: LocalBasemapsSource | PortalBasemapsSource; - state: string; - view: MapView | SceneView; - - basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; - } - - interface BasemapGalleryViewModelConstructor { - new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; - } - - export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; - - interface BasemapGalleryViewModelProperties { - activeBasemap?: BasemapProperties; - items?: Collection | any[]; - source?: LocalBasemapsSource | PortalBasemapsSource; - state?: string; - view?: MapView | SceneView; - } - - interface BasemapToggleViewModel extends Accessor, Evented { - activeBasemap: Basemap; - nextBasemap: Basemap; - state: string; - view: MapView | SceneView; - - toggle(): void; - } - - interface BasemapToggleViewModelConstructor { - new(properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; - - - getThumbnailUrl(basemap: Basemap): string; - } - - export const BasemapToggleViewModel: BasemapToggleViewModelConstructor; - - interface BasemapToggleViewModelProperties { - activeBasemap?: BasemapProperties; - nextBasemap?: Basemap | string; - state?: string; - view?: MapView | SceneView; - } - - interface CompassViewModel extends Accessor { - orientation: any; - state: string; - view: MapView | SceneView; - - reset(): void; - } - - interface CompassViewModelConstructor { - new(properties?: CompassViewModelProperties): CompassViewModel; - } - - export const CompassViewModel: CompassViewModelConstructor; - - interface CompassViewModelProperties { - orientation?: any; - state?: string; - view?: MapView | SceneView; - } - - interface ExpandViewModel extends Accessor { - autoCollapse: boolean; - expanded: boolean; - state: string; - view: MapView | SceneView; - } - - interface ExpandViewModelConstructor { - new(properties?: ExpandViewModelProperties): ExpandViewModel; - } - - export const ExpandViewModel: ExpandViewModelConstructor; - - interface ExpandViewModelProperties { - autoCollapse?: boolean; - expanded?: boolean; - state?: string; - view?: MapView | SceneView; - } - - interface HomeViewModel extends Accessor, Evented { - state: string; - view: MapView | SceneView; - viewpoint: Viewpoint; - - go(): void; - } - - interface HomeViewModelConstructor { - new(properties?: HomeViewModelProperties): HomeViewModel; - } - - export const HomeViewModel: HomeViewModelConstructor; - - interface HomeViewModelProperties { - state?: string; - view?: MapView | SceneView; - viewpoint?: ViewpointProperties; - } - - interface LayerListViewModel extends Accessor { - createActionsFunction: Function; - listItemCreatedFunction: Function; - operationalItems: Collection; - state: string; - view: MapView | SceneView; - - triggerAction(action: Action, item: ListItem): void; - } - - interface LayerListViewModelConstructor { - new(properties?: LayerListViewModelProperties): LayerListViewModel; - } - - export const LayerListViewModel: LayerListViewModelConstructor; - - interface LayerListViewModelProperties { - createActionsFunction?: Function; - listItemCreatedFunction?: Function; - operationalItems?: Collection | any[]; - state?: string; - view?: MapView | SceneView; - } - - interface ListItem { - actionsOpen: boolean; - actionsSections: Collection; - children: Collection; - error: Error; - layer: Layer; - layerView: LayerView; - open: boolean; - title: string; - updating: boolean; - view: MapView | SceneView; - visibilityMode: string; - visible: boolean; - visibleAtCurrentScale: boolean; - - clone(): this; - } - - interface ListItemConstructor { - new(): ListItem; - } - - export const ListItem: ListItemConstructor; - - interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { - state: string; - - locate(): IPromise; - } - - interface LocateViewModelConstructor { - new(properties?: LocateViewModelProperties): LocateViewModel; - } - - export const LocateViewModel: LocateViewModelConstructor; - - interface LocateViewModelProperties extends GeolocationPositioningProperties { - state?: string; - } - - interface NavigationToggleViewModel extends Accessor { - navigationMode: string; - state: string; - view: SceneView; - - toggle(): void; - } - - interface NavigationToggleViewModelConstructor { - new(properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; - } - - export const NavigationToggleViewModel: NavigationToggleViewModelConstructor; - - interface NavigationToggleViewModelProperties { - navigationMode?: string; - state?: string; - view?: SceneViewProperties; - } - - interface PrintViewModel extends Accessor { - printServiceUrl: string; - updateDelay: number; - view: MapView; - - print(printTemplate: PrintTemplate): IPromise; - } - - interface PrintViewModelConstructor { - new(properties?: PrintViewModelProperties): PrintViewModel; - } - - export const PrintViewModel: PrintViewModelConstructor; - - interface PrintViewModelProperties { - printServiceUrl?: string; - updateDelay?: number; - view?: MapViewProperties; - } - - interface PopupViewModel extends Accessor, Evented { - actions: Collection; - content: string; - featureCount: number; - features: Graphic[]; - highlightEnabled: boolean; - location: Point; - pendingPromisesCount: number; - promises: IPromise[]; - selectedFeature: Graphic; - selectedFeatureIndex: number; - state: string; - title: string; - view: MapView | SceneView; - - clear(): void; - next(): PopupViewModel; - previous(): PopupViewModel; - triggerAction(actionIndex: number): void; - } - - interface PopupViewModelConstructor { - new(properties?: PopupViewModelProperties): PopupViewModel; - } - - export const PopupViewModel: PopupViewModelConstructor; - - interface PopupViewModelProperties { - actions?: Collection | any[]; - content?: string | any; - featureCount?: number; - features?: GraphicProperties[]; - highlightEnabled?: boolean; - location?: PointProperties; - pendingPromisesCount?: number; - promises?: IPromise[]; - selectedFeature?: GraphicProperties; - selectedFeatureIndex?: number; - state?: string; - title?: string; - view?: MapView | SceneView; - } - - interface ScaleBarViewModel extends Accessor { - view: MapView; - } - - interface ScaleBarViewModelConstructor { - new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; - } - - export const ScaleBarViewModel: ScaleBarViewModelConstructor; - - interface ScaleBarViewModelProperties { - view?: MapViewProperties; - } - - interface SearchViewModel extends Accessor, Evented { - activeSource: FeatureLayer | Locator; - activeSourceIndex: number; - allPlaceholder: string; - autoSelect: boolean; - defaultSource: any | any; - maxInputLength: number; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; - placeholder: string; - popupEnabled: boolean; - popupOpenOnSelect: boolean; - popupTemplate: PopupTemplate; - resultGraphic: Graphic; - resultGraphicEnabled: boolean; - results: any[]; - searchAllEnabled: boolean; - searchTerm: string; - selectedResult: any; - sources: Collection; - suggestionDelay: number; - suggestions: any[]; - suggestionsEnabled: boolean; - view: MapView | SceneView; - - cancelSuggest(): void; - clear(): void; - search(searchTerm?: string | Geometry | any | number[][]): IPromise; - suggest(value?: string): IPromise; - - on(name: "suggest-complete", eventHandler: SearchViewModelSuggestCompleteEventHandler): IHandle; - on(name: "suggest-complete", modifiers: string[], eventHandler: SearchViewModelSuggestCompleteEventHandler): IHandle; - on(name: "search-clear", eventHandler: SearchViewModelSearchClearEventHandler): IHandle; - on(name: "search-clear", modifiers: string[], eventHandler: SearchViewModelSearchClearEventHandler): IHandle; - on(name: "search-start", eventHandler: SearchViewModelSearchStartEventHandler): IHandle; - on(name: "search-start", modifiers: string[], eventHandler: SearchViewModelSearchStartEventHandler): IHandle; - on(name: "suggest-start", eventHandler: SearchViewModelSuggestStartEventHandler): IHandle; - on(name: "suggest-start", modifiers: string[], eventHandler: SearchViewModelSuggestStartEventHandler): IHandle; - on(name: "load", eventHandler: SearchViewModelLoadEventHandler): IHandle; - on(name: "load", modifiers: string[], eventHandler: SearchViewModelLoadEventHandler): IHandle; - on(name: "search-complete", eventHandler: SearchViewModelSearchCompleteEventHandler): IHandle; - on(name: "search-complete", modifiers: string[], eventHandler: SearchViewModelSearchCompleteEventHandler): IHandle; - on(name: "select-result", eventHandler: SearchViewModelSelectResultEventHandler): IHandle; - on(name: "select-result", modifiers: string[], eventHandler: SearchViewModelSelectResultEventHandler): IHandle; - } - - interface SearchViewModelConstructor { - new(properties?: SearchViewModelProperties): SearchViewModel; - } - - export const SearchViewModel: SearchViewModelConstructor; - - interface SearchViewModelProperties { - activeSource?: FeatureLayer | Locator; - activeSourceIndex?: number; - allPlaceholder?: string; - autoSelect?: boolean; - defaultSource?: any | any; - maxInputLength?: number; - maxResults?: number; - maxSuggestions?: number; - minSuggestCharacters?: number; - placeholder?: string; - popupEnabled?: boolean; - popupOpenOnSelect?: boolean; - popupTemplate?: PopupTemplateProperties; - resultGraphic?: GraphicProperties; - resultGraphicEnabled?: boolean; - results?: any[]; - searchAllEnabled?: boolean; - searchTerm?: string; - selectedResult?: any; - sources?: Collection | any[]; - suggestionDelay?: number; - suggestions?: any[]; - suggestionsEnabled?: boolean; - view?: MapView | SceneView; - } - interface TrackViewModel extends Accessor, Evented, GeolocationPositioning { state: string; tracking: boolean; @@ -8761,6 +10908,119 @@ declare namespace __esri { tracking?: boolean; } + interface UnivariateColorSizeSlider extends Accessor, Widgette { + handlesVisible: boolean; + histogram: HistogramResult; + histogramVisible: boolean; + histogramWidth: number; + labelsVisible: boolean; + maxSize: number; + maxValue: number; + minSize: number; + minValue: number; + statistics: UnivariateColorSizeSliderStatistics; + statisticsVisible: boolean; + ticksVisible: boolean; + values: number[]; + visualVariables: any[]; + } + + interface UnivariateColorSizeSliderConstructor { + new(properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; + } + + export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; + + interface UnivariateColorSizeSliderProperties extends WidgetteProperties { + handlesVisible?: boolean; + histogram?: HistogramResult; + histogramVisible?: boolean; + histogramWidth?: number; + labelsVisible?: boolean; + maxSize?: number; + maxValue?: number; + minSize?: number; + minValue?: number; + statistics?: UnivariateColorSizeSliderStatistics; + statisticsVisible?: boolean; + ticksVisible?: boolean; + values?: number[]; + visualVariables?: any[]; + } + + export interface UnivariateColorSizeSliderStatistics { + avg: number; + max: number; + min: number; + stddev: number; + } + + interface Widget extends Accessor, Evented { + container: string | HTMLElement; + destroyed: boolean; + id: string; + + destroy(): void; + own(handles: WatchHandle | WatchHandle[]): void; + postInitialize(): void; + renderNow(): void; + scheduleRender(): void; + startup(): void; + } + + interface WidgetConstructor { + new(properties?: WidgetProperties): Widget; + } + + export const Widget: WidgetConstructor; + + interface WidgetProperties { + container?: string | HTMLElement; + destroyed?: boolean; + id?: string; + } + + interface Widgette { + container: string | HTMLElement; + visible: boolean; + + destroy(): void; + on(type: string, listener: Function): any; + } + + interface WidgetteConstructor { + new(): Widgette; + } + + export const Widgette: WidgetteConstructor; + + interface WidgetteProperties { + container?: string | HTMLElement; + visible?: boolean; + } + + interface Zoom extends Widget { + layout: string; + view: MapView | SceneView; + viewModel: ZoomViewModel; + + render(): any; + zoomIn(): void; + zoomOut(): void; + } + + interface ZoomConstructor { + new(properties?: ZoomProperties): Zoom; + } + + export const Zoom: ZoomConstructor; + + interface ZoomProperties extends WidgetProperties { + layout?: string; + view?: MapViewProperties | SceneViewProperties; + viewModel?: ZoomViewModelProperties; + } + interface ZoomViewModel extends Accessor { canZoomIn: boolean; canZoomOut: boolean; @@ -8781,1652 +11041,114 @@ declare namespace __esri { canZoomIn?: boolean; canZoomOut?: boolean; state?: string; - view?: MapView | SceneView; + view?: MapViewProperties | SceneViewProperties; } - interface Evented { - hasEventListener(type: string): boolean; - on(type: string, listener: EventHandler): IHandle; - } - - interface EventedConstructor { - new(): Evented; - } - - export const Evented: EventedConstructor; - - interface JSONSupport { - toJSON(): any; - } - - interface JSONSupportConstructor { - new(): JSONSupport; - - - fromJSON(json: any): any; - } - - export const JSONSupport: JSONSupportConstructor; - - interface Loadable { - loadError: Error; - loadStatus: string; - loadWarnings: any[]; - - always(callbackOrErrback?: Function): IPromise; - cancelLoad(): void; - isFulfilled(): boolean; - isRejected(): boolean; - isResolved(): boolean; - load(): IPromise; - otherwise(errback?: Function): IPromise; - then(callback?: Function, errback?: Function, progback?: Function): IPromise; - } - - interface LoadableConstructor { - new(): Loadable; - } - - export const Loadable: LoadableConstructor; - - interface LoadableProperties { - loadError?: Error; - loadStatus?: string; - loadWarnings?: any[]; - } - - interface corePromise { - always(callbackOrErrback?: Function): IPromise; - isFulfilled(): boolean; - isRejected(): boolean; - isResolved(): boolean; - otherwise(errback?: Function): IPromise; - then(callback?: Function, errback?: Function, progback?: Function): IPromise; - } - - interface corePromiseConstructor { - new(): corePromise; - } - - export const corePromise: corePromiseConstructor; - - interface DynamicLayer { - portalItem: PortalItem; - url: string; - - fetchImage(extent: Extent, width: number, height: number, options?: DynamicLayerFetchImageOptions): IPromise; - getImageUrl(extent: Extent, width: number, height: number, options?: DynamicLayerGetImageUrlOptions): IPromise | string; - } - - interface DynamicLayerConstructor { - new(): DynamicLayer; - } - - export const DynamicLayer: DynamicLayerConstructor; - - interface DynamicLayerProperties { - portalItem?: PortalItemProperties; - url?: string; - } - - interface TiledLayer { - tileInfo: TileInfo; - } - - interface TiledLayerConstructor { - new(properties?: TiledLayerProperties): TiledLayer; - - fromJSON(json: any): TiledLayer; - } - - export const TiledLayer: TiledLayerConstructor; - - interface TiledLayerProperties { - tileInfo?: TileInfoProperties; - } - - interface ArcGISCachedService { - maxScale: number; - minScale: number; - tileInfo: TileInfo; - - fromJSON(json: any): any; - toJSON(): any; - } - - interface ArcGISCachedServiceConstructor { - new(properties?: ArcGISCachedServiceProperties): ArcGISCachedService; - - fromJSON(json: any): ArcGISCachedService; - } - - export const ArcGISCachedService: ArcGISCachedServiceConstructor; - - interface ArcGISCachedServiceProperties { - maxScale?: number; - minScale?: number; - tileInfo?: TileInfoProperties; - } - - interface ArcGISDynamicMapService { - allSublayers: Collection; - dpi: number; - gdbVersion: string; - imageFormat: string; - imageMaxHeight: number; - imageMaxWidth: number; - imageTransparency: boolean; - sublayers: Collection; - - createServiceSublayers(): Collection; - findSublayerById(id: number): Sublayer; - getExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceGetExportImageParametersOptions): any; - } - - interface ArcGISDynamicMapServiceConstructor { - new(): ArcGISDynamicMapService; - } - - export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor; - - interface ArcGISDynamicMapServiceProperties { - allSublayers?: Collection | any[]; - dpi?: number; - gdbVersion?: string; - imageFormat?: string; - imageMaxHeight?: number; - imageMaxWidth?: number; - imageTransparency?: boolean; - sublayers?: Collection | any[]; - } - - interface ArcGISImageService { - compressionQuality: number; - compressionTolerance: number; - copyright: string; - definitionExpression: string; - domainFields: Field[]; - fields: Field[]; - format: string; - fullExtent: Extent; - hasMultidimensions: boolean; - hasRasterAttributeTable: boolean; - imageMaxHeight: number; - imageMaxWidth: number; - mosaicRule: MosaicRule; - multidimensionalInfo: any; - pixelType: string; - popupTemplate: PopupTemplate; - rasterAttributeTable: any; - rasterAttributeTableFieldPrefix: string; - rasterFields: Field[]; - renderingRule: RasterFunction; - spatialReference: SpatialReference; - url: string; - version: number; - - fetchImage(extent: Extent, width: number, height: number): IPromise; - fromJSON(json: any): any; - toJSON(): any; - } - - interface ArcGISImageServiceConstructor { - new(properties?: ArcGISImageServiceProperties): ArcGISImageService; - - fromJSON(json: any): ArcGISImageService; - } - - export const ArcGISImageService: ArcGISImageServiceConstructor; - - interface ArcGISImageServiceProperties { - compressionQuality?: number; - compressionTolerance?: number; - copyright?: string; - definitionExpression?: string; - domainFields?: FieldProperties[]; - fields?: FieldProperties[]; - format?: string; - fullExtent?: ExtentProperties; - hasMultidimensions?: boolean; - hasRasterAttributeTable?: boolean; - imageMaxHeight?: number; - imageMaxWidth?: number; - mosaicRule?: MosaicRuleProperties; - multidimensionalInfo?: any; - pixelType?: string; - popupTemplate?: PopupTemplateProperties; - rasterAttributeTable?: any; - rasterAttributeTableFieldPrefix?: string; - rasterFields?: FieldProperties[]; - renderingRule?: RasterFunctionProperties; - spatialReference?: SpatialReferenceProperties; - url?: string; - version?: number; - } - - interface ArcGISMapService { - copyright: string; - fullExtent: Extent; - spatialReference: SpatialReference; - token: string; - } - - interface ArcGISMapServiceConstructor { - new(properties?: ArcGISMapServiceProperties): ArcGISMapService; - - fromJSON(json: any): ArcGISMapService; - } - - export const ArcGISMapService: ArcGISMapServiceConstructor; - - interface ArcGISMapServiceProperties { - copyright?: string; - fullExtent?: ExtentProperties; - spatialReference?: SpatialReferenceProperties; - token?: string; - } - - interface PortalLayer { - portalItem: PortalItem; - } - - interface PortalLayerConstructor { - new(properties?: PortalLayerProperties): PortalLayer; - - fromJSON(json: any): PortalLayer; - } - - export const PortalLayer: PortalLayerConstructor; - - interface PortalLayerProperties { - portalItem?: PortalItemProperties; - } - - interface ScaleRangeLayer { - maxScale: number; - minScale: number; - } - - interface ScaleRangeLayerConstructor { - new(): ScaleRangeLayer; - } - - export const ScaleRangeLayer: ScaleRangeLayerConstructor; - - interface ScaleRangeLayerProperties { - maxScale?: number; - minScale?: number; - } - - interface SceneService { - copyright: string; - layerId: number; - spatialReference: SpatialReference; - token: string; - url: string; - version: SceneServiceVersion; - } - - interface SceneServiceConstructor { - new(properties?: SceneServiceProperties): SceneService; - - fromJSON(json: any): SceneService; - } - - export const SceneService: SceneServiceConstructor; - - interface SceneServiceProperties { - copyright?: string; - layerId?: number; - spatialReference?: SpatialReferenceProperties; - token?: string; - url?: string; - version?: SceneServiceVersion; - } - - interface VisualVariablesMixin { - visualVariables: any[]; - } - - interface VisualVariablesMixinConstructor { - new(): VisualVariablesMixin; - } - - export const VisualVariablesMixin: VisualVariablesMixinConstructor; - - interface VisualVariablesMixinProperties { - visualVariables?: any[]; - } - - interface LayersMixin { - layers: Collection; - - add(layers: Layer, index?: number): void; - addMany(layers: Layer[], index?: number): void; - findLayerById(layerId: string): Layer; - remove(layer: Layer): Layer; - removeAll(): Layer[]; - removeMany(layers: Layer[]): Layer[]; - reorder(layer: Layer, index: number): Layer; - } - - interface LayersMixinConstructor { - new(): LayersMixin; - } - - export const LayersMixin: LayersMixinConstructor; - - interface LayersMixinProperties { - layers?: Collection | any[]; - } - - interface BreakpointsOwner { - breakpoints: BreakpointsOwnerBreakpoints; - heightBreakpoint: string; - orientation: string; - widthBreakpoint: string; - } - - interface BreakpointsOwnerConstructor { - new(): BreakpointsOwner; - } - - export const BreakpointsOwner: BreakpointsOwnerConstructor; - - interface BreakpointsOwnerProperties { - breakpoints?: BreakpointsOwnerBreakpoints; - heightBreakpoint?: string; - orientation?: string; - widthBreakpoint?: string; - } - - interface DOMContainer { - container: HTMLDivElement | string; - height: number; - popup: Popup; - resizing: boolean; - size: number[]; - suspended: boolean; - ui: DefaultUI; - width: number; - } - - interface DOMContainerConstructor { - new(): DOMContainer; - } - - export const DOMContainer: DOMContainerConstructor; - - interface DOMContainerProperties { - container?: HTMLDivElement | string; - height?: number; - popup?: PopupProperties; - resizing?: boolean; - size?: number[]; - suspended?: boolean; - ui?: DefaultUIProperties; - width?: number; - } - - interface Widgette { - container: string | any; - visible: boolean; - - destroy(): void; - } - - interface WidgetteConstructor { - new(): Widgette; - } - - export const Widgette: WidgetteConstructor; - - interface WidgetteProperties { - container?: string | any; - visible?: boolean; - } - - interface GeolocationPositioning { - geolocationOptions: any; - goToLocationEnabled: boolean; - graphic: Graphic; - view: MapView | SceneView; - } - - interface GeolocationPositioningConstructor { - new(): GeolocationPositioning; - } - - export const GeolocationPositioning: GeolocationPositioningConstructor; - - interface GeolocationPositioningProperties { - geolocationOptions?: any; - goToLocationEnabled?: boolean; - graphic?: GraphicProperties; - view?: MapView | SceneView; - } - - interface config { - geometryServiceUrl: string; - geoRSSServiceUrl: string; - portalUrl: string; - request: configRequest; - workers: configWorkers; - } - - export const config: config; - - interface kernel { - version: string; - } - - export const kernel: kernel; - - interface request { - esriRequest(url: string, options?: requestEsriRequestOptions): IPromise; - } - - const __requestMapped: request; - export const request: typeof __requestMapped.esriRequest; - - - interface lang { - clone(elem: any): any; - } - - export const lang: lang; - - interface promiseUtils { - eachAlways(promises: IPromise[] | any): IPromise | any; - reject(error?: any): IPromise; - resolve(value?: T): IPromise; - } - - export const promiseUtils: promiseUtils; - - interface requireUtils { - when(moduleRequire: any, moduleNames: string[] | string): IPromise; - } - - export const requireUtils: requireUtils; - - interface urlUtils { - addProxyRule(rule: urlUtilsAddProxyRuleRule): number; - getProxyRule(url: string): any; - urlToObject(url: string): any; - } - - export const urlUtils: urlUtils; - - interface watchUtils { - init(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; - on(obj: Accessor, propertyName: string, eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; - once(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - pausable(obj: Accessor, propertyName: string, callback?: WatchCallback): PausableWatchHandle; - watch(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - when(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenDefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenDefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenFalse(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenFalseOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenNot(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenNotOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenTrue(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenTrueOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenUndefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenUndefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - } - - export const watchUtils: watchUtils; - - interface decorators { - aliasOf(propertyName: string): Function; - cast(propertyName: string): Function; - cast(classFunction: Function): Function; - declared(baseClass: T, ...mixinClasses: any[]): T; - property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; - subclass(declaredClass?: string): Function; - } - - export const decorators: decorators; - - interface workers { - open(client: any, modulePath: string): IPromise; - } - - export const workers: workers; - - interface geometryEngine { - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; - clip(geometry: Geometry, envelope: Extent): Geometry; - contains(geometry1: Geometry, geometry2: Geometry): boolean; - convexHull(geometry: Geometry, merge?: boolean): Geometry | Geometry[]; - crosses(geometry1: Geometry, geometry2: Geometry): boolean; - cut(geometry: Geometry, cutter: Polyline): Geometry[]; - densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; - difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; - disjoint(geometry1: Geometry, geometry2: Geometry): boolean; - distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; - equals(geometry1: Geometry, geometry2: Geometry): boolean; - extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; - flipHorizontal(geometry: Geometry, flipOrigin?: Point): Geometry; - flipVertical(geometry: Geometry, flipOrigin?: Point): Geometry; - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; - geodesicArea(geometry: Polygon, unit: string | number): number; - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; - geodesicLength(geometry: Geometry, unit: string | number): number; - intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; - intersects(geometry1: Geometry, geometry2: Geometry): boolean; - isSimple(geometry: Geometry): boolean; - nearestCoordinate(geometry: Geometry, inputPoint: Point): any; - nearestVertex(geometry: Geometry, inputPoint: Point): any; - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): any[]; - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; - overlaps(geometry1: Geometry, geometry2: Geometry): boolean; - planarArea(geometry: Polygon, unit: string | number): number; - planarLength(geometry: Geometry, unit: string | number): number; - relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; - rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; - simplify(geometry: Geometry): Geometry; - symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; - touches(geometry1: Geometry, geometry2: Geometry): boolean; - union(geometries: Geometry[]): Geometry; - within(geometry1: Geometry, geometry2: Geometry): boolean; - } - - export const geometryEngine: geometryEngine; - - interface geometryEngineAsync { - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; - clip(geometry: Geometry, envelope: Extent): IPromise; - contains(geometry1: Geometry, geometry2: Geometry): IPromise; - convexHull(geometry: Geometry, merge?: boolean): IPromise; - crosses(geometry1: Geometry, geometry2: Geometry): IPromise; - cut(geometry: Geometry, cutter: Polyline): IPromise; - densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; - difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): IPromise; - disjoint(geometry1: Geometry, geometry2: Geometry): IPromise; - distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): IPromise; - equals(geometry1: Geometry, geometry2: Geometry): IPromise; - extendedSpatialReferenceInfo(spatialReference: SpatialReference): IPromise; - flipHorizontal(geometry: Geometry, flipOrigin?: Point): IPromise; - flipVertical(geometry: Geometry, flipOrigin?: Point): IPromise; - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): IPromise; - geodesicArea(geometry: Polygon, unit: string | number): IPromise; - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; - geodesicLength(geometry: Geometry, unit: string | number): IPromise; - intersect(geometry: Geometry | Geometry[], intersector: Geometry): IPromise; - intersects(geometry1: Geometry, geometry2: Geometry): IPromise; - isSimple(geometry: Geometry): IPromise; - nearestCoordinate(geometry: Geometry, inputPoint: Point): IPromise; - nearestVertex(geometry: Geometry, inputPoint: Point): IPromise; - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): IPromise; - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): IPromise; - overlaps(geometry1: Geometry, geometry2: Geometry): IPromise; - planarArea(geometry: Polygon, unit: string | number): IPromise; - planarLength(geometry: Geometry, unit: string | number): IPromise; - relate(geometry1: Geometry, geometry2: Geometry, relation: string): IPromise; - rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): IPromise; - simplify(geometry: Geometry): IPromise; - symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): IPromise; - touches(geometry1: Geometry, geometry2: Geometry): IPromise; - union(geometries: Geometry[]): IPromise; - within(geometry1: Geometry, geometry2: Geometry): IPromise; - } - - export const geometryEngineAsync: geometryEngineAsync; - - interface jsonUtils { - fromJSON(json: any): Geometry; - getJsonType(geometry: Geometry): string; - } - - export const jsonUtils: jsonUtils; - - interface normalizeUtils { - normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; - } - - export const normalizeUtils: normalizeUtils; - - interface webMercatorUtils { - canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; - geographicToWebMercator(geometry: Geometry): Geometry; - lngLatToXY(long: number, lat: number): number[]; - project(geometry: Geometry, spatialReference: SpatialReference | any): Geometry; - webMercatorToGeographic(geometry: Geometry): Geometry; - xyToLngLat(x: number, y: number): number[]; - } - - export const webMercatorUtils: webMercatorUtils; - - interface color { - createContinuousRenderer(params: colorCreateContinuousRendererParams): IPromise; - createVisualVariable(params: colorCreateVisualVariableParams): IPromise; - } - - export const color: color; - - interface location { - createRenderer(params: locationCreateRendererParams): IPromise; - } - - export const location: location; - - interface size { - createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; - createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; - } - - export const size: size; - - interface type { - createRenderer(params: typeCreateRendererParams): IPromise; - } - - export const type: type; - - interface univariateColorSize { - createContinuousRenderer(params: univariateColorSizeCreateContinuousRendererParams): IPromise; - createVisualVariables(params: univariateColorSizeCreateVisualVariablesParams): IPromise; - } - - export const univariateColorSize: univariateColorSize; - - interface classBreaks { - classBreaks(params: classBreaksClassBreaksParams): IPromise; - } - - const __classBreaksMapped: classBreaks; - export const classBreaks: typeof __classBreaksMapped.classBreaks; - - - interface histogram { - histogram(params: histogramHistogramParams): IPromise; - } - - const __histogramMapped: histogram; - export const histogram: typeof __histogramMapped.histogram; - - - interface summaryStatistics { - summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; - } - - const __summaryStatisticsMapped: summaryStatistics; - export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; - - - interface uniqueValues { - uniqueValues(params: uniqueValuesUniqueValuesParams): IPromise; - } - - const __uniqueValuesMapped: uniqueValues; - export const uniqueValues: typeof __uniqueValuesMapped.uniqueValues; - - - interface symbologyColor { - cloneScheme(scheme: any): any; - flipColors(scheme: any): any; - getSchemes(params: colorGetSchemesParams): any; - getThemes(basemap?: string | Basemap): any[]; - } - - export const symbologyColor: symbologyColor; - - interface symbologyLocation { - cloneScheme(scheme: any | any | any): any | any | any; - getSchemes(params: locationGetSchemesParams): any; - } - - export const symbologyLocation: symbologyLocation; - - interface symbologySize { - cloneScheme(scheme: any | any | any): any; - getSchemes(params: sizeGetSchemesParams): any; - } - - export const symbologySize: symbologySize; - - interface symbologyType { - cloneScheme(scheme: any | any | any): any; - getSchemes(params: typeGetSchemesParams): any; - } - - export const symbologyType: symbologyType; - - interface supportJsonUtils { - fromJSON(json: any): Renderer; - } - - export const supportJsonUtils: supportJsonUtils; - - interface symbolsSupportJsonUtils { - fromJSON(json: any): Symbol; - } - - export const symbolsSupportJsonUtils: symbolsSupportJsonUtils; - - interface externalRenderers { - add(view: SceneView, renderer: any): void; - fromRenderCoordinates(view: SceneView, srcCoordinates: number[], srcStart: number, destCoordinates: number[], destStart: number, destSpatialReference: SpatialReference, count: number): number[]; - remove(view: SceneView, renderer: any): void; - renderCoordinateTransformAt(view: SceneView, origin: number[], srcSpatialReference: SpatialReference, dest: number[]): number[]; - requestRender(view: SceneView): void; - toRenderCoordinates(view: SceneView, srcCoordinates: number[], srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[], destStart: number, count: number): number[]; - } - - export const externalRenderers: externalRenderers; - - interface widget { - accessibleHandler(): Function; - join(...classNames: string[]): string; - renderable(propertyName?: string | string[]): Function; - tsx(selector: string, properties?: any, children?: any): any; - vmEvent(eventNames: string | string[]): Function; - } - - export const widget: widget; - - interface BasemapGalleryItem { - basemap: Basemap; - error: Error; - state: string; - view: MapView | SceneView; - } - - export const BasemapGalleryItem: BasemapGalleryItem; - - interface LocalBasemapsSource { - basemaps: Collection; - state: string; - } - - export const LocalBasemapsSource: LocalBasemapsSource; - - interface PortalBasemapsSource { - basemaps: Collection; - filterFunction: Function; - portal: Portal; - state: string; - } - - export const PortalBasemapsSource: PortalBasemapsSource; -} - -declare module "esri" { - export import PromisedWatchHandle = __esri.PromisedWatchHandle; - export import ItemCallback = __esri.ItemCallback; - - export import ItemCompareCallback = __esri.ItemCompareCallback; - - export import ItemMapCallback = __esri.ItemMapCallback; - - export import ItemReduceCallback = __esri.ItemReduceCallback; - - export import ItemTestCallback = __esri.ItemTestCallback; - - export import PortalItemFetchRelatedItemsParams = __esri.PortalItemFetchRelatedItemsParams; - - export import PortalItemUpdateParams = __esri.PortalItemUpdateParams; - - export import PortalUserAddItemParams = __esri.PortalUserAddItemParams; - - export import PortalUserFetchItemsParams = __esri.PortalUserFetchItemsParams; - - export import PortalFeaturedGroups = __esri.PortalFeaturedGroups; - - export import GroundQueryElevationOptions = __esri.GroundQueryElevationOptions; - - export import PopupTemplateExpressionInfos = __esri.PopupTemplateExpressionInfos; - - export import PopupTemplateFieldInfos = __esri.PopupTemplateFieldInfos; - - export import PopupTemplateFieldInfosFormat = __esri.PopupTemplateFieldInfosFormat; - - export import FeatureLayerApplyEditsEdits = __esri.FeatureLayerApplyEditsEdits; - - export import FeatureLayerCapabilities = __esri.FeatureLayerCapabilities; - - export import FeatureLayerCapabilitiesData = __esri.FeatureLayerCapabilitiesData; - - export import FeatureLayerCapabilitiesEditing = __esri.FeatureLayerCapabilitiesEditing; - - export import FeatureLayerCapabilitiesOperations = __esri.FeatureLayerCapabilitiesOperations; - - export import FeatureLayerCapabilitiesQuery = __esri.FeatureLayerCapabilitiesQuery; - - export import FeatureLayerCapabilitiesQueryRelated = __esri.FeatureLayerCapabilitiesQueryRelated; - - export import FeatureLayerElevationInfo = __esri.FeatureLayerElevationInfo; - - export import FeatureLayerFeatureReduction = __esri.FeatureLayerFeatureReduction; - - export import FeatureLayerGetFieldDomainOptions = __esri.FeatureLayerGetFieldDomainOptions; - - export import FeatureLayerLayerviewCreateEvent = __esri.FeatureLayerLayerviewCreateEvent; - - export import FeatureLayerLayerviewCreateEventHandler = __esri.FeatureLayerLayerviewCreateEventHandler; - - export import FeatureLayerLayerviewDestroyEvent = __esri.FeatureLayerLayerviewDestroyEvent; - - export import FeatureLayerLayerviewDestroyEventHandler = __esri.FeatureLayerLayerviewDestroyEventHandler; - - export import GraphicsLayerElevationInfo = __esri.GraphicsLayerElevationInfo; - - export import GraphicsLayerLayerviewCreateEvent = __esri.GraphicsLayerLayerviewCreateEvent; - - export import GraphicsLayerLayerviewCreateEventHandler = __esri.GraphicsLayerLayerviewCreateEventHandler; - - export import GraphicsLayerLayerviewDestroyEvent = __esri.GraphicsLayerLayerviewDestroyEvent; - - export import GraphicsLayerLayerviewDestroyEventHandler = __esri.GraphicsLayerLayerviewDestroyEventHandler; - - export import LayerFromArcGISServerUrlParams = __esri.LayerFromArcGISServerUrlParams; - - export import LayerFromPortalItemParams = __esri.LayerFromPortalItemParams; - - export import FeatureTemplateThumbnail = __esri.FeatureTemplateThumbnail; - - export import LabelClassLabelExpressionInfo = __esri.LabelClassLabelExpressionInfo; - - export import LabelSymbol3DVerticalOffsetProperties = __esri.LabelSymbol3DVerticalOffsetProperties; - export import LabelSymbol3DVerticalOffset = __esri.LabelSymbol3DVerticalOffset; - - export import QueryQuantizationParameters = __esri.QueryQuantizationParameters; - - export import ViewPadding = __esri.ViewPadding; - - export import WebMapSourceVersion = __esri.WebMapSourceVersion; - - export import WebSceneSaveAsOptions = __esri.WebSceneSaveAsOptions; - - export import WebSceneSaveOptions = __esri.WebSceneSaveOptions; - - export import WebSceneSourceVersion = __esri.WebSceneSourceVersion; - - export import WebSceneUpdateFromOptions = __esri.WebSceneUpdateFromOptions; - - export import EventHandler = __esri.EventHandler; - - export import SceneViewDragEventOrigin = __esri.SceneViewDragEventOrigin; - - export import SceneViewClickEvent = __esri.SceneViewClickEvent; - - export import SceneViewClickEventHandler = __esri.SceneViewClickEventHandler; - - export import SceneViewDoubleClickEvent = __esri.SceneViewDoubleClickEvent; - - export import SceneViewDoubleClickEventHandler = __esri.SceneViewDoubleClickEventHandler; - - export import SceneViewDragEvent = __esri.SceneViewDragEvent; - - export import SceneViewDragEventHandler = __esri.SceneViewDragEventHandler; - - export import EasingFunction = __esri.EasingFunction; - - export import SceneViewHoldEvent = __esri.SceneViewHoldEvent; - - export import SceneViewHoldEventHandler = __esri.SceneViewHoldEventHandler; - - export import SceneViewKeyDownEvent = __esri.SceneViewKeyDownEvent; - - export import SceneViewKeyDownEventHandler = __esri.SceneViewKeyDownEventHandler; - - export import SceneViewKeyUpEvent = __esri.SceneViewKeyUpEvent; - - export import SceneViewKeyUpEventHandler = __esri.SceneViewKeyUpEventHandler; - - export import SceneViewLayerviewCreateEvent = __esri.SceneViewLayerviewCreateEvent; - - export import SceneViewLayerviewCreateEventHandler = __esri.SceneViewLayerviewCreateEventHandler; - - export import SceneViewLayerviewDestroyEvent = __esri.SceneViewLayerviewDestroyEvent; - - export import SceneViewLayerviewDestroyEventHandler = __esri.SceneViewLayerviewDestroyEventHandler; - - export import SceneViewMouseWheelEvent = __esri.SceneViewMouseWheelEvent; - - export import SceneViewMouseWheelEventHandler = __esri.SceneViewMouseWheelEventHandler; - - export import SceneViewPointerDownEvent = __esri.SceneViewPointerDownEvent; - - export import SceneViewPointerDownEventHandler = __esri.SceneViewPointerDownEventHandler; - - export import SceneViewPointerMoveEvent = __esri.SceneViewPointerMoveEvent; - - export import SceneViewPointerMoveEventHandler = __esri.SceneViewPointerMoveEventHandler; - - export import SceneViewPointerUpEvent = __esri.SceneViewPointerUpEvent; - - export import SceneViewPointerUpEventHandler = __esri.SceneViewPointerUpEventHandler; - - export import SceneViewResizeEvent = __esri.SceneViewResizeEvent; - - export import SceneViewResizeEventHandler = __esri.SceneViewResizeEventHandler; - - export import SceneViewConstraintsProperties = __esri.SceneViewConstraintsProperties; - export import SceneViewConstraints = __esri.SceneViewConstraints; - - export import SceneViewConstraintsAltitudeProperties = __esri.SceneViewConstraintsAltitudeProperties; - export import SceneViewConstraintsAltitude = __esri.SceneViewConstraintsAltitude; - - export import SceneViewConstraintsClipDistanceProperties = __esri.SceneViewConstraintsClipDistanceProperties; - export import SceneViewConstraintsClipDistance = __esri.SceneViewConstraintsClipDistance; - - export import SceneViewConstraintsCollision = __esri.SceneViewConstraintsCollision; - - export import SceneViewConstraintsTiltProperties = __esri.SceneViewConstraintsTiltProperties; - export import SceneViewConstraintsTilt = __esri.SceneViewConstraintsTilt; - - export import SceneViewEnvironmentProperties = __esri.SceneViewEnvironmentProperties; - export import SceneViewEnvironment = __esri.SceneViewEnvironment; - - export import SceneViewEnvironmentAtmosphereProperties = __esri.SceneViewEnvironmentAtmosphereProperties; - export import SceneViewEnvironmentAtmosphere = __esri.SceneViewEnvironmentAtmosphere; - - export import SceneViewEnvironmentLightingProperties = __esri.SceneViewEnvironmentLightingProperties; - export import SceneViewEnvironmentLighting = __esri.SceneViewEnvironmentLighting; - - export import SceneViewGoToOptions = __esri.SceneViewGoToOptions; - - export import SceneViewHighlightOptions = __esri.SceneViewHighlightOptions; - - export import SceneViewHitTestScreenPoint = __esri.SceneViewHitTestScreenPoint; - - export import SceneViewToMapScreenPoint = __esri.SceneViewToMapScreenPoint; - - export import WatchHandle = __esri.WatchHandle; - - export import WatchCallback = __esri.WatchCallback; - - export import IdentityManagerBaseGenerateTokenOptions = __esri.IdentityManagerBaseGenerateTokenOptions; - - export import IdentityManagerBaseGetCredentialOptions = __esri.IdentityManagerBaseGetCredentialOptions; - - export import IdentityManagerBaseOAuthSignInOptions = __esri.IdentityManagerBaseOAuthSignInOptions; - - export import IdentityManagerBaseRegisterTokenProperties = __esri.IdentityManagerBaseRegisterTokenProperties; - - export import IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction = __esri.IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction; - - export import IdentityManagerBaseSetRedirectionHandlerHandlerFunction = __esri.IdentityManagerBaseSetRedirectionHandlerHandlerFunction; - - export import IdentityManagerBaseSignInOptions = __esri.IdentityManagerBaseSignInOptions; - - export import IdentityManagerCredentialCreateEvent = __esri.IdentityManagerCredentialCreateEvent; - - export import IdentityManagerCredentialCreateEventHandler = __esri.IdentityManagerCredentialCreateEventHandler; - - export import IdentityManagerCredentialsDestroyEvent = __esri.IdentityManagerCredentialsDestroyEvent; - - export import IdentityManagerCredentialsDestroyEventHandler = __esri.IdentityManagerCredentialsDestroyEventHandler; - - export import HandlerCallback = __esri.HandlerCallback; - - export import BaseElevationLayerFetchTileOptions = __esri.BaseElevationLayerFetchTileOptions; - - export import BaseElevationLayerLayerviewCreateEvent = __esri.BaseElevationLayerLayerviewCreateEvent; - - export import BaseElevationLayerLayerviewCreateEventHandler = __esri.BaseElevationLayerLayerviewCreateEventHandler; - - export import BaseElevationLayerLayerviewDestroyEvent = __esri.BaseElevationLayerLayerviewDestroyEvent; - - export import BaseElevationLayerLayerviewDestroyEventHandler = __esri.BaseElevationLayerLayerviewDestroyEventHandler; - - export import CSVLayerElevationInfo = __esri.CSVLayerElevationInfo; - - export import CSVLayerFeatureReduction = __esri.CSVLayerFeatureReduction; - - export import CSVLayerLayerviewCreateEvent = __esri.CSVLayerLayerviewCreateEvent; - - export import CSVLayerLayerviewCreateEventHandler = __esri.CSVLayerLayerviewCreateEventHandler; - - export import CSVLayerLayerviewDestroyEvent = __esri.CSVLayerLayerviewDestroyEvent; - - export import CSVLayerLayerviewDestroyEventHandler = __esri.CSVLayerLayerviewDestroyEventHandler; - - export import ElevationLayerQueryElevationOptions = __esri.ElevationLayerQueryElevationOptions; - - export import ElevationLayerLayerviewCreateEvent = __esri.ElevationLayerLayerviewCreateEvent; - - export import ElevationLayerLayerviewCreateEventHandler = __esri.ElevationLayerLayerviewCreateEventHandler; - - export import ElevationLayerLayerviewDestroyEvent = __esri.ElevationLayerLayerviewDestroyEvent; - - export import ElevationLayerLayerviewDestroyEventHandler = __esri.ElevationLayerLayerviewDestroyEventHandler; - - export import GeoRSSLayerLayerviewCreateEvent = __esri.GeoRSSLayerLayerviewCreateEvent; - - export import GeoRSSLayerLayerviewCreateEventHandler = __esri.GeoRSSLayerLayerviewCreateEventHandler; - - export import GeoRSSLayerLayerviewDestroyEvent = __esri.GeoRSSLayerLayerviewDestroyEvent; - - export import GeoRSSLayerLayerviewDestroyEventHandler = __esri.GeoRSSLayerLayerviewDestroyEventHandler; - - export import GroupLayerLayerviewCreateEvent = __esri.GroupLayerLayerviewCreateEvent; - - export import GroupLayerLayerviewCreateEventHandler = __esri.GroupLayerLayerviewCreateEventHandler; - - export import GroupLayerLayerviewDestroyEvent = __esri.GroupLayerLayerviewDestroyEvent; - - export import GroupLayerLayerviewDestroyEventHandler = __esri.GroupLayerLayerviewDestroyEventHandler; - - export import ImageryLayerLayerviewCreateEvent = __esri.ImageryLayerLayerviewCreateEvent; - - export import ImageryLayerLayerviewCreateEventHandler = __esri.ImageryLayerLayerviewCreateEventHandler; - - export import ImageryLayerLayerviewDestroyEvent = __esri.ImageryLayerLayerviewDestroyEvent; - - export import ImageryLayerLayerviewDestroyEventHandler = __esri.ImageryLayerLayerviewDestroyEventHandler; - - export import IntegratedMeshLayerLayerviewCreateEvent = __esri.IntegratedMeshLayerLayerviewCreateEvent; - - export import IntegratedMeshLayerLayerviewCreateEventHandler = __esri.IntegratedMeshLayerLayerviewCreateEventHandler; - - export import IntegratedMeshLayerLayerviewDestroyEvent = __esri.IntegratedMeshLayerLayerviewDestroyEvent; - - export import IntegratedMeshLayerLayerviewDestroyEventHandler = __esri.IntegratedMeshLayerLayerviewDestroyEventHandler; - - export import MapImageLayerLayerviewCreateEvent = __esri.MapImageLayerLayerviewCreateEvent; - - export import MapImageLayerLayerviewCreateEventHandler = __esri.MapImageLayerLayerviewCreateEventHandler; - - export import MapImageLayerLayerviewDestroyEvent = __esri.MapImageLayerLayerviewDestroyEvent; - - export import MapImageLayerLayerviewDestroyEventHandler = __esri.MapImageLayerLayerviewDestroyEventHandler; - - export import MapNotesLayerLayerviewCreateEvent = __esri.MapNotesLayerLayerviewCreateEvent; - - export import MapNotesLayerLayerviewCreateEventHandler = __esri.MapNotesLayerLayerviewCreateEventHandler; - - export import MapNotesLayerLayerviewDestroyEvent = __esri.MapNotesLayerLayerviewDestroyEvent; - - export import MapNotesLayerLayerviewDestroyEventHandler = __esri.MapNotesLayerLayerviewDestroyEventHandler; - - export import OpenStreetMapLayerLayerviewCreateEvent = __esri.OpenStreetMapLayerLayerviewCreateEvent; - - export import OpenStreetMapLayerLayerviewCreateEventHandler = __esri.OpenStreetMapLayerLayerviewCreateEventHandler; - - export import OpenStreetMapLayerLayerviewDestroyEvent = __esri.OpenStreetMapLayerLayerviewDestroyEvent; - - export import OpenStreetMapLayerLayerviewDestroyEventHandler = __esri.OpenStreetMapLayerLayerviewDestroyEventHandler; - - export import PointCloudLayerLayerviewCreateEvent = __esri.PointCloudLayerLayerviewCreateEvent; - - export import PointCloudLayerLayerviewCreateEventHandler = __esri.PointCloudLayerLayerviewCreateEventHandler; - - export import PointCloudLayerLayerviewDestroyEvent = __esri.PointCloudLayerLayerviewDestroyEvent; - - export import PointCloudLayerLayerviewDestroyEventHandler = __esri.PointCloudLayerLayerviewDestroyEventHandler; - - export import PointCloudLayerElevationInfo = __esri.PointCloudLayerElevationInfo; - - export import PointCloudRendererColorModulation = __esri.PointCloudRendererColorModulation; - - export import PointCloudRendererPointSizeAlgorithm = __esri.PointCloudRendererPointSizeAlgorithm; - - export import SceneLayerLayerviewCreateEvent = __esri.SceneLayerLayerviewCreateEvent; - - export import SceneLayerLayerviewCreateEventHandler = __esri.SceneLayerLayerviewCreateEventHandler; - - export import SceneLayerLayerviewDestroyEvent = __esri.SceneLayerLayerviewDestroyEvent; - - export import SceneLayerLayerviewDestroyEventHandler = __esri.SceneLayerLayerviewDestroyEventHandler; - - export import SceneLayerElevationInfo = __esri.SceneLayerElevationInfo; - - export import SceneLayerFeatureReduction = __esri.SceneLayerFeatureReduction; - - export import StreamLayerLayerviewCreateEvent = __esri.StreamLayerLayerviewCreateEvent; - - export import StreamLayerLayerviewCreateEventHandler = __esri.StreamLayerLayerviewCreateEventHandler; - - export import StreamLayerLayerviewDestroyEvent = __esri.StreamLayerLayerviewDestroyEvent; - - export import StreamLayerLayerviewDestroyEventHandler = __esri.StreamLayerLayerviewDestroyEventHandler; - - export import StreamLayerFilter = __esri.StreamLayerFilter; - - export import StreamLayerPurgeOptions = __esri.StreamLayerPurgeOptions; - - export import StreamLayerUpdateFilterFilterChanges = __esri.StreamLayerUpdateFilterFilterChanges; - - export import TileLayerLayerviewCreateEvent = __esri.TileLayerLayerviewCreateEvent; - - export import TileLayerLayerviewCreateEventHandler = __esri.TileLayerLayerviewCreateEventHandler; - - export import TileLayerLayerviewDestroyEvent = __esri.TileLayerLayerviewDestroyEvent; - - export import TileLayerLayerviewDestroyEventHandler = __esri.TileLayerLayerviewDestroyEventHandler; - - export import TileLayerFetchTileOptions = __esri.TileLayerFetchTileOptions; - - export import UnknownLayerLayerviewCreateEvent = __esri.UnknownLayerLayerviewCreateEvent; - - export import UnknownLayerLayerviewCreateEventHandler = __esri.UnknownLayerLayerviewCreateEventHandler; - - export import UnknownLayerLayerviewDestroyEvent = __esri.UnknownLayerLayerviewDestroyEvent; - - export import UnknownLayerLayerviewDestroyEventHandler = __esri.UnknownLayerLayerviewDestroyEventHandler; - - export import UnsupportedLayerLayerviewCreateEvent = __esri.UnsupportedLayerLayerviewCreateEvent; - - export import UnsupportedLayerLayerviewCreateEventHandler = __esri.UnsupportedLayerLayerviewCreateEventHandler; - - export import UnsupportedLayerLayerviewDestroyEvent = __esri.UnsupportedLayerLayerviewDestroyEvent; - - export import UnsupportedLayerLayerviewDestroyEventHandler = __esri.UnsupportedLayerLayerviewDestroyEventHandler; - - export import VectorTileLayerLayerviewCreateEvent = __esri.VectorTileLayerLayerviewCreateEvent; - - export import VectorTileLayerLayerviewCreateEventHandler = __esri.VectorTileLayerLayerviewCreateEventHandler; - - export import VectorTileLayerLayerviewDestroyEvent = __esri.VectorTileLayerLayerviewDestroyEvent; - - export import VectorTileLayerLayerviewDestroyEventHandler = __esri.VectorTileLayerLayerviewDestroyEventHandler; - - export import VectorTileLayerCurrentStyleInfo = __esri.VectorTileLayerCurrentStyleInfo; - - export import WebTileLayerLayerviewCreateEvent = __esri.WebTileLayerLayerviewCreateEvent; - - export import WebTileLayerLayerviewCreateEventHandler = __esri.WebTileLayerLayerviewCreateEventHandler; - - export import WebTileLayerLayerviewDestroyEvent = __esri.WebTileLayerLayerviewDestroyEvent; - - export import WebTileLayerLayerviewDestroyEventHandler = __esri.WebTileLayerLayerviewDestroyEventHandler; - - export import WMSLayerLayerviewCreateEvent = __esri.WMSLayerLayerviewCreateEvent; - - export import WMSLayerLayerviewCreateEventHandler = __esri.WMSLayerLayerviewCreateEventHandler; - - export import WMSLayerLayerviewDestroyEvent = __esri.WMSLayerLayerviewDestroyEvent; - - export import WMSLayerLayerviewDestroyEventHandler = __esri.WMSLayerLayerviewDestroyEventHandler; - - export import WMSLayerFetchImageOptions = __esri.WMSLayerFetchImageOptions; - - export import WMTSLayerLayerviewCreateEvent = __esri.WMTSLayerLayerviewCreateEvent; - - export import WMTSLayerLayerviewCreateEventHandler = __esri.WMTSLayerLayerviewCreateEventHandler; - - export import WMTSLayerLayerviewDestroyEvent = __esri.WMTSLayerLayerviewDestroyEvent; - - export import WMTSLayerLayerviewDestroyEventHandler = __esri.WMTSLayerLayerviewDestroyEventHandler; - - export import BaseDynamicLayerFetchImageOptions = __esri.BaseDynamicLayerFetchImageOptions; - - export import BaseDynamicLayerLayerviewCreateEvent = __esri.BaseDynamicLayerLayerviewCreateEvent; - - export import BaseDynamicLayerLayerviewCreateEventHandler = __esri.BaseDynamicLayerLayerviewCreateEventHandler; - - export import BaseDynamicLayerLayerviewDestroyEvent = __esri.BaseDynamicLayerLayerviewDestroyEvent; - - export import BaseDynamicLayerLayerviewDestroyEventHandler = __esri.BaseDynamicLayerLayerviewDestroyEventHandler; - - export import BaseTileLayerFetchTileOptions = __esri.BaseTileLayerFetchTileOptions; - - export import BaseTileLayerLayerviewCreateEvent = __esri.BaseTileLayerLayerviewCreateEvent; - - export import BaseTileLayerLayerviewCreateEventHandler = __esri.BaseTileLayerLayerviewCreateEventHandler; - - export import BaseTileLayerLayerviewDestroyEvent = __esri.BaseTileLayerLayerviewDestroyEvent; - - export import BaseTileLayerLayerviewDestroyEventHandler = __esri.BaseTileLayerLayerviewDestroyEventHandler; - - export import CodedValueDomainCodedValues = __esri.CodedValueDomainCodedValues; - - export import PixelBlockAddDataPlaneData = __esri.PixelBlockAddDataPlaneData; - - export import PixelBlockStatistics = __esri.PixelBlockStatistics; - - export import ClassBreaksRendererClassBreakInfos = __esri.ClassBreaksRendererClassBreakInfos; - - export import ClassBreaksRendererLegendOptions = __esri.ClassBreaksRendererLegendOptions; - - export import UniqueValueRendererLegendOptions = __esri.UniqueValueRendererLegendOptions; - - export import UniqueValueRendererUniqueValueInfos = __esri.UniqueValueRendererUniqueValueInfos; - - export import PointCloudClassBreaksRendererColorClassBreakInfos = __esri.PointCloudClassBreaksRendererColorClassBreakInfos; - - export import PointCloudStretchRendererStops = __esri.PointCloudStretchRendererStops; - - export import PointCloudUniqueValueRendererColorUniqueValueInfos = __esri.PointCloudUniqueValueRendererColorUniqueValueInfos; - - export import FillSymbol3DLayerOutline = __esri.FillSymbol3DLayerOutline; - - export import IconSymbol3DLayerOutline = __esri.IconSymbol3DLayerOutline; - - export import IconSymbol3DLayerResource = __esri.IconSymbol3DLayerResource; - - export import ObjectSymbol3DLayerResource = __esri.ObjectSymbol3DLayerResource; - - export import PointSymbol3DVerticalOffsetProperties = __esri.PointSymbol3DVerticalOffsetProperties; - export import PointSymbol3DVerticalOffset = __esri.PointSymbol3DVerticalOffset; - - export import Symbol3DStyleOrigin = __esri.Symbol3DStyleOrigin; - - export import TextSymbol3DLayerFont = __esri.TextSymbol3DLayerFont; - - export import TextSymbol3DLayerHalo = __esri.TextSymbol3DLayerHalo; - - export import LineCallout3DBorderProperties = __esri.LineCallout3DBorderProperties; - export import LineCallout3DBorder = __esri.LineCallout3DBorder; - - export import ClosestFacilityParametersAttributeParameterValues = __esri.ClosestFacilityParametersAttributeParameterValues; - - export import GeometryServiceFromGeoCoordinateStringParams = __esri.GeometryServiceFromGeoCoordinateStringParams; - - export import GeometryServiceToGeoCoordinateStringParams = __esri.GeometryServiceToGeoCoordinateStringParams; - - export import ProjectParametersTransformation = __esri.ProjectParametersTransformation; - - export import LocatorAddressToLocationsParams = __esri.LocatorAddressToLocationsParams; - - export import LocatorAddressesToLocationsParams = __esri.LocatorAddressesToLocationsParams; - - export import LocatorSuggestLocationsParams = __esri.LocatorSuggestLocationsParams; - - export import PrintTemplateExportOptions = __esri.PrintTemplateExportOptions; - - export import PrintTemplateLayoutOptions = __esri.PrintTemplateLayoutOptions; - - export import MapViewDragEventOrigin = __esri.MapViewDragEventOrigin; - - export import MapViewClickEvent = __esri.MapViewClickEvent; - - export import MapViewClickEventHandler = __esri.MapViewClickEventHandler; - - export import MapViewDoubleClickEvent = __esri.MapViewDoubleClickEvent; - - export import MapViewDoubleClickEventHandler = __esri.MapViewDoubleClickEventHandler; - - export import MapViewDragEvent = __esri.MapViewDragEvent; - - export import MapViewDragEventHandler = __esri.MapViewDragEventHandler; - - export import MapViewHoldEvent = __esri.MapViewHoldEvent; - - export import MapViewHoldEventHandler = __esri.MapViewHoldEventHandler; - - export import MapViewKeyDownEvent = __esri.MapViewKeyDownEvent; - - export import MapViewKeyDownEventHandler = __esri.MapViewKeyDownEventHandler; - - export import MapViewKeyUpEvent = __esri.MapViewKeyUpEvent; - - export import MapViewKeyUpEventHandler = __esri.MapViewKeyUpEventHandler; - - export import MapViewLayerviewCreateEvent = __esri.MapViewLayerviewCreateEvent; - - export import MapViewLayerviewCreateEventHandler = __esri.MapViewLayerviewCreateEventHandler; - - export import MapViewLayerviewDestroyEvent = __esri.MapViewLayerviewDestroyEvent; - - export import MapViewLayerviewDestroyEventHandler = __esri.MapViewLayerviewDestroyEventHandler; - - export import MapViewConstraints = __esri.MapViewConstraints; - - export import MapViewGoToOptions = __esri.MapViewGoToOptions; - - export import MapViewHitTestScreenPoint = __esri.MapViewHitTestScreenPoint; - - export import MapViewToMapScreenPoint = __esri.MapViewToMapScreenPoint; - - export import MapViewMouseWheelEvent = __esri.MapViewMouseWheelEvent; - - export import MapViewMouseWheelEventHandler = __esri.MapViewMouseWheelEventHandler; - - export import MapViewPointerDownEvent = __esri.MapViewPointerDownEvent; - - export import MapViewPointerDownEventHandler = __esri.MapViewPointerDownEventHandler; - - export import MapViewPointerMoveEvent = __esri.MapViewPointerMoveEvent; - - export import MapViewPointerMoveEventHandler = __esri.MapViewPointerMoveEventHandler; - - export import MapViewPointerUpEvent = __esri.MapViewPointerUpEvent; - - export import MapViewPointerUpEventHandler = __esri.MapViewPointerUpEventHandler; - - export import MapViewResizeEvent = __esri.MapViewResizeEvent; - - export import MapViewResizeEventHandler = __esri.MapViewResizeEventHandler; - - export import AttributeParamValue = __esri.AttributeParamValue; - - export import ConfigurationTaskGetDataWorkspaceDetailsParams = __esri.ConfigurationTaskGetDataWorkspaceDetailsParams; - - export import ConfigurationTaskGetUserJobQueryDetailsParams = __esri.ConfigurationTaskGetUserJobQueryDetailsParams; - - export import AuxRecordDescription = __esri.AuxRecordDescription; - - export import JobCreationParameters = __esri.JobCreationParameters; - - export import JobQueryParameters = __esri.JobQueryParameters; - - export import JobTaskAddEmbeddedAttachmentParams = __esri.JobTaskAddEmbeddedAttachmentParams; - - export import JobTaskAddLinkedAttachmentParams = __esri.JobTaskAddLinkedAttachmentParams; - - export import JobTaskAddLinkedRecordParams = __esri.JobTaskAddLinkedRecordParams; - - export import JobTaskAssignJobsParams = __esri.JobTaskAssignJobsParams; - - export import JobTaskCloseJobsParams = __esri.JobTaskCloseJobsParams; - - export import JobTaskCreateDependencyParams = __esri.JobTaskCreateDependencyParams; - - export import JobTaskCreateHoldParams = __esri.JobTaskCreateHoldParams; - - export import JobTaskCreateJobVersionParams = __esri.JobTaskCreateJobVersionParams; - - export import JobTaskDeleteAttachmentParams = __esri.JobTaskDeleteAttachmentParams; - - export import JobTaskDeleteDependencyParams = __esri.JobTaskDeleteDependencyParams; - - export import JobTaskDeleteJobsParams = __esri.JobTaskDeleteJobsParams; - - export import JobTaskDeleteLinkedRecordParams = __esri.JobTaskDeleteLinkedRecordParams; - - export import JobTaskGetAttachmentContentUrlParams = __esri.JobTaskGetAttachmentContentUrlParams; - - export import JobTaskListFieldValuesParams = __esri.JobTaskListFieldValuesParams; - - export import JobTaskListMultiLevelFieldValuesParams = __esri.JobTaskListMultiLevelFieldValuesParams; - - export import JobTaskLogActionParams = __esri.JobTaskLogActionParams; - - export import JobTaskQueryJobsParams = __esri.JobTaskQueryJobsParams; - - export import JobTaskQueryMultiLevelSelectedValuesParams = __esri.JobTaskQueryMultiLevelSelectedValuesParams; - - export import JobTaskReleaseHoldParams = __esri.JobTaskReleaseHoldParams; - - export import JobTaskReopenClosedJobsParams = __esri.JobTaskReopenClosedJobsParams; - - export import JobTaskSearchJobsParams = __esri.JobTaskSearchJobsParams; - - export import JobTaskUnassignJobsParams = __esri.JobTaskUnassignJobsParams; - - export import JobTaskUpdateNotesParams = __esri.JobTaskUpdateNotesParams; - - export import JobTaskUpdateRecordParams = __esri.JobTaskUpdateRecordParams; - - export import JobUpdateParameters = __esri.JobUpdateParameters; - - export import ChangeRule = __esri.ChangeRule; - - export import NotificationTaskAddChangeRuleParams = __esri.NotificationTaskAddChangeRuleParams; - - export import NotificationTaskDeleteChangeRuleParams = __esri.NotificationTaskDeleteChangeRuleParams; - - export import NotificationTaskNotifySessionParams = __esri.NotificationTaskNotifySessionParams; - - export import NotificationTaskQueryChangeRulesParams = __esri.NotificationTaskQueryChangeRulesParams; - - export import NotificationTaskRunSpatialNotificationOnHistoryParams = __esri.NotificationTaskRunSpatialNotificationOnHistoryParams; - - export import NotificationTaskSendNotificationParams = __esri.NotificationTaskSendNotificationParams; - - export import NotificationTaskSubscribeToNotificationParams = __esri.NotificationTaskSubscribeToNotificationParams; - - export import NotificationTaskUnsubscribeFromNotificationParams = __esri.NotificationTaskUnsubscribeFromNotificationParams; - - export import ReportTaskGenerateReportParams = __esri.ReportTaskGenerateReportParams; - - export import ReportTaskGetReportContentUrlParams = __esri.ReportTaskGetReportContentUrlParams; - - export import ReportTaskGetReportDataParams = __esri.ReportTaskGetReportDataParams; - - export import TokenTaskParseTokensParams = __esri.TokenTaskParseTokensParams; - - export import WorkflowTaskCanRunStepParams = __esri.WorkflowTaskCanRunStepParams; - - export import WorkflowTaskExecuteStepsParams = __esri.WorkflowTaskExecuteStepsParams; - - export import WorkflowTaskGetStepDescriptionParams = __esri.WorkflowTaskGetStepDescriptionParams; - - export import WorkflowTaskGetStepFileUrlParams = __esri.WorkflowTaskGetStepFileUrlParams; - - export import WorkflowTaskGetStepParams = __esri.WorkflowTaskGetStepParams; - - export import WorkflowTaskMarkStepsAsDoneParams = __esri.WorkflowTaskMarkStepsAsDoneParams; - - export import WorkflowTaskMoveToNextStepParams = __esri.WorkflowTaskMoveToNextStepParams; - - export import WorkflowTaskRecreateWorkflowParams = __esri.WorkflowTaskRecreateWorkflowParams; - - export import WorkflowTaskResolveConflictParams = __esri.WorkflowTaskResolveConflictParams; - - export import WorkflowTaskSetCurrentStepParams = __esri.WorkflowTaskSetCurrentStepParams; - - export import ImageryLayerViewPixelData = __esri.ImageryLayerViewPixelData; - - export import StreamLayerViewDataReceivedEvent = __esri.StreamLayerViewDataReceivedEvent; - - export import StreamLayerViewDataReceivedEventHandler = __esri.StreamLayerViewDataReceivedEventHandler; - - export import StreamLayerViewFilter = __esri.StreamLayerViewFilter; - - export import StreamLayerViewUpdateFilterFilter = __esri.StreamLayerViewUpdateFilterFilter; - - export import SlideApplyToOptions = __esri.SlideApplyToOptions; - - export import SlideCreateFromOptions = __esri.SlideCreateFromOptions; - - export import SlideCreateFromOptionsScreenshot = __esri.SlideCreateFromOptionsScreenshot; - - export import SlideDescriptionProperties = __esri.SlideDescriptionProperties; - export import SlideDescription = __esri.SlideDescription; - - export import SlideThumbnailProperties = __esri.SlideThumbnailProperties; - export import SlideThumbnail = __esri.SlideThumbnail; - - export import SlideTitleProperties = __esri.SlideTitleProperties; - export import SlideTitle = __esri.SlideTitle; - - export import SlideUpdateFromOptions = __esri.SlideUpdateFromOptions; - - export import SlideUpdateFromOptionsScreenshot = __esri.SlideUpdateFromOptionsScreenshot; - - export import SlideVisibleLayers = __esri.SlideVisibleLayers; - - export import ColorSliderValues = __esri.ColorSliderValues; - - export import LegendLayerInfos = __esri.LegendLayerInfos; - - export import PopupDockOptions = __esri.PopupDockOptions; - - export import PopupOpenOptions = __esri.PopupOpenOptions; - - export import SearchViewModelSearchCompleteEventResults = __esri.SearchViewModelSearchCompleteEventResults; - - export import SearchViewModelSearchCompleteEventResultsResults = __esri.SearchViewModelSearchCompleteEventResultsResults; - - export import SearchViewModelSelectResultEventResult = __esri.SearchViewModelSelectResultEventResult; - - export import SearchViewModelSuggestCompleteEventResults = __esri.SearchViewModelSuggestCompleteEventResults; - - export import SearchViewModelSuggestCompleteEventResultsResults = __esri.SearchViewModelSuggestCompleteEventResultsResults; - - export import SearchViewModelLoadEvent = __esri.SearchViewModelLoadEvent; - - export import SearchViewModelLoadEventHandler = __esri.SearchViewModelLoadEventHandler; - - export import SearchViewModelSearchClearEvent = __esri.SearchViewModelSearchClearEvent; - - export import SearchViewModelSearchClearEventHandler = __esri.SearchViewModelSearchClearEventHandler; - - export import SearchViewModelSearchCompleteEvent = __esri.SearchViewModelSearchCompleteEvent; - - export import SearchViewModelSearchCompleteEventHandler = __esri.SearchViewModelSearchCompleteEventHandler; - - export import SearchViewModelSearchStartEvent = __esri.SearchViewModelSearchStartEvent; - - export import SearchViewModelSearchStartEventHandler = __esri.SearchViewModelSearchStartEventHandler; - - export import SearchViewModelSelectResultEvent = __esri.SearchViewModelSelectResultEvent; - - export import SearchViewModelSelectResultEventHandler = __esri.SearchViewModelSelectResultEventHandler; - - export import SearchViewModelSuggestCompleteEvent = __esri.SearchViewModelSuggestCompleteEvent; - - export import SearchViewModelSuggestCompleteEventHandler = __esri.SearchViewModelSuggestCompleteEventHandler; - - export import SearchViewModelSuggestStartEvent = __esri.SearchViewModelSuggestStartEvent; - - export import SearchViewModelSuggestStartEventHandler = __esri.SearchViewModelSuggestStartEventHandler; - - export import DynamicLayerFetchImageOptions = __esri.DynamicLayerFetchImageOptions; - - export import DynamicLayerGetImageUrlOptions = __esri.DynamicLayerGetImageUrlOptions; - - export import ArcGISDynamicMapServiceGetExportImageParametersOptions = __esri.ArcGISDynamicMapServiceGetExportImageParametersOptions; - - export import SceneServiceVersion = __esri.SceneServiceVersion; - - export import BreakpointsOwnerBreakpoints = __esri.BreakpointsOwnerBreakpoints; - - export import configRequest = __esri.configRequest; - - export import configRequestCorsEnabledServers = __esri.configRequestCorsEnabledServers; - - export import configRequestProxyRules = __esri.configRequestProxyRules; - - export import configWorkers = __esri.configWorkers; - - export import configWorkersLoaderConfig = __esri.configWorkersLoaderConfig; - - export import requestEsriRequestOptions = __esri.requestEsriRequestOptions; - - export import EachAlwaysResult = __esri.EachAlwaysResult; - - export import urlUtilsAddProxyRuleRule = __esri.urlUtilsAddProxyRuleRule; - - export import EventAttachedCallback = __esri.EventAttachedCallback; - - export import PausableWatchHandle = __esri.PausableWatchHandle; - - export import decoratorsPropertyPropertyMetadata = __esri.decoratorsPropertyPropertyMetadata; - - export import colorCreateContinuousRendererParams = __esri.colorCreateContinuousRendererParams; - - export import colorCreateContinuousRendererParamsLegendOptions = __esri.colorCreateContinuousRendererParamsLegendOptions; - - export import colorCreateVisualVariableParams = __esri.colorCreateVisualVariableParams; - - export import colorCreateVisualVariableParamsLegendOptions = __esri.colorCreateVisualVariableParamsLegendOptions; - - export import locationCreateRendererParams = __esri.locationCreateRendererParams; + export type OpenStreetMapLayerLayerviewCreateEventHandler = (event: OpenStreetMapLayerLayerviewCreateEvent) => void; - export import sizeCreateContinuousRendererParams = __esri.sizeCreateContinuousRendererParams; + export type OpenStreetMapLayerLayerviewDestroyEventHandler = (event: OpenStreetMapLayerLayerviewDestroyEvent) => void; - export import sizeCreateContinuousRendererParamsLegendOptions = __esri.sizeCreateContinuousRendererParamsLegendOptions; + export type PointCloudLayerLayerviewCreateEventHandler = (event: PointCloudLayerLayerviewCreateEvent) => void; - export import sizeCreateVisualVariablesParams = __esri.sizeCreateVisualVariablesParams; + export type PointCloudLayerLayerviewDestroyEventHandler = (event: PointCloudLayerLayerviewDestroyEvent) => void; - export import sizeCreateVisualVariablesParamsLegendOptions = __esri.sizeCreateVisualVariablesParamsLegendOptions; + export type PointDrawActionCursorUpdateEventHandler = (event: PointDrawActionCursorUpdateEvent) => void; - export import typeCreateRendererParams = __esri.typeCreateRendererParams; + export type PointDrawActionDrawCompleteEventHandler = (event: PointDrawActionDrawCompleteEvent) => void; - export import typeCreateRendererParamsLegendOptions = __esri.typeCreateRendererParamsLegendOptions; + export type PolygonDrawActionCursorUpdateEventHandler = (event: PolygonDrawActionCursorUpdateEvent) => void; - export import univariateColorSizeCreateContinuousRendererParams = __esri.univariateColorSizeCreateContinuousRendererParams; + export type PolygonDrawActionDrawCompleteEventHandler = (event: PolygonDrawActionDrawCompleteEvent) => void; - export import univariateColorSizeCreateContinuousRendererParamsColorOptions = __esri.univariateColorSizeCreateContinuousRendererParamsColorOptions; + export type PolygonDrawActionVertexAddEventHandler = (event: PolygonDrawActionVertexAddEvent) => void; - export import univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions = __esri.univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; + export type PolygonDrawActionVertexRemoveEventHandler = (event: PolygonDrawActionVertexRemoveEvent) => void; - export import univariateColorSizeCreateContinuousRendererParamsSizeOptions = __esri.univariateColorSizeCreateContinuousRendererParamsSizeOptions; + export type PolylineDrawActionCursorUpdateEventHandler = (event: PolylineDrawActionCursorUpdateEvent) => void; - export import univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions = __esri.univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; + export type PolylineDrawActionDrawCompleteEventHandler = (event: PolylineDrawActionDrawCompleteEvent) => void; - export import univariateColorSizeCreateVisualVariablesParams = __esri.univariateColorSizeCreateVisualVariablesParams; + export type PolylineDrawActionVertexAddEventHandler = (event: PolylineDrawActionVertexAddEvent) => void; - export import univariateColorSizeCreateVisualVariablesParamsColorOptions = __esri.univariateColorSizeCreateVisualVariablesParamsColorOptions; + export type PolylineDrawActionVertexRemoveEventHandler = (event: PolylineDrawActionVertexRemoveEvent) => void; - export import univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions = __esri.univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; + export type SceneLayerLayerviewCreateEventHandler = (event: SceneLayerLayerviewCreateEvent) => void; - export import univariateColorSizeCreateVisualVariablesParamsSizeOptions = __esri.univariateColorSizeCreateVisualVariablesParamsSizeOptions; + export type SceneLayerLayerviewDestroyEventHandler = (event: SceneLayerLayerviewDestroyEvent) => void; - export import univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions = __esri.univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; + export type SceneViewClickEventHandler = (event: SceneViewClickEvent) => void; - export import classBreaksClassBreaksParams = __esri.classBreaksClassBreaksParams; + export type SceneViewDoubleClickEventHandler = (event: SceneViewDoubleClickEvent) => void; - export import histogramHistogramParams = __esri.histogramHistogramParams; + export type SceneViewDragEventHandler = (event: SceneViewDragEvent) => void; - export import summaryStatisticsSummaryStatisticsParams = __esri.summaryStatisticsSummaryStatisticsParams; + export type SceneViewHoldEventHandler = (event: SceneViewHoldEvent) => void; - export import uniqueValuesUniqueValuesParams = __esri.uniqueValuesUniqueValuesParams; + export type SceneViewKeyDownEventHandler = (event: SceneViewKeyDownEvent) => void; - export import colorGetSchemesParams = __esri.colorGetSchemesParams; + export type SceneViewKeyUpEventHandler = (event: SceneViewKeyUpEvent) => void; - export import locationGetSchemesParams = __esri.locationGetSchemesParams; + export type SceneViewLayerviewCreateEventHandler = (event: SceneViewLayerviewCreateEvent) => void; - export import sizeGetSchemesParams = __esri.sizeGetSchemesParams; + export type SceneViewLayerviewDestroyEventHandler = (event: SceneViewLayerviewDestroyEvent) => void; - export import typeGetSchemesParams = __esri.typeGetSchemesParams; + export type SceneViewMouseWheelEventHandler = (event: SceneViewMouseWheelEvent) => void; - export import JobQuery = __esri.JobQuery; + export type SceneViewPointerDownEventHandler = (event: SceneViewPointerDownEvent) => void; - export import GroupMembership = __esri.GroupMembership; + export type SceneViewPointerMoveEventHandler = (event: SceneViewPointerMoveEvent) => void; - export import JobQueryContainer = __esri.JobQueryContainer; + export type SceneViewPointerUpEventHandler = (event: SceneViewPointerUpEvent) => void; - export import Privilege = __esri.Privilege; + export type SceneViewResizeEventHandler = (event: SceneViewResizeEvent) => void; - export import DataWorkspace = __esri.DataWorkspace; + export type SearchViewModelLoadEventHandler = (event: SearchViewModelLoadEvent) => void; - export import HoldType = __esri.HoldType; + export type SearchViewModelSearchClearEventHandler = (event: SearchViewModelSearchClearEvent) => void; - export import JobPriority = __esri.JobPriority; + export type SearchViewModelSearchCompleteEventHandler = (event: SearchViewModelSearchCompleteEvent) => void; - export import JobStatus = __esri.JobStatus; + export type SearchViewModelSearchStartEventHandler = (event: SearchViewModelSearchStartEvent) => void; - export import JobType = __esri.JobType; + export type SearchViewModelSelectResultEventHandler = (event: SearchViewModelSelectResultEvent) => void; - export import ActivityType = __esri.ActivityType; + export type SearchViewModelSuggestCompleteEventHandler = (event: SearchViewModelSuggestCompleteEvent) => void; - export import NotificationType = __esri.NotificationType; + export type SearchViewModelSuggestStartEventHandler = (event: SearchViewModelSuggestStartEvent) => void; - export import AuxRecord = __esri.AuxRecord; + export type StreamLayerLayerviewCreateEventHandler = (event: StreamLayerLayerviewCreateEvent) => void; - export import AuxRecordValue = __esri.AuxRecordValue; + export type StreamLayerLayerviewDestroyEventHandler = (event: StreamLayerLayerviewDestroyEvent) => void; - export import JobVersionInfo = __esri.JobVersionInfo; + export type StreamLayerViewDataReceivedEventHandler = (event: StreamLayerViewDataReceivedEvent) => void; - export import QueryFieldInfo = __esri.QueryFieldInfo; + export type TileLayerLayerviewCreateEventHandler = (event: TileLayerLayerviewCreateEvent) => void; - export import DatasetConfiguration = __esri.DatasetConfiguration; + export type TileLayerLayerviewDestroyEventHandler = (event: TileLayerLayerviewDestroyEvent) => void; - export import WhereCondition = __esri.WhereCondition; + export type UnknownLayerLayerviewCreateEventHandler = (event: UnknownLayerLayerviewCreateEvent) => void; - export import ReportDataGroup = __esri.ReportDataGroup; + export type UnknownLayerLayerviewDestroyEventHandler = (event: UnknownLayerLayerviewDestroyEvent) => void; - export import WorkflowConflicts = __esri.WorkflowConflicts; + export type UnsupportedLayerLayerviewCreateEventHandler = (event: UnsupportedLayerLayerviewCreateEvent) => void; - export import WorkflowOption = __esri.WorkflowOption; + export type UnsupportedLayerLayerviewDestroyEventHandler = (event: UnsupportedLayerLayerviewDestroyEvent) => void; - export import WorkflowStepInfo = __esri.WorkflowStepInfo; + export type VectorTileLayerLayerviewCreateEventHandler = (event: VectorTileLayerLayerviewCreateEvent) => void; - export import StepType = __esri.StepType; + export type VectorTileLayerLayerviewDestroyEventHandler = (event: VectorTileLayerLayerviewDestroyEvent) => void; - export import WorkflowAnnotationDisplayDetails = __esri.WorkflowAnnotationDisplayDetails; + export type WebTileLayerLayerviewCreateEventHandler = (event: WebTileLayerLayerviewCreateEvent) => void; - export import WorkflowPathDisplayDetails = __esri.WorkflowPathDisplayDetails; + export type WebTileLayerLayerviewDestroyEventHandler = (event: WebTileLayerLayerviewDestroyEvent) => void; - export import WorkflowStepDisplayDetails = __esri.WorkflowStepDisplayDetails; + export type WMSLayerLayerviewCreateEventHandler = (event: WMSLayerLayerviewCreateEvent) => void; - export import ColorAndIntensity = __esri.ColorAndIntensity; + export type WMSLayerLayerviewDestroyEventHandler = (event: WMSLayerLayerviewDestroyEvent) => void; - export import RenderCamera = __esri.RenderCamera; + export type WMTSLayerLayerviewCreateEventHandler = (event: WMTSLayerLayerviewCreateEvent) => void; - export import SunLight = __esri.SunLight; + export type WMTSLayerLayerviewDestroyEventHandler = (event: WMTSLayerLayerviewDestroyEvent) => void; } declare module "esri/Basemap" { @@ -10509,6 +11231,11 @@ declare module "esri/geometry/Geometry" { export = Geometry; } +declare module "esri/geometry/HeightModelInfo" { + import HeightModelInfo = __esri.HeightModelInfo; + export = HeightModelInfo; +} + declare module "esri/geometry/Multipoint" { import Multipoint = __esri.Multipoint; export = Multipoint; @@ -10609,6 +11336,11 @@ declare module "esri/layers/IntegratedMeshLayer" { export = IntegratedMeshLayer; } +declare module "esri/layers/KMLLayer" { + import KMLLayer = __esri.KMLLayer; + export = KMLLayer; +} + declare module "esri/layers/Layer" { import Layer = __esri.Layer; export = Layer; @@ -10729,6 +11461,11 @@ declare module "esri/layers/support/InheritedDomain" { export = InheritedDomain; } +declare module "esri/layers/support/KMLSublayer" { + import KMLSublayer = __esri.KMLSublayer; + export = KMLSublayer; +} + declare module "esri/layers/support/LabelClass" { import LabelClass = __esri.LabelClass; export = LabelClass; @@ -11379,6 +12116,26 @@ declare module "esri/views/ui/DefaultUI" { export = DefaultUI; } +declare module "esri/views/2d/draw/Draw" { + import Draw = __esri.Draw; + export = Draw; +} + +declare module "esri/views/2d/draw/PointDrawAction" { + import PointDrawAction = __esri.PointDrawAction; + export = PointDrawAction; +} + +declare module "esri/views/2d/draw/PolylineDrawAction" { + import PolylineDrawAction = __esri.PolylineDrawAction; + export = PolylineDrawAction; +} + +declare module "esri/views/2d/draw/PolygonDrawAction" { + import PolygonDrawAction = __esri.PolygonDrawAction; + export = PolygonDrawAction; +} + declare module "esri/webmap/InitialViewProperties" { import InitialViewProperties = __esri.InitialViewProperties; export = InitialViewProperties; @@ -11589,6 +12346,11 @@ declare module "esri/widgets/Zoom/ZoomViewModel" { export = ZoomViewModel; } +declare module "esri/widgets/Sketch/SketchViewModel" { + import SketchViewModel = __esri.SketchViewModel; + export = SketchViewModel; +} + declare module "esri/core/Evented" { import Evented = __esri.Evented; export = Evented; @@ -11699,6 +12461,11 @@ declare module "esri/request" { export = request; } +declare module "esri/core/Error" { + import Error = __esri.Error; + export = Error; +} + declare module "esri/core/lang" { import lang = __esri.lang; export = lang; diff --git a/types/arcgis-js-api/tsconfig.json b/types/arcgis-js-api/tsconfig.json index a5574d4314..8a696a3a1e 100644 --- a/types/arcgis-js-api/tsconfig.json +++ b/types/arcgis-js-api/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index 0c30ae898d..de4328a957 100644 --- a/types/arcgis-js-api/v3/index.d.ts +++ b/types/arcgis-js-api/v3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 3.21 +// Type definitions for ArcGIS API for JavaScript 3.22 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -284,6 +284,8 @@ declare module "esri" { columnDelimiter?: string; /** Copyright information for the layer. */ copyright?: string; + /** Enables feature reduction (for example clustering) on point layers. */ + featureReduction?: any; /** The fields property contains objects with "name", "alias" and "type" String properties. */ fields?: any[]; /** The latitude field name. */ @@ -608,13 +610,13 @@ declare module "esri" { locationProvider: LocationProviderBase; } export interface DataBrowserOptions { - /** Whether or not to display the hierarchy dropdown for countries with multiple hierarchies (e.g. */ + /** Whether or not to display the hierarchy dropdown for countries with multiple hierarchies (for example USA has both Census and Landscape, Germany has both Census and Nexiga). */ allowHierarchies?: boolean; /** Show/hide country drop down. */ countryBox?: boolean; /** Two-digit country code selected in the country drop down. */ countryID?: string; - /** The hierarchy to load for a country (e.g. */ + /** The hierarchy to load for a country (for example 'Census' or 'Landscape' for USA). */ hierarchyID?: string; /** Text string to display on the back button on the second and third pages of the Data Browser. */ pageBackButton?: string; @@ -896,6 +898,8 @@ declare module "esri" { displayOnPan?: boolean; /** Set a callback function that will be invoked by FeatureLayer.getEditSummary. */ editSummaryCallback?: Function; + /** Enables feature reduction (for example clustering) on point layers. */ + featureReduction?: any; /** Specify the geodatabase version to display. */ gdbVersion?: string; /** Unique ID to assign to the layer. */ @@ -1172,7 +1176,7 @@ declare module "esri" { remove(): void; } export interface HeatmapRendererOptions { - /** The radius (in pixels) of the circle over which the majority of each points value is spread out over. */ + /** The radius (in pixels) of the circle over which the majority of each point's value is spread out. */ blurRadius?: number; /** An array of CSS color strings (#RGB, #RRGGBB, rgb(r,g,b), rgba(r,g,b,a)). */ colors: string[]; @@ -1718,7 +1722,7 @@ declare module "esri" { pixels: number[][]; /** Pixel type. */ pixelType?: string; - /** Array of objects containing numeric statistical properties (e.g. */ + /** Array of objects containing numeric statistical properties (for example minValue, maxValue, noDataValue, etc.). */ statistics?: any[]; /** Number of columns. */ width: number; @@ -1856,7 +1860,7 @@ declare module "esri" { primaryHandle?: number; /** Toggle for showing the black handle bars. */ showHandles?: boolean; - /** Flexible toggle for showing labels (e.g. */ + /** Flexible toggle for showing labels (for example ["data", "handle"]). */ showLabels?: boolean | string[]; /** Toggle for showing the horizontal line indicators from the center of the handle. */ showTicks?: boolean; @@ -2153,7 +2157,7 @@ declare module "esri" { } export interface TemplatePickerOptions { /** Number of visible columns. */ - columns?: number; + columns?: number | string; /** Defines the text to be displayed when the template picker does not have any templates to display. */ emptyMessage?: string; /** Array of input feature layers. */ @@ -2165,7 +2169,7 @@ declare module "esri" { /** Length of label description. */ maxLabelLength?: number; /** Number of visible rows. */ - rows?: number; + rows?: number | string; /** Tooltip content contains the template name and description. */ showTooltip?: boolean; /** HTML style attributes for the widget. */ @@ -3488,7 +3492,7 @@ declare module "esri/dijit/BasemapGallery" { basemaps: Basemap[]; /** This value is true after the BasemapGallery retrieves the ArcGIS.com basemaps. */ loaded: boolean; - /** Optional parameter to pass in a portal URL, including the instance name, used to access the group containing the basemap gallery items. */ + /** Optional parameter to pass in a portal URL, including the instance name, used to access the group containing the basemap gallery items, for example www.myportal.com/myInstance or http://www.myportal.com/myInstance. */ portalUrl: string; /** * Creates a new BasemapGallery dijit. @@ -4567,8 +4571,8 @@ declare module "esri/dijit/InfoWindow" { /** Determines whether the InfoWindow is currently shown on the map. */ isShowing: boolean; /** - * Create a new Info Window. - * @param params Optional parameters. + * Create a new InfoWindow. + * @param params Specify optional parameters used to create the InfoWindow. * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ constructor(params: any, srcNodeRef: Node | string); @@ -4633,6 +4637,12 @@ declare module "esri/dijit/InfoWindowLite" { fixedAnchor: string; /** Determines whether the InfoWindowLite is currently shown on the map. */ isShowing: boolean; + /** + * Create a new InfoWindowLite. + * @param params Specify optional parameters used to create the InfoWindowLite. + * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. + */ + constructor(params: any, srcNodeRef: Node | string); /** Hides the InfoWindow. */ hide(): void; /** @@ -5117,8 +5127,8 @@ declare module "esri/dijit/OverviewMap" { declare module "esri/dijit/Popup" { import esri = require("esri"); import InfoWindowBase = require("esri/InfoWindowBase"); - import Graphic = require("esri/graphic"); import FillSymbol = require("esri/symbols/FillSymbol"); + import Graphic = require("esri/graphic"); import LineSymbol = require("esri/symbols/LineSymbol"); import Point = require("esri/geometry/Point"); import MarkerSymbol = require("esri/symbols/MarkerSymbol"); @@ -5127,6 +5137,8 @@ declare module "esri/dijit/Popup" { class Popup extends InfoWindowBase { /** Controls the placement of the popup window with respect to the geographic location. */ anchor: string; + /** Visualizes the extent of the points summarized by the cluster graphic when the user selects the "Browse Features" action in the cluster popup. */ + clusterFillSymbol: FillSymbol; /** The number of features associated with the info window. */ count: number; /** An array of pending deferreds, null if there are not any pending deferreds. */ @@ -5179,16 +5191,28 @@ declare module "esri/dijit/Popup" { * @param srcNodeRef Reference or id of the HTML element where the widget should be rendered. */ constructor(options: esri.PopupOptions, srcNodeRef: Node | string); + /** + * Creates links for the specified actions at the bottom of the popup window. + * @param actions An array of action objects that define the behavior for actions included in the popup. + */ + addActions(actions: any[]): any[]; /** Removes all features and destroys any pending deferreds. */ clearFeatures(): void; /** Destroy the popup. */ destroy(): void; + /** Returns the current placement of the popup window. */ + getCurrentAnchor(): string; /** Get the currently selected feature. */ getSelectedFeature(): Graphic; /** Hide the info window. */ hide(): void; /** Maximize the info window. */ maximize(): void; + /** + * Removes the specified actions from the popup window. + * @param actionInfos An array of objects that describe actions created with addActions(). + */ + removeActions(actionInfos: any[]): void; /** Re-calculates the popup's position with respect to the map location it is pointing to. */ reposition(): void; /** @@ -5222,8 +5246,9 @@ declare module "esri/dijit/Popup" { /** * Associate an array of features or an array of deferreds that return features with the info window. * @param features An array of features or deferreds. + * @param options Additional options for setting features in the popup. */ - setFeatures(features: Graphic[] | any[]): void; + setFeatures(features: Graphic[] | any[], options?: any): void; /** * Sets the info window title. * @param title The text for the title. @@ -5332,8 +5357,6 @@ declare module "esri/dijit/PopupTemplate" { /** The PopupTemplate class extends esri/InfoTemplate and provides support for defining a layout. */ class PopupTemplate extends InfoTemplate { - /** An array of objects that reference Arcade expressions. */ - expressionInfos: any[]; /** The popup definition defined as a JavaScript object. */ info: any; /** @@ -5399,7 +5422,7 @@ declare module "esri/dijit/RendererSlider" { precision: number; /** Toggle for showing the black handle bars. */ showHandles: boolean; - /** Flexible toggle for showing labels e.g. */ + /** Flexible toggle for showing labels, for example ["data","handle"]. */ showLabels: boolean | string[]; /** Toggle for showing the horizontal line indicators from the center of the handle. */ showTicks: boolean; @@ -7991,10 +8014,10 @@ declare module "esri/geometry/geometryEngine" { clip(geometry: Geometry, envelope: Extent): Geometry; /** * Indicates if one geometry contains another geometry. - * @param geometry1 The geometry that is tested for the contains relationship to the other geometry. - * @param geometry2 The geometry that is tested for within relationship to the other geometry. + * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. + * @param insideGeometry The geometry that is tested for the "within" relationship to the containerGeometry. */ - contains(geometry1: Geometry, geometry2: Geometry): boolean; + contains(containerGeometry: Geometry, insideGeometry: Geometry): boolean; /** * Calculates the convex hull of the input geometry. * @param geometry The input geometry. @@ -8200,10 +8223,10 @@ declare module "esri/geometry/geometryEngine" { union(geometries: Geometry[]): Geometry; /** * Indicates if one geometry is within another geometry. - * @param geometry1 The base geometry that is tested for within relationship to the other geometry. - * @param geometry2 The comparison geometry that is tested for the contains relationship to the other geometry. + * @param innerGeometry The base geometry that is tested for within relationship to the other geometry. + * @param outerGeometry The comparison geometry that is tested for the contains relationship to the other geometry. */ - within(geometry1: Geometry, geometry2: Geometry): boolean; + within(innerGeometry: Geometry, outerGeometry: Geometry): boolean; }; export = geometryEngine; } @@ -8234,10 +8257,10 @@ declare module "esri/geometry/geometryEngineAsync" { clip(geometry: Geometry, envelope: Extent): any; /** * Indicates if one geometry contains another geometry. - * @param geometry1 The geometry that is tested for the contains relationship to the other geometry. - * @param geometry2 The geometry that is tested for within relationship to the other geometry. + * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. + * @param insideGeometry The geometry that is tested for the "within" relationship to the containerGeometry. */ - contains(geometry1: Geometry, geometry2: Geometry): any; + contains(containerGeometry: Geometry, insideGeometry: Geometry): any; /** * Calculates the convex hull of the input geometry. * @param geometry The input geometry. @@ -8443,10 +8466,10 @@ declare module "esri/geometry/geometryEngineAsync" { union(geometries: Geometry[]): any; /** * Indicates if one geometry is within another geometry. - * @param geometry1 The base geometry that is tested for within relationship to the other geometry. - * @param geometry2 The comparison geometry that is tested for the contains relationship to the other geometry. + * @param innerGeometry The base geometry that is tested for within relationship to the other geometry. + * @param outerGeometry The comparison geometry that is tested for the contains relationship to the other geometry. */ - within(geometry1: Geometry, geometry2: Geometry): any; + within(innerGeometry: Geometry, outerGeometry: Geometry): any; }; export = geometryEngineAsync; } @@ -8664,8 +8687,15 @@ declare module "esri/graphic" { * @param value The value of the attribute. */ attr(name: string, value: string): Graphic; + /** Creates a deep clone of the graphic object. */ + clone(): Graphic; /** Draws the graphic. */ draw(): Graphic; + /** + * Returns the graphics summarized by the given aggregate graphic in a clustering or feature reduction visualization. + * @param aggregateGraphic A graphic representing the aggregation (or reduction) of several individual graphics in a layer. + */ + getChildGraphics(aggregateGraphic: Graphic): Graphic[]; /** Returns the content string based on attributes and infoTemplate values. */ getContent(): string; /** Returns the dojo/gfx/shape.Shape of the Esri graphic. */ @@ -8688,6 +8718,8 @@ declare module "esri/graphic" { getTitle(): string; /** Hides the graphic. */ hide(): void; + /** Indicates if the graphic represents a cluster of features. */ + isAggregate(): boolean; /** * Defines the attributes of the graphic. * @param attributes The name value pairs of fields and field values associated with the graphic. @@ -9055,7 +9087,7 @@ declare module "esri/layers/ArcGISImageServiceLayer" { timeInfo: TimeInfo; /** By default, images are exported in MIME format, and the image is streamed to the client. */ useMapImage: boolean; - /** The version of ArcGIS Server the image service is published to, e.g. */ + /** The version of ArcGIS Server the image service is published to, such as 9.3, 9.31, 10, 10.41. */ version: number; /** * Creates a new ArcGISImageServiceLayer object. @@ -9073,7 +9105,7 @@ declare module "esri/layers/ArcGISImageServiceLayer" { getDefinitionExpression(): string; /** Get key properties of an ImageService including information such as the band names associated with the imagery. */ getKeyProperties(): any; - /** Asynchronously returns the raster attribute table of an ImageService which returns categorical mapping of pixel values (e.g. */ + /** Asynchronously returns the raster attribute table of an ImageService which returns categorical mapping of pixel values (for example a class, group, category, or membership). */ getRasterAttributeTable(): any; /** Gets the currently visible rasters. */ getVisibleRasters(): Graphic[]; @@ -9651,6 +9683,12 @@ declare module "esri/layers/FeatureLayer" { * @param errback An error object is returned if an error occurs. */ deleteAttachments(objectId: number, attachmentIds: number[], callback?: Function, errback?: Function): any; + /** Disables feature reduction (for example clustering) on the layer. */ + disableFeatureReduction(): void; + /** Enables feature reduction (for example clustering) on the layer using the options set in setFeatureReduction(). */ + enableFeatureReduction(): void; + /** Returns graphics representing the aggregation of several point features clustered together. */ + getAggregateGraphics(): Graphic[]; /** Asynchrously returns custom data for the layer when available. */ getAttributionData(): any; /** Returns the current definition expression. */ @@ -9678,6 +9716,8 @@ declare module "esri/layers/FeatureLayer" { * @param options See the object specifications table below for the structure of the options object. */ getEditSummary(feature: Graphic, options?: any): string; + /** Returns the options used to reduce the number of features visualized by the layer (for example clustering). */ + getFeatureReduction(): any; /** * Returns the Field given the specified field name. * @param fieldName Name of the attribute field. @@ -9691,6 +9731,8 @@ declare module "esri/layers/FeatureLayer" { getSelectedFeatures(): Graphic[]; /** Gets the current selection symbol. */ getSelectionSymbol(): Symbol; + /** Returns graphics from the layer that are not represented by aggregate graphics when feature reduction (such as clustering) is enabled. */ + getSingleGraphics(): Graphic[]; /** Get the current time definition applied to the feature layer. */ getTimeDefinition(): TimeExtent; /** @@ -9702,6 +9744,10 @@ declare module "esri/layers/FeatureLayer" { hasXYFootprint(): boolean; /** Returns true if the FeatureLayer is editable. */ isEditable(): boolean; + /** Indicates if feature reduction (for example clustering) is active in the view. */ + isFeatureReductionActive(): boolean; + /** Indicates if feature reduction (for example clustering) is enabled. */ + isFeatureReductionEnabled(): boolean; /** * Returns true if the layer is visible at the given scale. * @param scale The scale at which to check if the layer is visible. @@ -9778,6 +9824,11 @@ declare module "esri/layers/FeatureLayer" { * @param editable When true, the layer will be set as editable. */ setEditable(editable: boolean): FeatureLayer; + /** + * Sets feature reduction options on the layer (for example clustering options). + * @param options Options for reducing (or aggregating) the features in the map. + */ + setFeatureReduction(options: any): void; /** * Set the layer's data source to the specified geodatabase version. * @param versionName The name of the geodatabase version to use as the layer's data source. @@ -10340,6 +10391,8 @@ declare module "esri/layers/KMLLayer" { * @param isVisible The visibility of the folder and all kml features within the folder. */ setFolderVisibility(folder: KMLFolder, isVisible: boolean): void; + /** Fires when one or more of the layer's network link children fail to load. */ + on(type: "network-link-error", listener: (event: { error: Error; target: KMLLayer }) => void): esri.Handle; /** Fired after the layer is refreshed. */ on(type: "refresh", listener: (event: { target: KMLLayer }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; @@ -10692,11 +10745,11 @@ declare module "esri/layers/PixelBlock" { height: number; /** An array of nodata mask. */ mask: any[]; - /** A two dimensional array. */ + /** A two dimensional array representing the pixels from the Image Service displayed on the client. */ pixels: number[][]; /** Pixel type. */ pixelType: string; - /** Array of objects containing numeric statistical properties (e.g. */ + /** Array of objects containing numeric statistical properties (for example minValue, maxValue, noDataValue, etc.). */ statistics: any[]; /** Number of columns. */ width: number; @@ -10710,7 +10763,7 @@ declare module "esri/layers/PixelBlock" { * @param planeData Must have two properties set: pixels and statistics. */ addData(planeData: any): void; - /** Returns pixels and masks using a single array in bip format (e.g. */ + /** Returns pixels and masks using a single array in bip format (for example [p_00_r, p_00_g, p_00_b, p_00_a, p_10_r, p_10_g, p_10_b, p_10_a, .....]). */ getAsRGBA(): any[]; /** Similar to getAsRGBA, but returns floating point data. */ getAsRGBAFloat(): any[]; @@ -12026,7 +12079,7 @@ declare module "esri/map" { resize(immediate?: boolean): void; /** * Change the background color of the map. - * @param color Color specified using either a named string (e.g. + * @param color Color specified using either a named string (for example red), hex string (for example #FF0000), array of rgba values with "a" in the 0-1 range (for example [255,0,0,0.75]), or an instance of esri/Color. */ setBackgroundColor(color: Color | string): void; /** @@ -13023,7 +13076,7 @@ declare module "esri/renderers/HeatmapRenderer" { /** The HeatmapRenderer renders feature layer point data into a raster visualization that emphasizes areas of higher density or weighted values. */ class HeatmapRenderer extends Renderer { - /** The radius (in pixels) of the circle over which the majority of each points value is spread out over. */ + /** The radius (in pixels) of the circle over which the majority of each point's value is spread out. */ blurRadius: number; /** An array of CSS color strings (#RGB, #RRGGBB, rgb(r,g,b), rgba(r,g,b,a)). */ colors: string[]; @@ -13336,6 +13389,7 @@ declare module "esri/renderers/TimeRampAger" { declare module "esri/renderers/UniqueValueRenderer" { import Renderer = require("esri/renderers/Renderer"); + import FillSymbol = require("esri/symbols/FillSymbol"); import Symbol = require("esri/symbols/Symbol"); import Graphic = require("esri/graphic"); @@ -13347,6 +13401,8 @@ declare module "esri/renderers/UniqueValueRenderer" { attributeField2: string; /** If needed, specify an additional attribute field the renderer uses to match values. */ attributeField3: string; + /** A symbol used for polygon features as a background if the renderer uses point symbols, for example for bivariate types & size rendering. */ + backgroundFillSymbol: FillSymbol; /** Label for the default symbol used to draw unspecified values. */ defaultLabel: string; /** Default symbol used when a value or break cannot be matched. */ @@ -13506,7 +13562,7 @@ declare module "esri/renderers/smartMapping" { */ createTypeRenderer(params: any): any; /** - * Searches the fields of an input layer or array of field objects for field names commonly used in rendering based on usage (e.g. + * Searches the fields of an input layer or array of field objects for field names commonly used in rendering based on usage (e.g., RANK, TOTAL, AVERAGE, NAME, etc). * @param params See the object specifications table below for details about the params object. */ getSuggestedField(params: any): any; @@ -15247,8 +15303,12 @@ declare module "esri/tasks/IdentifyParameters" { mapExtent: Extent; /** The maximum allowable offset used for generalizing geometries returned by the identify operation. */ maxAllowableOffset: number; + /** If true, field names will be returned instead of field aliases. */ + returnFieldName: boolean; /** If "true", the result set includes the geometry associated with each result. */ returnGeometry: boolean; + /** If true, the values in the result will not be formatted i.e. */ + returnUnformattedValues: boolean; /** The spatial reference of the input and output geometries as well as of the mapExtent. */ spatialReference: SpatialReference; /** Specify the time extent used by the identify task. */ diff --git a/types/arcgis-js-api/v3/tsconfig.json b/types/arcgis-js-api/v3/tsconfig.json index 6e7e99e066..320cb582e1 100644 --- a/types/arcgis-js-api/v3/tsconfig.json +++ b/types/arcgis-js-api/v3/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "types": [], "paths": { - "arcgis-js-api": ["arcgis-js-api/v3"] + "arcgis-js-api": [ + "arcgis-js-api/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/arcgis-rest-api/tsconfig.json b/types/arcgis-rest-api/tsconfig.json index 34b6945113..346b0c1ea3 100644 --- a/types/arcgis-rest-api/tsconfig.json +++ b/types/arcgis-rest-api/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/arcgis-to-geojson-utils/tsconfig.json b/types/arcgis-to-geojson-utils/tsconfig.json index a2eb702563..c2ef5bf641 100644 --- a/types/arcgis-to-geojson-utils/tsconfig.json +++ b/types/arcgis-to-geojson-utils/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index bbbc7c7abf..536afd68c9 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -35,9 +35,13 @@ archiver.append(readStream, {name: 'archiver.d.ts'}) .append(readStream, {name: 'archiver.d.ts'}); archiver.directory('./path', './someOtherPath'); -archiver.directory('./path', { name: "testName" }); archiver.directory('./', "", {}); -archiver.directory('./', { name: 'test' }, {}); +archiver.directory('./', false, { name: 'test' }); +archiver.directory('./', false, (entry: Archiver.EntryData) => { + entry.name = "foobar"; + return entry; +}); +archiver.directory('./', false, (entry: Archiver.EntryData) => false); archiver.append(readStream, { name: "sub/folder.xml" diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index a8c7de0502..8cf6eb1e92 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -21,12 +21,15 @@ declare namespace archiver { stats?: string; } + /** A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData) */ + type EntryDataFunction = (entry: EntryData) => false | EntryData; + interface Archiver extends stream.Transform { abort(): this; append(source: stream.Readable | Buffer | string, name?: EntryData): this; - directory(dirpath: string, options: EntryData | string, data?: EntryData): this; - + /** if false is passed for destpath, the path of a chunk of data in the archive is set to the root */ + directory(dirpath: string, destpath: false | string, data?: EntryData | EntryDataFunction): this; file(filename: string, data: EntryData): this; glob(pattern: string, options?: glob.IOptions, data?: EntryData): this; finalize(): Promise; diff --git a/types/archiver/tsconfig.json b/types/archiver/tsconfig.json index 7b043f24e4..71db696c82 100644 --- a/types/archiver/tsconfig.json +++ b/types/archiver/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/archy/tsconfig.json b/types/archy/tsconfig.json index ca7e082dcb..d26c849987 100644 --- a/types/archy/tsconfig.json +++ b/types/archy/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/are-we-there-yet/tsconfig.json b/types/are-we-there-yet/tsconfig.json index e4dc1462ce..9df0996daa 100644 --- a/types/are-we-there-yet/tsconfig.json +++ b/types/are-we-there-yet/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "are-we-there-yet-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/argparse/tsconfig.json b/types/argparse/tsconfig.json index 31b6cee0f1..49e7b03ca8 100644 --- a/types/argparse/tsconfig.json +++ b/types/argparse/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/argv/tsconfig.json b/types/argv/tsconfig.json index 10c6ce3f11..2a123030fa 100644 --- a/types/argv/tsconfig.json +++ b/types/argv/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/array-find-index/tsconfig.json b/types/array-find-index/tsconfig.json index 9cddd0dde7..41c6183cbe 100644 --- a/types/array-find-index/tsconfig.json +++ b/types/array-find-index/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/array-foreach/tsconfig.json b/types/array-foreach/tsconfig.json index d10d11a4a2..bacc698e34 100644 --- a/types/array-foreach/tsconfig.json +++ b/types/array-foreach/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/array-uniq/tsconfig.json b/types/array-uniq/tsconfig.json index 29fb9276c8..71557f6481 100644 --- a/types/array-uniq/tsconfig.json +++ b/types/array-uniq/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/arrify/tsconfig.json b/types/arrify/tsconfig.json index e0ac439953..63d89a9c7f 100644 --- a/types/arrify/tsconfig.json +++ b/types/arrify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "arrify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/artyom.js/tsconfig.json b/types/artyom.js/tsconfig.json index f4736ae50d..1a10beb9c8 100644 --- a/types/artyom.js/tsconfig.json +++ b/types/artyom.js/tsconfig.json @@ -7,6 +7,7 @@ ], "noImplicitAny": true, "strictNullChecks": true, + "strictFunctionTypes": true, "noImplicitThis": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +21,4 @@ "index.d.ts", "artyom.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index ede3bc99f9..9bbfb62508 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -787,12 +787,13 @@ declare namespace asana { namespace Attachments { interface Type extends Resource { - created_at: string; - permanent_url: string; - download_url: string; - view_url: string; - host: string; - parent: Resource; + readonly id: number; + readonly created_at: string; + readonly download_url: string; + readonly view_url: string; + readonly name: string; + readonly host: string; + readonly parent: Resource; } } diff --git a/types/asana/tsconfig.json b/types/asana/tsconfig.json index 5a6ff7d940..452aade0b1 100644 --- a/types/asana/tsconfig.json +++ b/types/asana/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ascii2mathml/tsconfig.json b/types/ascii2mathml/tsconfig.json index 22e7823b58..b4c4b0a21b 100644 --- a/types/ascii2mathml/tsconfig.json +++ b/types/ascii2mathml/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "ascii2mathml-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/asciify/tsconfig.json b/types/asciify/tsconfig.json index df554e6e89..5f84d92e80 100644 --- a/types/asciify/tsconfig.json +++ b/types/asciify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/asenv/tsconfig.json b/types/asenv/tsconfig.json index 129dd1caf0..c779998e24 100644 --- a/types/asenv/tsconfig.json +++ b/types/asenv/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "asenv-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/askmethat-rating/tsconfig.json b/types/askmethat-rating/tsconfig.json index fd5ef4ae50..a41db58d7a 100644 --- a/types/askmethat-rating/tsconfig.json +++ b/types/askmethat-rating/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "askmethat-rating-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/asn1js/tsconfig.json b/types/asn1js/tsconfig.json index 14f2b01922..59420b595d 100644 --- a/types/asn1js/tsconfig.json +++ b/types/asn1js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aspnet-identity-pw/tsconfig.json b/types/aspnet-identity-pw/tsconfig.json index 74e84bb784..2d2ba0ec28 100644 --- a/types/aspnet-identity-pw/tsconfig.json +++ b/types/aspnet-identity-pw/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/assert-equal-jsx/tsconfig.json b/types/assert-equal-jsx/tsconfig.json index 25c499a18f..3f476135f8 100644 --- a/types/assert-equal-jsx/tsconfig.json +++ b/types/assert-equal-jsx/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ @@ -21,4 +22,4 @@ "index.d.ts", "assert-equal-jsx-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/assert-plus/tsconfig.json b/types/assert-plus/tsconfig.json index ba308d4817..5c89ae8c31 100644 --- a/types/assert-plus/tsconfig.json +++ b/types/assert-plus/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/assertion-error/tsconfig.json b/types/assertion-error/tsconfig.json index 622a3d4f31..ebe9144d0b 100644 --- a/types/assertion-error/tsconfig.json +++ b/types/assertion-error/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/assertsharp/tsconfig.json b/types/assertsharp/tsconfig.json index 83ffe2f34e..bc2779726e 100644 --- a/types/assertsharp/tsconfig.json +++ b/types/assertsharp/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/assets-webpack-plugin/tsconfig.json b/types/assets-webpack-plugin/tsconfig.json index 0d71c8ce0b..3c08912345 100644 --- a/types/assets-webpack-plugin/tsconfig.json +++ b/types/assets-webpack-plugin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "assets-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/async-cache/tsconfig.json b/types/async-cache/tsconfig.json index 1358c8a3e4..21657ef518 100644 --- a/types/async-cache/tsconfig.json +++ b/types/async-cache/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "async-cache-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/async-lock/tsconfig.json b/types/async-lock/tsconfig.json index 015de13897..1bc997ef73 100644 --- a/types/async-lock/tsconfig.json +++ b/types/async-lock/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/async-polling/tsconfig.json b/types/async-polling/tsconfig.json index 3743e804f0..5bcccb20f2 100644 --- a/types/async-polling/tsconfig.json +++ b/types/async-polling/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/async-writer/tsconfig.json b/types/async-writer/tsconfig.json index 745abd8e87..2b8771e48c 100644 --- a/types/async-writer/tsconfig.json +++ b/types/async-writer/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/async.nexttick/tsconfig.json b/types/async.nexttick/tsconfig.json index 68011bfd96..b824f94a44 100644 --- a/types/async.nexttick/tsconfig.json +++ b/types/async.nexttick/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,5 +21,4 @@ "index.d.ts", "async.nexttick-tests.ts" ] -} - +} \ No newline at end of file diff --git a/types/async/index.d.ts b/types/async/index.d.ts index f443ebf627..80f2888a8b 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/caolan/async // Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying , Pascal Martin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 export as namespace async; @@ -23,6 +24,11 @@ export interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanRe export interface AsyncWorker { (task: T, callback: ErrorCallback): void; } export interface AsyncVoidFunction { (callback: ErrorCallback): void; } +export type AsyncAutoTasks, E> = { [K in keyof R]: AsyncAutoTask } +export type AsyncAutoTask, E> = AsyncAutoTaskFunctionWithoutDependencies | (keyof R | AsyncAutoTaskFunction)[]; +export interface AsyncAutoTaskFunctionWithoutDependencies { (cb: AsyncResultCallback | ErrorCallback): void; } +export interface AsyncAutoTaskFunction, E> { (results: R, cb: AsyncResultCallback | ErrorCallback): void; } + export interface AsyncQueue { length(): number; started: boolean; @@ -183,7 +189,7 @@ export function queue(worker: AsyncWorker, concurrency?: number): As export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; export function cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; -export function auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback): void; +export function auto, E>(tasks: AsyncAutoTasks, concurrency?: number, callback?: AsyncResultCallback): void; export function autoInject(tasks: any, callback?: AsyncResultCallback): void; export function retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; export function retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; diff --git a/types/async/tsconfig.json b/types/async/tsconfig.json index 46ac98ea58..153a5471fb 100644 --- a/types/async/tsconfig.json +++ b/types/async/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -22,4 +23,4 @@ "test/explicit.ts", "test/es6-generators.ts" ] -} +} \ No newline at end of file diff --git a/types/asyncblock/tsconfig.json b/types/asyncblock/tsconfig.json index 8c95bd56a0..c696706864 100644 --- a/types/asyncblock/tsconfig.json +++ b/types/asyncblock/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/atmosphere.js/atmosphere.js-tests.ts b/types/atmosphere.js/atmosphere.js-tests.ts new file mode 100644 index 0000000000..b353c2c947 --- /dev/null +++ b/types/atmosphere.js/atmosphere.js-tests.ts @@ -0,0 +1,46 @@ + + +var socket = atmosphere; + +var request1:Atmosphere.Request = new atmosphere.AtmosphereRequest(); + +request1.url = document.location.toString() + 'chat'; +request1.contentType = "application/json"; +request1.transport = 'websocket'; +request1.fallbackTransport = 'long-polling'; + +var request2:Atmosphere.Request = { + url: 'http://localhost:8080/chat', + contentType: "application/json", + logLevel: 'debug', + transport: 'websocket', + fallbackTransport: 'long-polling' +}; + +request1.onError = function (response?:Atmosphere.Response) {}; +request1.onClose = function (response?:Atmosphere.Response) {}; +request1.onOpen = function (response?:Atmosphere.Response) {}; +request1.onMessage = function (response:Atmosphere.Response) {}; +request1.onReopen = function (request?:Atmosphere.Request, response?:Atmosphere.Response) {}; +request1.onReconnect = function (request?:Atmosphere.Request, response?:Atmosphere.Response) {}; +request1.onMessagePublished = function (response?:Atmosphere.Response) {}; +request1.onTransportFailure = function (reason?:string, response?:Atmosphere.Response) {}; +request1.onLocalMessage = function (request?:Atmosphere.Request) {}; +request1.onFailureToReconnect = function (request?:Atmosphere.Request, response?:Atmosphere.Response) {}; +request1.onClientTimeout = function (request?:Atmosphere.Request) {}; + +request1.subscribe = function (options:Atmosphere.Request) {}; +request1.execute = function () {}; +request1.close = function () {}; +request1.disconnect = function () {}; +request1.getUrl = function ():string { return "http://www.toedter.com" }; +request1.push = function (message:string, dispatchUrl?:string) {}; +request1.getUUID = function () {}; +request1.pushLocal = function (message:string) {}; + +var subSocket:Atmosphere.Request = socket.subscribe(request1); +var subSocket2:Atmosphere.Request = socket.subscribe('http://chat.com', function() {}, request2); +subSocket2.close(); + +subSocket.push("test"); +socket.unsubscribe(); \ No newline at end of file diff --git a/types/atmosphere.js/index.d.ts b/types/atmosphere.js/index.d.ts new file mode 100644 index 0000000000..0c0bfa3c3a --- /dev/null +++ b/types/atmosphere.js/index.d.ts @@ -0,0 +1,110 @@ +// Type definitions for Atmosphere v2.1.5 +// Project: https://github.com/Atmosphere/atmosphere-javascript +// Definitions by: Kai Toedter +// Fedor Kirpichev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Use this typings in future instead of deprecated 'atmosphere'. + +declare namespace Atmosphere { + interface Atmosphere { + /** + * The atmosphere API is a little bit special here: the first parameter can either be + * a URL string or a Request object. If it is a URL string, then the additional parameters are expected. + */ + subscribe?: (requestOrUrl:any, callback?:Function, request?:Request) => Request; + unsubscribe?: () => void; + + AtmosphereRequest?: AtmosphereRequest; + } + + // needed to fit JavaScript "new atmosphere.AtmosphereRequest()" + // and compile with --noImplicitAny + interface AtmosphereRequest { + new(): Request; + } + + interface Request { + timeout?: number; + method?: string; + headers?: any; + contentType?: string; + callback?: Function; + url?: string; + data?: string; + suspend?: boolean; + maxRequest?: number; + reconnect?: boolean; + maxStreamingLength?: number; + lastIndex?: number; + logLevel?: string; + requestCount?: number; + fallbackMethod?: string; + fallbackTransport?: string; + transport?: string; + webSocketImpl?: any; + webSocketBinaryType?: any; + dispatchUrl?: string; + webSocketPathDelimiter?: string; + enableXDR?: boolean; + rewriteURL?: boolean; + attachHeadersAsQueryString?: boolean; + executeCallbackBeforeReconnect?: boolean; + readyState?: number; + lastTimestamp?: number; + withCredentials?: boolean; + trackMessageLength?: boolean; + messageDelimiter?: string; + connectTimeout?: number; + reconnectInterval?: number; + dropHeaders?: boolean; + uuid?: string; + async?: boolean; + shared?: boolean; + readResponsesHeaders?: boolean; + maxReconnectOnClose?: number; + enableProtocol?: boolean; + pollingInterval?: number; + + onError?: (response?:Response) => void; + onClose?: (response?:Response) => void; + onOpen?: (response?:Response) => void; + onMessage?: (response:Response) => void; + onReopen?: (request?:Request, response?:Response) => void; + onReconnect?: (request?:Request, response?:Response) => void; + onMessagePublished?: (response?:Response) => void; + onTransportFailure?: (reason?:string, response?:Response) => void; + onLocalMessage?: (request?:Request) => void; + onFailureToReconnect?: (request?:Request, response?:Response) => void; + onClientTimeout?: (request?:Request) => void; + + subscribe?: (options:Request) => void; + execute?: () => void; + close?: () => void; + disconnect?: () => void; + getUrl?: () => string; + push?: (message:string, dispatchUrl?:string) => void; + getUUID?: () => void; + pushLocal?: (message:string) => void; + } + + interface Response { + status?: number; + reasonPhrase?: string; + responseBody?: string; + messages?: string[]; + headers?: string[]; + state?: string; + transport?: string; + error?: string; + request?: Request; + partialMessage?: string; + errorHandled?: boolean; + closedByClientTimeout?: boolean; + } +} + +declare var atmosphere:Atmosphere.Atmosphere; +declare module 'atmosphere.js' { + export = atmosphere; +} diff --git a/types/popper.js/tsconfig.json b/types/atmosphere.js/tsconfig.json similarity index 86% rename from types/popper.js/tsconfig.json rename to types/atmosphere.js/tsconfig.json index d459943eff..f06f28e8f7 100644 --- a/types/popper.js/tsconfig.json +++ b/types/atmosphere.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +19,6 @@ }, "files": [ "index.d.ts", - "popper.js-tests.ts" + "atmosphere.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atmosphere/index.d.ts b/types/atmosphere/index.d.ts index 5e88c2c8fb..7b5565cb1d 100644 --- a/types/atmosphere/index.d.ts +++ b/types/atmosphere/index.d.ts @@ -1,8 +1,11 @@ // Type definitions for Atmosphere v2.1.5 // Project: https://github.com/Atmosphere/atmosphere-javascript -// Definitions by: Kai Toedter +// Definitions by: Kai Toedter +// Fedor Kirpichev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// This is deprecated due to module name change. Please use 'atmosphere.js' for future development.. + declare namespace Atmosphere { interface Atmosphere { /** diff --git a/types/atmosphere/tsconfig.json b/types/atmosphere/tsconfig.json index d6b12ce1e3..2fb820bd91 100644 --- a/types/atmosphere/tsconfig.json +++ b/types/atmosphere/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/atom-keymap/README.md b/types/atom-keymap/README.md new file mode 100644 index 0000000000..f900dc1a4c --- /dev/null +++ b/types/atom-keymap/README.md @@ -0,0 +1,21 @@ +## Atom Keymap Type Definitions + +TypeScript type definitions for [Atom Keymap](https://github.com/atom/atom-keymap), which is published as "[atom-keymap](https://www.npmjs.com/package/atom-keymap)" on NPM. + +### Usage Notes + +#### Exports + +This module has a single entity as its export: the [KeymapManager](https://github.com/atom/atom-keymap/blob/master/src/keymap-manager.coffee) class. The require syntax is typically used to import modules like this. + +```ts +import KeymapManager = require("atom-keymap"); +``` + +#### The AtomKeymap Namespace + +Many of the types used by Atom Keymap can be referenced from the AtomKeymap namespace. + +```ts +function example(keybind: AtomKeymap.KeyBinding) {} +``` diff --git a/types/atom-keymap/atom-keymap-tests.ts b/types/atom-keymap/atom-keymap-tests.ts index 1c92bff5c9..6c8871c737 100644 --- a/types/atom-keymap/atom-keymap-tests.ts +++ b/types/atom-keymap/atom-keymap-tests.ts @@ -1,20 +1,91 @@ +import KeymapManager = require("atom-keymap"); +import * as ImportTest from "atom-keymap"; +declare const element: HTMLElement; +declare let sub: EventKit.Disposable; +declare const event: KeyboardEvent; -import { KeymapManager, ICompleteMatchEvent } from "atom-keymap"; +// NPM Examples =============================================================== +const keymaps = new KeymapManager(); +keymaps.defaultTarget = document.body; -var manager = new KeymapManager(); -manager.add('some/unique/path', { - '.workspace': { - 'ctrl-x': 'package:do-something', - 'ctrl-y': 'package:do-something-else' - }, - '.mini.editor': { - 'enter': 'core:confirm' - } +// Pass all the window's keydown events to the KeymapManager +document.addEventListener("keydown", (event): void => { + keymaps.handleKeyboardEvent(event); }); -manager.onDidMatchBinding((event: ICompleteMatchEvent): void => { - console.log(event.binding.command); -}) +// Add some keymaps. It can also be a directory of json / cson files. +keymaps.loadKeymap("/path/to/keymap-file.json"); +// OR +keymaps.add("/key/for/these/keymaps", { + body: { + up: "core:move-up", + down: "core:move-down", + }, +}); + +// When a keybinding is triggered, it will dispatch it on the node that was focused +window.addEventListener("core:move-up", (event) => console.log("up", event)); +window.addEventListener("core:move-down", (event) => console.log("down", event)); + +// General Usage ============================================================== +const manager = new KeymapManager(); +manager.add("some/unique/path", { + ".workspace": { + "ctrl-x": "package:do-something", + "ctrl-y": "package:do-something-else", + }, + ".test": { + enter: "core:confirm", + }, +}); + +manager.onDidMatchBinding((event): void => { + console.log(event.binding.command); +}); manager.destroy(); + +// Atom API Testing =========================================================== +// Class Methods +KeymapManager.buildKeydownEvent("a"); +KeymapManager.buildKeydownEvent("a", { alt: true }); + +// Construction and Destruction +new KeymapManager({ defaultTarget: element }); +manager.clear(); +manager.destroy(); + +// Event Subscription +sub = manager.onDidMatchBinding((event): void => { event.keystrokes; }); +sub = manager.onDidPartiallyMatchBindings((event): void => { event.partiallyMatchedBindings; }); +sub = manager.onDidFailToMatchBinding((event): void => { event.keystrokes; }); +sub = manager.onDidFailToReadFile((event): void => { event.stack; }); + +// Adding and Removing Bindings +sub = manager.add("a", {}, 0); + +// Accessing Bindings +let bindings: AtomKeymap.KeyBinding[] = manager.getKeyBindings(); +bindings = manager.findKeyBindings(); +bindings = manager.findKeyBindings({ command: "a" }); +bindings = manager.findKeyBindings({ keystrokes: "a" }); +bindings = manager.findKeyBindings({ target: element }); +bindings = manager.findKeyBindings({ command: "a", keystrokes: "b"}); +bindings = manager.findKeyBindings({ command: "a", keystrokes: "b", target: element }); + +// Managing Keymap Files +manager.loadKeymap("Test.file"); +manager.loadKeymap("Test.file", { watch: true }); +manager.loadKeymap("Test.file", { watch: true, priority: 0}); + +// Managing Keyboard Events +manager.handleKeyboardEvent(event); +manager.keystrokeForKeyboardEvent(event); + +sub = manager.addKeystrokeResolver((event): string => { + event.layoutName; + return "Test"; +}); + +const num: number = manager.getPartialMatchTimeout(); diff --git a/types/atom-keymap/index.d.ts b/types/atom-keymap/index.d.ts index 58d75ec709..9472e75215 100644 --- a/types/atom-keymap/index.d.ts +++ b/types/atom-keymap/index.d.ts @@ -1,135 +1,236 @@ -// Type definitions for atom-keymap v5.1.5 -// Project: https://github.com/atom/atom-keymap/ -// Definitions by: Vadim Macagon +// Type definitions for atom-keymap 8.x +// Project: https://github.com/atom/atom-keymap +// Definitions by: GlenCFL // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// -import * as AtomEventKit from 'event-kit'; +declare global { + namespace AtomKeymap { + /** Objects that appear as parameters to callbacks. */ + namespace Events { + interface FullKeybindingMatch { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; -export = AtomKeymap; + /** The KeyBinding that the keystrokes matched. */ + binding: KeyBinding; -declare namespace AtomKeymap { - type Disposable = AtomEventKit.Disposable; + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - /** Instance side of KeyBinding class. */ - interface KeyBinding { - enabled: boolean; - source: string; - command: string; - keystrokes: string; - keystrokeCount: number; - selector: string; - specificity: number; + interface PartialKeybindingMatch { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; - matches(keystroke: string): boolean; - compare(keyBinding: KeyBinding): number; - } + /** The KeyBindings that the keystrokes partially matched. */ + partiallyMatchedBindings: KeyBinding[]; - interface ICompleteMatchEvent { - /** Keystrokes that matched the binding. */ - keystrokes: string; - /** Binding that was matched to the keystrokes. */ - binding: KeyBinding; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } + /** DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - interface IPartialMatchEvent { - /** Keystrokes that matched the binding. */ - keystrokes: string; - /** Bindings that were partially matched to the keystrokes. */ - partiallyMatchedBindings: KeyBinding[]; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } + interface FailedKeybindingMatch { + /** The string of keystrokes that failed to match the binding. */ + keystrokes: string; - interface IFailedMatchEvent { - /** Keystrokes that failed to match a binding. */ - keystrokes: string; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - interface IKeymapLoadEvent { - /** Path to a keymap file. */ - path: string; - } + interface FailedKeymapFileRead { + /** The error message. */ + message: string; - /** Static side of KeymapManager class. */ - interface KeymapManagerStatic { - prototype: KeymapManager; - new (options?: { defaultTarget?: Element }): KeymapManager; - } + /** The error stack trace. */ + stack: string; + } - /** Instance side of KeymapManager class. */ - interface KeymapManager { - constructor: KeymapManagerStatic; - /** Unwatches all watched paths. */ - destroy(): void; + interface KeymapLoaded { + /** The path of the keymap file. */ + path: string; + } - // Event Subscription + interface AddedKeystrokeResolver { + /** The currently resolved keystroke string. If your function returns a falsy + * value, this is how Atom will resolve your keystroke. + */ + keystroke: string; - /** Sets callback to invoke when one or more keystrokes completely match a key binding. */ - onDidMatchBinding(callback: (event: ICompleteMatchEvent) => void): Disposable; - /** Sets callback to invoke when one or more keystrokes partially match a binding. */ - onDidPartiallyMatchBindings(callback: (event: IPartialMatchEvent) => void): Disposable; - /** Sets callback to invoke when one or more keystrokes fail to match any bindings. */ - onDidFailToMatchBinding(callback: (event: IFailedMatchEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file is reloaded. */ - onDidReloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file is unloaded. */ - onDidUnloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file could not to be loaded. */ - onDidFailToReadFile(callback: (error: Error) => void): Disposable; + /** The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation + * for more details. + */ + event: KeyboardEvent; - // Adding and Removing Bindings + /** The OS-specific name of the current keyboard layout. */ + layoutName: string; - /** Adds sets of key bindings grouped by CSS selector. */ - add(source: string, keyBindingsBySelector: any): Disposable; + /** An object mapping DOM 3 `KeyboardEvent.code` values to objects with the + * typed character for that key in each modifier state, based on the current + * operating system layout. + */ + keymap: object; + } + } - // Accessing Bindings + /** Objects that appear as parameters to functions. */ + namespace Options { + interface BuildKeyEvent { + ctrl?: boolean; + alt?: boolean; + shift?: boolean; + cmd?: boolean; + which?: number; + target?: Element; + } + } - getKeyBindings(): KeyBinding[]; - findKeyBindings(params?: { - keystrokes: string; // e.g. 'ctrl-x ctrl-s' - command: string; // e.g. 'editor:backspace' - target?: Element; - }): KeyBinding[]; + /** The static side to each exported class. Should generally only be used internally. */ + namespace Statics { + /* tslint:disable:no-unnecessary-qualifier */ + /** The static side to the KeymapManager class. */ + interface KeymapManager { + /** Create a keydown DOM event. */ + buildKeydownEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void; - // Managing Keymap Files + /** Create a keyup DOM event. */ + buildKeyupEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void; - /** - * Loads the key bindings from the given path. - * - * @param bindingsPath A path to a file or a directory. If the path is a directory all files - * inside it will be loaded. + /** Create a new KeymapManager. */ + new (options?: { defaultTarget?: HTMLElement }): AtomKeymap.KeymapManager; + } + /* tslint:enable:no-unnecessary-qualifier */ + } + + /** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding + * method, as well as versions of the ::stopPropagation methods that record the + * intent to stop propagation so event bubbling can be properly simulated for + * detached elements. */ - loadKeymap(bindingsPath: string, options?: { watch: boolean }): void; - /** - * Starts watching the given file/directory for changes, reloading any keymaps at that location - * when changes are detected. - * - * @param filePath A path to a file or a directory. - */ - watchKeymap(filePath: string): void; + interface CommandEvent extends CustomEvent { + keyBindingAborted: boolean; + propagationStopped: boolean; - // Managing Keyboard Events + abortKeyBinding(): void; + stopPropagation(): CustomEvent; + stopImmediatePropagation(): CustomEvent; + } - /** - * Dispatches a custom event associated with the matching key binding for the given - * `KeyboardEvent` if one can be found. + interface KeyBinding { + // Properties + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeArray: string[]; + keystrokeCount: number; + selector: string; + specificity: number; + + // Comparison + /** Determines whether the given keystroke matches any contained within this binding. */ + matches(keystroke: string): boolean; + + /** Compare another KeyBinding to this instance. + * Returns <= -1 if the argument is considered lesser or of lower priority. + * Returns 0 if this binding is equivalent to the argument. + * Returns >= 1 if the argument is considered greater or of higher priority. + */ + compare(other: KeyBinding): number; + } + + /** Allows commands to be associated with keystrokes in a context-sensitive way. + * In Atom, you can access a global instance of this object via `atom.keymaps`. */ - handleKeyboardEvent(event: KeyboardEvent): void; - /** Translates a keydown event to a keystroke string. */ - keystrokeForKeyboardEvent(event: KeyboardEvent): string; - /** - * @return The number of milliseconds allowed before pending states caused by partial matches of - * multi-keystroke bindings are terminated. - */ - getPartialMatchTimeout(): number; + /** Instance side of KeymapManager class. */ + interface KeymapManager { + defaultTarget: HTMLElement; + + partialMatchTimeout: number; + + /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ + clear(): void; + + /** Unwatch all watched paths. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when one or more keystrokes completely match a key binding. */ + onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void): + EventKit.Disposable; + + /** Invoke the given callback when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) => + void): EventKit.Disposable; + + /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) => + void): EventKit.Disposable; + + /** Invoke the given callback when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void): + EventKit.Disposable; + + /** Invoke the given callback when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void): + EventKit.Disposable; + + /** Invoke the given callback when a keymap file not able to be loaded. */ + onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void): + EventKit.Disposable; + + // Adding and Removing Bindings + /** Construct KeyBindings from an object grouping them by CSS selector. */ + build(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): KeyBinding[]; + + /** Add sets of key bindings grouped by CSS selector. */ + add(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): EventKit.Disposable; + + // Accessing Bindings + /** Get all current key bindings. */ + getKeyBindings(): KeyBinding[]; + + /** Get the key bindings for a given command and optional target. */ + findKeyBindings(params?: { + keystrokes?: string, // e.g. 'ctrl-x ctrl-s' + command?: string, // e.g. 'editor:backspace' + target?: Element, + }): KeyBinding[]; + + // Managing Keymap Files + /** Load the key bindings from the given path. */ + loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): + void; + + /** Cause the keymap to reload the key bindings file at the given path whenever + * it changes. + */ + watchKeymap(filePath: string, options?: { priority: number }): void; + + // Managing Keyboard Events + /** Dispatch a custom event associated with the matching key binding for the + * given `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; + + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; + + /** Customize translation of raw keyboard events to keystroke strings. */ + addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string): + EventKit.Disposable; + + /** Get the number of milliseconds allowed before pending states caused by + * partial matches of multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; + } } - - /** Allows commands to be associated with keystrokes in a context-sensitive way.*/ - var KeymapManager: KeymapManagerStatic; } + +declare const KeymapManager: AtomKeymap.Statics.KeymapManager; +export = KeymapManager; diff --git a/types/atom-keymap/tsconfig.json b/types/atom-keymap/tsconfig.json index 84ac8aff2e..f501df325f 100644 --- a/types/atom-keymap/tsconfig.json +++ b/types/atom-keymap/tsconfig.json @@ -7,7 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "atom-keymap-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/atom-keymap/tslint.json b/types/atom-keymap/tslint.json new file mode 100644 index 0000000000..4b036f727a --- /dev/null +++ b/types/atom-keymap/tslint.json @@ -0,0 +1,37 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Custom rules. + "class-name": true, + "indent": [true, "tabs"], + "jsdoc-format": true, + "max-line-length": [true, 100], + "quotemark": [true, "double", "avoid-escape"], + "trailing-comma": [true, { + "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, + "singleline": { "objects": "never", "arrays": "never", "functions": "never" } + }], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type", + "check-typecast", + "check-rest-spread", + "check-preblock" + ], + // Soon to be defaults. + "arrow-return-shorthand": [true, "multiline"], + "no-any": true, + "no-floating-promises": true, + "no-unbound-method": true, + "no-unsafe-any": true, + "number-literal-format": true, + "restrict-plus-operands": true, + "return-undefined": true, + "switch-final-break": true + } +} diff --git a/types/atom-keymap/.editorconfig b/types/atom-keymap/v5/.editorconfig similarity index 100% rename from types/atom-keymap/.editorconfig rename to types/atom-keymap/v5/.editorconfig diff --git a/types/atom-keymap/v5/atom-keymap-tests.ts b/types/atom-keymap/v5/atom-keymap-tests.ts new file mode 100644 index 0000000000..1c92bff5c9 --- /dev/null +++ b/types/atom-keymap/v5/atom-keymap-tests.ts @@ -0,0 +1,20 @@ + + +import { KeymapManager, ICompleteMatchEvent } from "atom-keymap"; + +var manager = new KeymapManager(); +manager.add('some/unique/path', { + '.workspace': { + 'ctrl-x': 'package:do-something', + 'ctrl-y': 'package:do-something-else' + }, + '.mini.editor': { + 'enter': 'core:confirm' + } +}); + +manager.onDidMatchBinding((event: ICompleteMatchEvent): void => { + console.log(event.binding.command); +}) + +manager.destroy(); diff --git a/types/atom-keymap/v5/index.d.ts b/types/atom-keymap/v5/index.d.ts new file mode 100644 index 0000000000..9ffa0a41d3 --- /dev/null +++ b/types/atom-keymap/v5/index.d.ts @@ -0,0 +1,133 @@ +// Type definitions for atom-keymap v5.1.5 +// Project: https://github.com/atom/atom-keymap/ +// Definitions by: Vadim Macagon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as AtomEventKit from 'event-kit'; + +export = AtomKeymap; + +declare namespace AtomKeymap { + type Disposable = AtomEventKit.Disposable; + + /** Instance side of KeyBinding class. */ + interface KeyBinding { + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeCount: number; + selector: string; + specificity: number; + + matches(keystroke: string): boolean; + compare(keyBinding: KeyBinding): number; + } + + interface ICompleteMatchEvent { + /** Keystrokes that matched the binding. */ + keystrokes: string; + /** Binding that was matched to the keystrokes. */ + binding: KeyBinding; + /** DOM element that was the target of the most recent `KeyboardEvent`. */ + keyboardEventTarget: Element; + } + + interface IPartialMatchEvent { + /** Keystrokes that matched the binding. */ + keystrokes: string; + /** Bindings that were partially matched to the keystrokes. */ + partiallyMatchedBindings: KeyBinding[]; + /** DOM element that was the target of the most recent `KeyboardEvent`. */ + keyboardEventTarget: Element; + } + + interface IFailedMatchEvent { + /** Keystrokes that failed to match a binding. */ + keystrokes: string; + /** DOM element that was the target of the most recent `KeyboardEvent`. */ + keyboardEventTarget: Element; + } + + interface IKeymapLoadEvent { + /** Path to a keymap file. */ + path: string; + } + + /** Static side of KeymapManager class. */ + interface KeymapManagerStatic { + prototype: KeymapManager; + new (options?: { defaultTarget?: Element }): KeymapManager; + } + + /** Instance side of KeymapManager class. */ + interface KeymapManager { + constructor: KeymapManagerStatic; + /** Unwatches all watched paths. */ + destroy(): void; + + // Event Subscription + + /** Sets callback to invoke when one or more keystrokes completely match a key binding. */ + onDidMatchBinding(callback: (event: ICompleteMatchEvent) => void): Disposable; + /** Sets callback to invoke when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: IPartialMatchEvent) => void): Disposable; + /** Sets callback to invoke when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: IFailedMatchEvent) => void): Disposable; + /** Sets callback to invoke when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; + /** Sets callback to invoke when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; + /** Sets callback to invoke when a keymap file could not to be loaded. */ + onDidFailToReadFile(callback: (error: Error) => void): Disposable; + + // Adding and Removing Bindings + + /** Adds sets of key bindings grouped by CSS selector. */ + add(source: string, keyBindingsBySelector: any): Disposable; + + // Accessing Bindings + + getKeyBindings(): KeyBinding[]; + findKeyBindings(params?: { + keystrokes: string; // e.g. 'ctrl-x ctrl-s' + command: string; // e.g. 'editor:backspace' + target?: Element; + }): KeyBinding[]; + + // Managing Keymap Files + + /** + * Loads the key bindings from the given path. + * + * @param bindingsPath A path to a file or a directory. If the path is a directory all files + * inside it will be loaded. + */ + loadKeymap(bindingsPath: string, options?: { watch: boolean }): void; + /** + * Starts watching the given file/directory for changes, reloading any keymaps at that location + * when changes are detected. + * + * @param filePath A path to a file or a directory. + */ + watchKeymap(filePath: string): void; + + // Managing Keyboard Events + + /** + * Dispatches a custom event associated with the matching key binding for the given + * `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; + /** + * @return The number of milliseconds allowed before pending states caused by partial matches of + * multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; + } + + /** Allows commands to be associated with keystrokes in a context-sensitive way.*/ + var KeymapManager: KeymapManagerStatic; +} diff --git a/types/atom-keymap/v5/tsconfig.json b/types/atom-keymap/v5/tsconfig.json new file mode 100644 index 0000000000..4995308609 --- /dev/null +++ b/types/atom-keymap/v5/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "atom-keymap": [ + "atom-keymap/v5" + ], + "event-kit": [ + "event-kit/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "atom-keymap-tests.ts" + ] +} \ No newline at end of file diff --git a/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts b/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts new file mode 100644 index 0000000000..434e48f261 --- /dev/null +++ b/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts @@ -0,0 +1,38 @@ +import { createRunner } from "atom-mocha-test-runner"; +import defaultMochaRunner = require("atom-mocha-test-runner"); + +const extraOptions = { + testSuffixes: ["-spec.js", "-spec.coffee"], +}; + +function mochaSetup(mocha: Mocha) { + mocha.addFile("test.file"); +} + +let testRunner = createRunner(); +testRunner = createRunner(extraOptions); +testRunner = createRunner(extraOptions, mochaSetup); +testRunner = createRunner({ + colors: true, + globalAtom: true, + htmlTitle: "Test Title", + reporter: "dot", + testSuffixes: ["test.file"], +}); + +declare const atom: Atom.AtomEnvironment; +declare const blob: object; +declare let num: number; + +async function runTests(): Promise { + const runnerArgs: Atom.Structures.TestRunnerArgs = { + testPaths: ["/var/test"], + logFile: "/var/log", + headless: false, + buildDefaultApplicationDelegate: () => blob, + buildAtomEnvironment: () => atom, + }; + + num = await defaultMochaRunner(runnerArgs); + return await testRunner(runnerArgs); +} diff --git a/types/atom-mocha-test-runner/index.d.ts b/types/atom-mocha-test-runner/index.d.ts new file mode 100644 index 0000000000..432d91c71a --- /dev/null +++ b/types/atom-mocha-test-runner/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for atom-mocha-test-runner 1.0 +// Project: https://github.com/BinaryMuse/atom-mocha-test-runner +// Definitions by: GlenCFL +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + +interface AtomMochaOptions { + /** Which reporter to use on the terminal. */ + reporter?: string; + + /** Whether or not to assign the created Atom environment to `global.atom`. */ + globalAtom?: boolean; + + /** File extensions that indicate that the file contains tests. */ + testSuffixes?: string[]; + + /** Whether or not to colorize output on the terminal. */ + colors?: boolean; + + /** The string to use for the window title in the HTML reporter. */ + htmlTitle?: string; +} + +// The test runner function is augmented on export by: +// import createRunner from './lib/create-runner' +// +// module.exports = createRunner() +// module.exports.createRunner = createRunner +// Which is what we're trying to model here. +interface TestRunnerExport extends AtomCore.TestRunner { + createRunner(options?: AtomMochaOptions, mochaConfigFunction?: + (mocha: Mocha) => void): AtomCore.TestRunner; +} + +declare const runner: TestRunnerExport; +export = runner; diff --git a/types/atom-mocha-test-runner/tsconfig.json b/types/atom-mocha-test-runner/tsconfig.json new file mode 100644 index 0000000000..22df333ccd --- /dev/null +++ b/types/atom-mocha-test-runner/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "atom-mocha-test-runner-tests.ts" + ] +} diff --git a/types/atom-mocha-test-runner/tslint.json b/types/atom-mocha-test-runner/tslint.json new file mode 100644 index 0000000000..4b036f727a --- /dev/null +++ b/types/atom-mocha-test-runner/tslint.json @@ -0,0 +1,37 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Custom rules. + "class-name": true, + "indent": [true, "tabs"], + "jsdoc-format": true, + "max-line-length": [true, 100], + "quotemark": [true, "double", "avoid-escape"], + "trailing-comma": [true, { + "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, + "singleline": { "objects": "never", "arrays": "never", "functions": "never" } + }], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type", + "check-typecast", + "check-rest-spread", + "check-preblock" + ], + // Soon to be defaults. + "arrow-return-shorthand": [true, "multiline"], + "no-any": true, + "no-floating-promises": true, + "no-unbound-method": true, + "no-unsafe-any": true, + "number-literal-format": true, + "restrict-plus-operands": true, + "return-undefined": true, + "switch-final-break": true + } +} diff --git a/types/atom/README.md b/types/atom/README.md new file mode 100644 index 0000000000..ba2d52a6f4 --- /dev/null +++ b/types/atom/README.md @@ -0,0 +1,42 @@ +## Atom API Type Definitions + +TypeScript type definitions for the [Atom Text Editor](https://atom.io/) public API, which is used to develop packages for the editor. Documentation for the public API can be found [here](https://atom.io/docs/api/v1.21.0/). + +### Exports + +#### The "atom" Variable + +These definitions declare a global static variable named "atom" as ambient. Once these definitions have been referenced within your project, you will be able to access properties and member functions from the [AtomEnvironment](https://atom.io/docs/api/v1.21.0/AtomEnvironment) class off of this variable, as it is an instance of that class. + +```ts +if (atom.inDevMode()) {} +``` + +#### The Atom Namespace + +All of the types used by or referenced by the Atom public API have been pulled into the Atom namespace, providing a consistent and easy way to access each of them, without having to care about where that type actually lives within the Atom codebase. + +```ts +function example(buffer: Atom.TextBuffer) {} +``` + +#### The AtomCore Namespace + +All classes which are core to Atom itself have been provided under the AtomCore namespace. + +```ts +function example(cursor: AtomCore.Cursor) {} +``` + +### Service Type Definitions + +There are many services provided by other Atom packages that you may want to use within your own Atom package. We bundle type definitions for several of these services with these type definitions. + +```ts +/// +let completionProvider: Atom.Services.Autocomplete.Provider; +``` + +The currently supported services are: +- [Autocomplete](https://github.com/atom/autocomplete-plus) +- [Status Bar](https://github.com/atom/status-bar) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 5987f4901d..34f19e5f3e 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1,70 +1,2152 @@ -import path = require("path"); -import _atom = require("atom"); +declare let str: string; +declare let num: number; +declare let bool: boolean; +declare let strs: string[]; +declare let obj: object; +declare let objs: object[]; +declare let regExp: RegExp; -import PathWatcher = require("pathwatcher"); -var File = PathWatcher.File; +declare let element: HTMLElement; +declare let elements: HTMLElement[]; +declare const div: HTMLDivElement; -const jq: JQuery = $("selector"); +declare let grammar: Atom.Grammar; +declare let pos: Atom.Point; +declare let posArr: Atom.Point[]; +declare let range: Atom.Range; +declare let ranges: Atom.Range[]; +declare let marker: Atom.Marker; +declare let displayMarker: Atom.DisplayMarker; +declare let displayMarkers: Atom.DisplayMarker[]; +declare let displayMarkerLayer: Atom.DisplayMarkerLayer; +declare let sub: Atom.Disposable; +declare let dir: Atom.Directory; +declare let dirs: Atom.Directory[]; -class SampleView extends _atom.ScrollView { +declare let buffer: Atom.TextBuffer; +declare let cursor: Atom.Cursor; +declare let cursors: Atom.Cursor[]; +declare let editor: Atom.TextEditor; +declare let editors: Atom.TextEditor[]; +declare let decoration: Atom.Decoration; +declare let decorations: Atom.Decoration[]; +declare let notification: Atom.Notification; +declare let notifications: Atom.Notification[]; +declare let scopeDescriptor: Atom.ScopeDescriptor; +declare let pack: Atom.Package; +declare let packs: Atom.Package[]; +declare let pane: Atom.Pane; +declare let panes: Atom.Pane[]; +declare let panel: Atom.Panel; +declare let panels: Atom.Panel[]; +declare let project: Atom.Project; +declare let repository: Atom.GitRepository; +declare let repositories: Atom.GitRepository[]; +declare let gutter: Atom.Gutter; +declare let gutters: Atom.Gutter[]; +declare let historyPaths: Atom.HistoryProject[]; +declare let layerDecoration: Atom.LayerDecoration; +declare let selection: Atom.Selection; +declare let selections: Atom.Selection[]; +declare let styleManager: Atom.StyleManager; +declare let tooltips: Atom.Tooltip[]; +declare let dock: Atom.Dock; +declare let workspaceCenter: Atom.WorkspaceCenter; +declare let paneContainer: Atom.Dock|Atom.WorkspaceCenter; - editorId:string; - file:PathWatcher.IFile; - editor:AtomCore.IEditor; +// Exports Testing ============================================================ +import { BufferedNodeProcess, BufferedProcess, GitRepository, Notification, + TextBuffer, TextEditor, Point, Range, File, Directory, Emitter, Disposable, + CompositeDisposable, Task, watchPath } from "atom"; - static deserialize(state:any):SampleView { - return new SampleView(state); +const pathWatcher = watchPath("/var/test", {}, (events) => { + for (const event of events) { + str = event.path; + str = event.action; + if (event.oldPath) str = event.oldPath; } +}); - static content():any { - return this.div({class: 'sample native-key-bindings', tabindex: -1}); - } +// global "atom" +atom.commands; +atom.config; +atom.clipboard; +atom.contextMenu; +atom.menu; +atom.keymaps; +atom.tooltips; +atom.notifications; +atom.project; +atom.grammars; +atom.history; +atom.packages; +atom.themes; +atom.styles; +atom.deserializers; +atom.views; +atom.workspace; +atom.textEditors; +atom.onDidBeep((): void => {}); +atom.onWillThrowError((): void => {}); +atom.onDidThrowError((): void => {}); +atom.whenShellEnvironmentLoaded((): void => {}); +atom.inDevMode(); +atom.inSafeMode(); +atom.inSpecMode(); +atom.getVersion(); +str = atom.getReleaseChannel(); +atom.isReleasedVersion(); +atom.getWindowLoadTime(); - constructor(params:{editorId?:string; filePath?:string;} = {}) { - super(); +const loadSettings = atom.getLoadSettings(); +const testValue = loadSettings.env["test"]; +if (testValue) str = testValue; - this.editorId = params.editorId; +atom.open({ devMode: false, newWindow: true, pathsToOpen: ["Test.file"], + safeMode: false }); +atom.close(); +atom.getSize(); +atom.setSize(42, 42); +atom.getPosition(); +atom.setPosition(42, 42); +atom.pickFolder((): void => {}); - if (this.editorId) { - this.resolveEditor(this.editorId); - } else { - this.file = new File(params.filePath); +obj = atom.getCurrentWindow(); + +atom.center(); +atom.focus(); +atom.show(); +atom.hide(); +atom.reload(); +atom.restartApplication(); +atom.isMaximized(); +atom.isFullScreen(); +atom.setFullScreen(true); +atom.toggleFullScreen(); +atom.beep(); +atom.confirm({ buttons: ["Test"], detailedMessage: "Test", message: "Test" }); + +async function toggleDevTools() { + await atom.openDevTools(); + await atom.toggleDevTools(); +} + +atom.executeJavaScriptInDevTools("Test"); + +// Usage Testing ============================================================== +// Some examples taken from the Atom documentation. +// .commands +sub = atom.commands.add("test", { "execute-command": () => {}}); + +// .clipboard +str = atom.clipboard.read(); + +// .contextMenu +sub = atom.contextMenu.add({ + "atom-workspace": [{label: "Help", command: "application:open-documentation"}], + "atom-text-editor": [{ + label: "History", + submenu: [ + { label: "Undo", command: "core:undo" }, + { label: "Redo", command: "core:redo" }, + ], + }], +}); + +// .menu +sub = atom.menu.add([{ + label: "Hello", + submenu : [{ label: "World!", command: "hello:world" }], +}]); + +// .keymaps +atom.keymaps.add("Test.Path", { + selector: { + a: "execute-something", + }, +}); + +// .tooltips +sub = atom.tooltips.add(div, { title: "Tooltip Test" }); + +// .notifications +notification = atom.notifications.addError("Error"); + +// .project +atom.project.addPath("/var/test"); + +// .grammars +grammar = atom.grammars.loadGrammarSync("Test.file"); + +// .history +historyPaths = atom.history.getProjects(); + +// .packages +sub = atom.packages.onDidActivatePackage((atomPackage) => { + atomPackage.isCompatible(); +}); + +// .themes +sub = atom.themes.onDidChangeActiveThemes(() => {}); + +// .styles +sub = atom.styles.onDidAddStyleElement((styleElement) => {}); + +// .deserializers +const serializer = { + name: "Test", + deserialize: () => ({}), +}; +atom.deserializers.add(serializer); + +// .views +sub = atom.views.addViewProvider(Range, (range): HTMLElement => { + range.start; + return div; +}); + +// .workspace +sub = atom.workspace.observeTextEditors((editor) => { + sub = editor.onDidStopChanging((event) => { + for (const change of event.changes) { + change.newExtent; } + }); + + const text: string[] = editor.getBuffer().getLines(); +}); + +// .textEditors +atom.textEditors.add(editor); + +// Atom API Testing =========================================================== +//// AtomEnvironment ========================================================== +// Event Subscription +sub = atom.onDidBeep(() => {}); +sub = atom.onWillThrowError(event => event.message); +sub = atom.onDidThrowError(event => event.line); +sub = atom.whenShellEnvironmentLoaded(() => {}); + +// Atom Details +bool = atom.inDevMode(); +bool = atom.inSafeMode(); +bool = atom.inSpecMode(); +str = atom.getVersion(); +bool = atom.isReleasedVersion(); +num = atom.getWindowLoadTime(); +obj = atom.getLoadSettings(); + +// Managing The Atom Window +declare let dim: { width: number, height: number }; +declare let v2: { x: number, y: number }; + +// atom.open(params); +atom.close(); +dim = atom.getSize(); +atom.setSize(42, 42); +v2 = atom.getPosition(); +atom.setPosition(42, 42); + +atom.pickFolder((paths) => { + if (paths) { + paths.length; } +}); - serialize() { - return { - deserializer: 'SampleView', - editorId: this.editorId - }; - } +atom.getCurrentWindow(); +atom.center(); +atom.focus(); +atom.show(); +atom.hide(); +atom.reload(); +atom.restartApplication(); +bool = atom.isMaximized(); +bool = atom.isFullScreen(); +atom.setFullScreen(true); +atom.toggleFullScreen(); - destroy() { - this.unsubscribe(); - } +// Messaging the User +atom.beep(); - resolveEditor(editorId:string) { - var resolve = ()=> { - if (this.editor) { - jq.trigger("title-changed"); - } else { - var view = jq.parents('.pane').view(); - if (view) { - view.destroyItem(this); - } - } - }; +atom.confirm({ message: "Test" }); +atom.confirm({ message: "Test", buttons: [ "a", "b" ], detailedMessage: "Test" }); +num = atom.confirm({ message: "Test", detailedMessage: "Test", buttons: { + Test: () => { atom.beep(); }, +}}); - if (atom.workspace) { - resolve(); - } else { - atom.packages.once("activated", ()=> { - resolve(); - }); - } +// Managing the Dev Tools +async function manageDevTools() { + await atom.openDevTools(); + await atom.toggleDevTools(); +} + +atom.executeJavaScriptInDevTools("Test"); + +//// BufferedNodeProcess ====================================================== +const nodeProcess = new BufferedNodeProcess({ + command: "File.path", +}); + +new BufferedNodeProcess({ + command: "File.path", + args: [], + options: { + cwd: "/var/test", + detached: true, + }, + exit: (): void => {}, + stderr: (): void => {}, + stdout: (): void => {}, +}); + +//// BufferedProcess ========================================================== +const process = new BufferedProcess({ + command: "File.path", +}); + +new BufferedProcess({ + command: "File.path", + args: [], + options: {}, + exit: (): void => {}, + stderr: (): void => {}, + stdout: (): void => {}, +}); + +sub = process.onWillThrowError((error) => { + error.error; + error.handle(); +}); + +process.kill(); + +//// Clipboard ================================================================ +atom.clipboard.read(); +atom.clipboard.write("Test"); +const clip = atom.clipboard.readWithMetadata(); +str = clip.text; +obj = clip.metadata; + +//// Color ==================================================================== +declare const color: Atom.Color; +str = color.toHexString(); +str = color.toRGBAString(); + +//// CommandRegistry ========================================================== +atom.commands.add("test", "test:function", (event) => {}); +atom.commands.add("test", { + "test-function": (event) => {}, + "test-function2": (event) => {}, +}); +atom.commands.add("test", "test:function", { + didDispatch: (event) => event.stopImmediatePropagation(), + description: "A Command Test", + displayName: "Command: Test", +}); + +const commands = atom.commands.findCommands({ target: element }); +atom.commands.dispatch(element, "test:function"); +sub = atom.commands.onWillDispatch((event) => { event.stopPropagation(); }); +sub = atom.commands.onDidDispatch((event) => { event.cancelable; }); + +//// CompositeDisposable -- See 'event-kit' testing. +//// Config =================================================================== +atom.config.observe("test", (event) => {}); +atom.config.observe("test", { scope: scopeDescriptor }, (value) => {}); + +atom.config.onDidChange((event) => { event.newValue; }); +atom.config.onDidChange("test", (event) => { event.oldValue; }); + +// Managing Settings +atom.config.get("test"); +atom.config.get("test", { scope: scopeDescriptor }); +atom.config.get("test", { excludeSources: ["test.source"] }); +atom.config.get("test", { sources: ["test.source"] }); +atom.config.get("test", { scope: scopeDescriptor, excludeSources: ["a"], + sources: ["b"] }); + +atom.config.set("test", 42); +atom.config.set("test", 42, { scopeSelector: "test-selector" }); +atom.config.set("test", 42, { source: "test" }); +atom.config.set("test", 42, {scopeSelector: "test-selector", source: "test" }); + +atom.config.unset("test"); +atom.config.unset("test", { scopeSelector: "test-selector" }); +atom.config.unset("test", { source: "test" }); +atom.config.unset("test", { scopeSelector: "test-selector", source: "test" }); + +const allConfigValues = atom.config.getAll("test"); +for (const { scopeDescriptor, value } of allConfigValues) { + scopeDescriptor.scopes; +} +atom.config.getAll("test", { scope: scopeDescriptor }); +atom.config.getAll("test", { excludeSources: ["test"] }); +atom.config.getAll("test", { sources: ["test"] }); +atom.config.getAll("test", { scope: scopeDescriptor, excludeSources: ["a"], + sources: ["b"] }); + +strs = atom.config.getSources(); + +atom.config.getSchema("test"); + +str = atom.config.getUserConfigPath(); + +atom.config.transact(() => {}); + +//// ContextMenuManager -- See above. +//// Cursor =================================================================== +// Event Subscription +sub = cursor.onDidChangePosition((event) => { event.newBufferPosition; }); +sub = cursor.onDidDestroy(() => {}); + +// Managing Cursor Position +cursor.setScreenPosition(pos); +cursor.setScreenPosition(pos, {}); +cursor.setScreenPosition(pos, { autoscroll: true }); + +pos = cursor.getScreenPosition(); + +cursor.setBufferPosition(pos); +cursor.setBufferPosition(pos, {}); +cursor.setBufferPosition(pos, { autoscroll: true }); + +pos = cursor.getBufferPosition(); +num = cursor.getScreenRow(); +num = cursor.getScreenColumn(); +num = cursor.getBufferRow(); +num = cursor.getBufferColumn(); +str = cursor.getCurrentBufferLine(); +bool = cursor.isAtBeginningOfLine(); +bool = cursor.isAtEndOfLine(); + +// Cursor Position Details +displayMarker = cursor.getMarker(); +bool = cursor.isSurroundedByWhitespace(); +bool = cursor.isBetweenWordAndNonWord(); + +bool = cursor.isInsideWord(); +bool = cursor.isInsideWord({}); +bool = cursor.isInsideWord({ wordRegex: regExp }); + +num = cursor.getIndentLevel(); +scopeDescriptor = cursor.getScopeDescriptor(); +bool = cursor.hasPrecedingCharactersOnLine(); +bool = cursor.isLastCursor(); + +// Moving the Cursor +cursor.moveUp(); +cursor.moveUp(42); +cursor.moveUp(42, {}); +cursor.moveUp(42, { moveToEndOfSelection: true }); + +cursor.moveDown(); +cursor.moveDown(42); +cursor.moveDown(42, {}); +cursor.moveDown(42, { moveToEndOfSelection: true }); + +cursor.moveLeft(); +cursor.moveLeft(42); +cursor.moveLeft(42, {}); +cursor.moveLeft(42, { moveToEndOfSelection: true }); + +cursor.moveRight(); +cursor.moveRight(42); +cursor.moveRight(42, {}); +cursor.moveRight(42, { moveToEndOfSelection: true }); + +cursor.moveToTop(); +cursor.moveToBottom(); +cursor.moveToBeginningOfScreenLine(); +cursor.moveToBeginningOfLine(); +cursor.moveToFirstCharacterOfLine(); +cursor.moveToEndOfScreenLine(); +cursor.moveToEndOfLine(); +cursor.moveToBeginningOfWord(); +cursor.moveToEndOfWord(); +cursor.moveToBeginningOfNextWord(); +cursor.moveToPreviousWordBoundary(); +cursor.moveToNextWordBoundary(); +cursor.moveToPreviousSubwordBoundary(); +cursor.moveToNextSubwordBoundary(); +cursor.skipLeadingWhitespace(); +cursor.moveToBeginningOfNextParagraph(); +cursor.moveToBeginningOfPreviousParagraph(); + +// Local Positions and Ranges +pos = cursor.getPreviousWordBoundaryBufferPosition(); +pos = cursor.getPreviousWordBoundaryBufferPosition({}); +pos = cursor.getPreviousWordBoundaryBufferPosition({ wordRegex: regExp }); + +cursor.getNextWordBoundaryBufferPosition(); +cursor.getNextWordBoundaryBufferPosition({ wordRegex: regExp }); + +cursor.getBeginningOfCurrentWordBufferPosition(); +cursor.getBeginningOfCurrentWordBufferPosition({}); +cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp }); +cursor.getBeginningOfCurrentWordBufferPosition({ allowPrevious: true }); +cursor.getBeginningOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); +cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp, + allowPrevious: true, includeNonWordCharacters: true }); + +cursor.getEndOfCurrentWordBufferPosition(); +cursor.getEndOfCurrentWordBufferPosition({}); +cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp }); +cursor.getEndOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); +cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp, includeNonWordCharacters: + true }); + +cursor.getBeginningOfNextWordBufferPosition(); +cursor.getBeginningOfNextWordBufferPosition({}); +cursor.getBeginningOfNextWordBufferPosition({ wordRegex: regExp }); + +cursor.getCurrentWordBufferRange(); +cursor.getCurrentWordBufferRange({}); +cursor.getCurrentWordBufferRange({ wordRegex: regExp }); + +cursor.getCurrentLineBufferRange(); +cursor.getCurrentLineBufferRange({}); +cursor.getCurrentLineBufferRange({ includeNewline: true }); + +range = cursor.getCurrentParagraphBufferRange(); +str = cursor.getCurrentWordPrefix(); + +// Comparing to another cursor +num = cursor.compare(cursor); + +// Utilities +cursor.clearSelection(); + +regExp = cursor.wordRegExp(); +regExp = cursor.wordRegExp({}); +regExp = cursor.wordRegExp({ includeNonWordCharacters: true }); + +regExp = cursor.subwordRegExp(); +regExp = cursor.subwordRegExp({}); +regExp = cursor.subwordRegExp({ backwards: true }); + +//// CustomTestRunner ========================================================= +// http://flight-manual.atom.io/hacking-atom/sections/writing-specs/#customizing-your-test-runner +const testRunner: Atom.TestRunner = (params) => { + const delegate = params.buildDefaultApplicationDelegate(); + const environment = params.buildAtomEnvironment({ + applicationDelegate: delegate, + configDirPath: "/var/test", + document, + enablePersistence: false, + window, + }); + const { width, height } = environment.getSize(); + return Promise.resolve(width + height); +}; + +//// Decoration =============================================================== +// Construction and Destruction +decoration.destroy(); + +// Event Subscription +sub = decoration.onDidChangeProperties(event => { event.oldProperties.gutterName; }); +sub = decoration.onDidDestroy(() => {}); + +// Decoration Details +num = decoration.getId(); +displayMarker = decoration.getMarker(); + +// Properties +const decorationProps = decoration.getProperties(); + +decoration.setProperties(decorationProps); + +//// DeserializerManager ====================================================== +class StorableClass { + name: string; + + constructor() {} + deserialize() { return {}; } +} + +function isStorableClass(o: object): o is StorableClass { + if (typeof o === "object" && ( o).name && + ( o).name === "test") { + return true; + } else { + return false; } } -atom.deserializers.add(SampleView); +let serializable = new StorableClass(); +atom.deserializers.add(serializable); +const blob = atom.deserializers.deserialize({ name: "test" }); +if (blob && isStorableClass(blob)) serializable = blob; -export = SampleView; +//// Directory -- See 'pathwatcher' testing. +//// DisplayMarker -- See 'text-buffer' testing. +//// DisplayMarkerLayer -- See 'text-buffer' testing. +//// Disposable -- See 'event-kit' testing. +//// Dock ===================================================================== +// Methods +dock.activate(); +dock.show(); +dock.hide(); +dock.toggle(); +bool = dock.isVisible(); + +// Event Subscription +sub = dock.observePaneItems(() => {}); +sub = dock.onDidChangeActivePaneItem(() => {}); +sub = dock.onDidStopChangingActivePaneItem(() => {}); +sub = dock.observeActivePaneItem(() => {}); +sub = dock.onDidAddPane(event => event.pane.activate()); +sub = dock.onWillDestroyPane(event => event.pane); +sub = dock.onDidDestroyPane(event => event.pane); +sub = dock.observePanes(pane => pane.activate()); +sub = dock.onDidChangeActivePane(pane => pane.activate()); +sub = dock.observeActivePane(pane => pane.activate()); +sub = dock.onDidAddPaneItem(event => event.index && event.item && event.pane); +sub = dock.onWillDestroyPaneItem(event => event.index && event.item && event.pane); +sub = dock.onDidDestroyPaneItem(event => event.index && event.item && event.pane); + +// Pane Items +objs = dock.getPaneItems(); +obj = dock.getActivePaneItem(); + +// Panes +panes = dock.getPanes(); +pane = dock.getActivePane(); +bool = dock.activateNextPane(); +bool = dock.activatePreviousPane(); + +//// Emitter -- See 'event-kit' testing. +//// File -- See 'pathwatcher' testing. +//// GitRepository ============================================================ +// Construction and Destruction +repository = new GitRepository("Test"); +repository = new GitRepository("Test", {}); +repository = new GitRepository("Test", { refreshOnWindowFocus: true }); +repository = new GitRepository("Test", { config: atom.config }); +repository = new GitRepository("Test", { project: atom.project }); +repository = new GitRepository("Test", { refreshOnWindowFocus: false, config: atom.config, + project: atom.project }); +repository.destroy(); +bool = repository.isDestroyed(); + +// Event Subscription +sub = repository.onDidDestroy(() => {}); +sub = repository.onDidChangeStatus(event => event.path && event.pathStatus); +sub = repository.onDidChangeStatuses(() => {}); + +// Repository Details +repository.getType(); +str = repository.getPath(); +str = repository.getWorkingDirectory(); +bool = repository.isProjectAtRoot(); +str = repository.relativize(); +bool = repository.hasBranch("master"); + +str = repository.getShortHead(); +str = repository.getShortHead("test.path"); + +bool = repository.isSubmodule("test.path"); + +declare var aheadBehindCount: { ahead: number, behind: number }; +aheadBehindCount = repository.getAheadBehindCount("ref"); +aheadBehindCount = repository.getAheadBehindCount("ref", "test.path"); + +aheadBehindCount = repository.getCachedUpstreamAheadBehindCount(); +aheadBehindCount = repository.getCachedUpstreamAheadBehindCount("test.path"); + +str = repository.getConfigValue("username"); +str = repository.getConfigValue("username", "test.path"); + +str = repository.getOriginURL(); +str = repository.getOriginURL("test.path"); + +let upstreamBranch = repository.getUpstreamBranch(); +if (upstreamBranch) { + str = upstreamBranch; +} + +upstreamBranch = repository.getUpstreamBranch("test.path"); +if (upstreamBranch) { + str = upstreamBranch; +} + +declare var gitReferences: { heads: string[], remotes: string[], tags: string[] }; +gitReferences = repository.getReferences(); +gitReferences = repository.getReferences("test.path"); + +str = repository.getReferenceTarget("ref"); +str = repository.getReferenceTarget("ref", "test.path"); + +// Reading Status +bool = repository.isPathModified("file.path"); +bool = repository.isPathNew("file.path"); +bool = repository.isPathIgnored("file.path"); +num = repository.getDirectoryStatus("file.path"); +num = repository.getPathStatus("file.path"); + +const cachedPathStatus = repository.getCachedPathStatus("file.path"); +if (cachedPathStatus) { + num = cachedPathStatus; +} + +bool = repository.isStatusModified(42); +bool = repository.isStatusNew(42); + +// Retrieving Diffs +declare var diffStats: { added: number, deleted: number }; +diffStats = repository.getDiffStats("file.path"); + +declare var lineDiffs: Array<{ oldStart: number, newStart: number, oldLines: number, + newLines: number }>; +lineDiffs = repository.getLineDiffs("file.path", "contents"); + +// Checking Out +bool = repository.checkoutHead("file.path"); +bool = repository.checkoutReference("ref", true); + +//// Grammar -- See 'first-mate' testing. +//// GrammarRegistry -- See 'first-mate' testing. +//// Gutter =================================================================== +// Gutter Destruction +gutter.destroy(); + +// Event Subscription +sub = gutter.onDidChangeVisible(gutter => gutter.isVisible()); +sub = gutter.onDidDestroy(() => {}); + +// Visibility +gutter.hide(); +gutter.show(); +bool = gutter.isVisible(); +decoration = gutter.decorateMarker(displayMarker, { type: "line-number" }); + +//// HistoryManager =========================================================== +historyPaths = atom.history.getProjects(); +atom.history.clearProjects(); +sub = atom.history.onDidChangeProjects(() => {}); + +//// KeymapManager -- See 'atom-keymap' testing. +//// LayerDecoration ========================================================== +layerDecoration.destroy(); +bool = layerDecoration.isDestroyed(); +layerDecoration.getProperties(); +declare let decorationLayerProps: Atom.Structures.DecorationLayerProps; +layerDecoration.setProperties(decorationLayerProps); +layerDecoration.setPropertiesForMarker(marker, { type: "line", class: "test-class" }); + +//// MarkerLayer -- See 'text-buffer' testing. +//// MenuManager ============================================================== +sub = atom.menu.add([ + { + label: "Hello", + submenu : [{ label: "World!", command: "hello:world" }], + }, +]); +atom.menu.update(); + +//// Notification ============================================================= +notification = new Notification("fatal", "Test"); +notification = new Notification("success", "Test", {}); +notification = new Notification("info", "Test", { + buttons: [ + { className: "Test", text: "Test", onDidClick: () => {}}, + ], + description: "Test", + detail: "Test", + dismissable: false, + icon: "Test", +}); + +// Event Subscription +sub = notification.onDidDismiss(notification => notification.dismissed); +sub = notification.onDidDisplay(notification => notification.timestamp); + +// Methods +str = notification.getType(); +str = notification.getMessage(); + +// Extended Methods +notification.dismiss(); + +//// NotificationManager ====================================================== +// Events +atom.notifications.onDidAddNotification(notification => notification.dismiss()); + +// Adding Notifications +atom.notifications.addSuccess("Test"); +atom.notifications.addSuccess("Test", {}); +atom.notifications.addSuccess("Test", { + description: "Desc", + detail: "Details", + dismissable: true, + icon: "Icon", + buttons: [{ + text: "Button", + onDidClick: () => {}, + className: "test-class", + }], +}); + +atom.notifications.addInfo("Test"); +atom.notifications.addInfo("Test", {}); +atom.notifications.addInfo("Test", { description: "Desc" }); + +atom.notifications.addWarning("Test"); +atom.notifications.addWarning("Test", {}); +atom.notifications.addWarning("Test", { description: "Desc" }); + +atom.notifications.addError("Test"); +atom.notifications.addError("Test", {}); +atom.notifications.addError("Test", { stack: "Stack" }); + +atom.notifications.addFatalError("Test"); +atom.notifications.addFatalError("Test", {}); +atom.notifications.addFatalError("Test", { stack: "Stack" }); + +// Getting Notifications +notifications = atom.notifications.getNotifications(); + +//// Package ================================================================== +// Event Subscription +pack.onDidDeactivate(() => {}); + +// Native Module Compatibility +bool = pack.isCompatible(); +declare let exitInfo: Promise<{ code: number, stderr: string, stdout: string }>; +exitInfo = pack.rebuild(); + +const buildFailureOutput = pack.getBuildFailureOutput(); +if (buildFailureOutput) { + str = buildFailureOutput; +} + +//// PackageManager ===========================================================\ +// Event Subscription +sub = atom.packages.onDidLoadInitialPackages(() => {}); +sub = atom.packages.onDidActivateInitialPackages(() => {}); +sub = atom.packages.onDidActivatePackage(pack => pack.name); +sub = atom.packages.onDidDeactivatePackage(pack => pack.path); +sub = atom.packages.onDidLoadPackage(pack => pack.isCompatible()); +sub = atom.packages.onDidUnloadPackage(pack => pack.bundledPackage); + +// Package system data +str = atom.packages.getApmPath(); +strs = atom.packages.getPackageDirPaths(); + +// General package data +const packagePath = atom.packages.resolvePackagePath("Test"); +if (packagePath) { + str = packagePath; +} + +bool = atom.packages.isBundledPackage("Test"); + +// Enabling and disabling packages +let potentialPack = atom.packages.enablePackage("Test"); +if (potentialPack) { + pack = potentialPack; +} + +potentialPack = atom.packages.disablePackage("Test"); +if (potentialPack) { + pack = potentialPack; +} + +bool = atom.packages.isPackageDisabled("Test"); + +// Accessing active packages +packs = atom.packages.getActivePackages(); + +potentialPack = atom.packages.getActivePackage("Test"); +if (potentialPack) { + pack = potentialPack; +} + +bool = atom.packages.isPackageActive("Test"); +bool = atom.packages.hasActivatedInitialPackages(); + +// Accessing loaded packages +packs = atom.packages.getLoadedPackages(); + +potentialPack = atom.packages.getLoadedPackage("Test"); +if (potentialPack) { + pack = potentialPack; +} + +bool = atom.packages.isPackageLoaded("Test"); +bool = atom.packages.hasLoadedInitialPackages(); + +// Accessing available packages +strs = atom.packages.getAvailablePackagePaths(); +strs = atom.packages.getAvailablePackageNames(); +strs = atom.packages.getAvailablePackageMetadata(); + +//// Pane ===================================================================== +// Event Subscription +sub = pane.onDidChangeFlexScale(scale => num = scale); +sub = pane.observeFlexScale(scale => num = scale); +sub = pane.onDidActivate(() => {}); +sub = pane.onWillDestroy(() => {}); +sub = pane.onDidDestroy(() => {}); +sub = pane.onDidChangeActive(active => bool = active); +sub = pane.observeActive(active => bool = active); +sub = pane.onDidAddItem(event => event.index && event.item); +sub = pane.onDidRemoveItem(event => event.index && event.item); +sub = pane.onWillRemoveItem(event => event.index && event.item); +sub = pane.onDidMoveItem(event => event.item && event.oldIndex && event.newIndex); +sub = pane.observeItems((item) => {}); +sub = pane.onDidChangeActiveItem((item) => {}); +sub = pane.onChooseNextMRUItem((item) => {}); +sub = pane.onChooseLastMRUItem((item) => {}); +sub = pane.onDoneChoosingMRUItem(() => {}); +sub = pane.observeActiveItem((item) => {}); +sub = pane.onWillDestroyItem(event => event.index && event.item); + +// Items +objs = pane.getItems(); +obj = pane.getActiveItem(); + +let potentialItem = pane.itemAtIndex(42); +if (potentialItem) { + obj = potentialItem; +} + +pane.activateNextItem(); +pane.activatePreviousItem(); +pane.moveItemRight(); +pane.moveItemLeft(); +num = pane.getActiveItemIndex(); +pane.activateItemAtIndex(42); + +pane.activateItem(element); +pane.activateItem(element, { pending: true }); + +obj = pane.addItem(element); +obj = pane.addItem(element, {}); +obj = pane.addItem(element, { pending: true }); +obj = pane.addItem(element, { index: 42 }); +obj = pane.addItem(element, { pending: true, index: 42 }); + +objs = pane.addItems(objs); +objs = pane.addItems(objs, 42); + +pane.moveItem(element, 42); +pane.moveItemToPane(element, pane, 42); +pane.destroyActiveItem(); + +async function destroyAndWait() { + bool = await pane.destroyItem(element); + bool = await pane.destroyItem(element, true); +} + +pane.destroyItems(); +pane.destroyInactiveItems(); + +async function savePaneItem() { + await pane.saveActiveItem(); + let actionReturn = await pane.saveActiveItem(() => true); + if (actionReturn) bool = actionReturn; + + await pane.saveActiveItemAs(() => {}); + actionReturn = await pane.saveActiveItemAs(() => false); + + await pane.saveItem(element, () => {}); + let altActionReturn = await pane.saveItem(element, () => 42); + if (altActionReturn) num = altActionReturn; + + await pane.saveItemAs(element, () => {}); + altActionReturn = await pane.saveItemAs(element, () => 42); +} + +pane.saveItems(); + +potentialItem = pane.itemForURI("https://test"); +if (potentialItem) { + obj = potentialItem; +} + +bool = pane.activateItemForURI("https://test"); + +// Lifecycle +bool = pane.isActive(); +pane.activate(); +pane.destroy(); +bool = pane.isDestroyed(); + +// Splitting +pane = pane.splitLeft(); +pane = pane.splitLeft({}); +pane = pane.splitLeft({ copyActiveItem: true }); +pane = pane.splitLeft({ items: elements }); +pane = pane.splitLeft({ copyActiveItem: true, items: elements }); + +pane = pane.splitRight(); +pane = pane.splitRight({}); +pane = pane.splitRight({ copyActiveItem: true }); +pane = pane.splitRight({ items: elements }); +pane = pane.splitRight({ copyActiveItem: true, items: elements }); + +pane = pane.splitUp(); +pane = pane.splitUp({}); +pane = pane.splitUp({ copyActiveItem: true }); +pane = pane.splitUp({ items: elements }); +pane = pane.splitUp({ copyActiveItem: true, items: elements }); + +pane = pane.splitDown(); +pane = pane.splitDown({}); +pane = pane.splitDown({ copyActiveItem: true }); +pane = pane.splitDown({ items: elements }); +pane = pane.splitDown({ copyActiveItem: true, items: elements }); + +//// Panel ==================================================================== +// Methods +panel.destroy(); + +// Event Subscription +sub = panel.onDidChangeVisible(visible => bool = visible); +sub = panel.onDidDestroy(panel => bool = panel.isVisible()); + +// Panel Details +obj = panel.getItem(); +num = panel.getPriority(); +bool = panel.isVisible(); +panel.hide(); +panel.show(); + +//// PathWatcher ============================================================== +pathWatcher.dispose(); +sub = pathWatcher.onDidError((error) => str = error.name); + +async function waitForPathWatcher() { + await pathWatcher.getStartPromise(); +} + +//// Point -- See 'text-buffer' testing. +//// Project ================================================================== +// Event Subscription +sub = project.onDidChangePaths(paths => paths.length); + +sub = project.onDidChangeFiles(events => { + for (const event of events) { + str = event.action; + } +}); + +sub = project.onDidAddBuffer(buffer => buffer.id); +sub = project.observeBuffers(buffer => buffer.file); + +// Accessing the git repository +repositories = project.getRepositories(); + +async function getDirectoryRepo() { + const potentialRepo = await project.repositoryForDirectory(dir); + if (potentialRepo) repository = potentialRepo; +} + +// Managing Paths +strs = project.getPaths(); +project.setPaths(["a", "b"]); +project.addPath("Test"); + +async function initWatcher() { + await project.getWatcherPromise("/var/test"); +} + +project.removePath("Test"); +dirs = project.getDirectories(); + +const [projectPath, relativePath] = project.relativizePath("Test"); +if (projectPath) { + str = projectPath; +} +str = relativePath; + +bool = project.contains("Test"); + +//// Range -- See 'text-buffer' testing. +//// ScopeDescriptor ========================================================== +strs = scopeDescriptor.getScopesArray(); + +//// Selection ================================================================ +// Event Subscription +sub = selection.onDidChangeRange(event => event.newBufferRange && event.oldBufferRange && + event.newScreenRange && event.oldScreenRange && event.selection); +sub = selection.onDidDestroy(() => {}); + +// Managing the selection range +range = selection.getScreenRange(); + +selection.setScreenRange(range); +selection.setScreenRange([pos, pos]); +selection.setScreenRange([pos, [0, 0]]); +selection.setScreenRange([[0, 0], pos]); +selection.setScreenRange([[0, 0], [0, 0]]); +selection.setScreenRange([[0, 0], [0, 0]], {}); +selection.setScreenRange(range, { autoscroll: true, preserveFolds: false }); +selection.setScreenRange([pos, pos], { autoscroll: true }); + +range = selection.getBufferRange(); + +selection.setBufferRange(range); +selection.setBufferRange([pos, pos]); +selection.setBufferRange([pos, [0, 0]]); +selection.setBufferRange([[0, 0], pos]); +selection.setBufferRange([[0, 0], [0, 0]]); +selection.setBufferRange([[0, 0], [0, 0]], {}); +selection.setBufferRange(range, { autoscroll: true, preserveFolds: false }); +selection.setBufferRange([pos, pos], { autoscroll: true }); + +const [startingRow, endingRow ]: [number, number] = selection.getBufferRowRange(); + +// Info about the selection +bool = selection.isEmpty(); +bool = selection.isReversed(); +bool = selection.isSingleScreenLine(); +str = selection.getText(); +bool = selection.intersectsBufferRange(range); // Not range-compatible. +bool = selection.intersectsWith(selection); + +// Modifying the selected range +selection.clear(); +selection.clear({}); +selection.clear({ autoscroll: false }); + +selection.selectToScreenPosition(pos); +selection.selectToScreenPosition([0, 0]); + +selection.selectToBufferPosition(pos); +selection.selectToBufferPosition([0, 0]); + +selection.selectRight(); +selection.selectRight(42); + +selection.selectLeft(); +selection.selectLeft(42); + +selection.selectUp(); +selection.selectUp(42); + +selection.selectDown(); +selection.selectDown(42); + +selection.selectToTop(); +selection.selectToBottom(); +selection.selectAll(); +selection.selectToBeginningOfLine(); +selection.selectToFirstCharacterOfLine(); +selection.selectToEndOfLine(); +selection.selectToEndOfBufferLine(); +selection.selectToBeginningOfWord(); +selection.selectToEndOfWord(); +selection.selectToBeginningOfNextWord(); +selection.selectToPreviousWordBoundary(); +selection.selectToNextWordBoundary(); +selection.selectToPreviousSubwordBoundary(); +selection.selectToNextSubwordBoundary(); +selection.selectToBeginningOfNextParagraph(); +selection.selectToBeginningOfPreviousParagraph(); +selection.selectWord(); +selection.expandOverWord(); +selection.selectLine(42); +selection.expandOverLine(); + +// Modifying the selected text +selection.insertText("Replacement"); +selection.insertText("Replacement", {}); +selection.insertText("Replacement", { select: true }); +selection.insertText("Replacement", { autoIndent: true }); +selection.insertText("Replacement", { autoIndentNewline: true }); +selection.insertText("Replacement", { autoDecreaseIndent: true }); +selection.insertText("Replacement", { normalizeLineEndings: true }); +selection.insertText("Replacement", { undo: "skip" }); +selection.insertText("Replacement", { select: true, autoIndent: true, + autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true, + undo: "skip" }); + +selection.backspace(); +selection.deleteToPreviousWordBoundary(); +selection.deleteToNextWordBoundary(); +selection.deleteToBeginningOfWord(); +selection.deleteToBeginningOfLine(); +selection.delete(); +selection.deleteToEndOfLine(); +selection.deleteToEndOfWord(); +selection.deleteToBeginningOfSubword(); +selection.deleteToEndOfSubword(); +selection.deleteSelectedText(); +selection.deleteLine(); +selection.joinLines(); +selection.outdentSelectedRows(); +selection.autoIndentSelectedRows(); +selection.toggleLineComments(); +selection.cutToEndOfLine(); +selection.cutToEndOfBufferLine(); + +selection.cut(); +selection.cut(true); +selection.cut(true, true); + +selection.copy(); +selection.copy(true); +selection.copy(true, true); + +selection.fold(); +selection.indentSelectedRows(); + +// Managing multiple selections +selection.addSelectionBelow(); +selection.addSelectionAbove(); + +selection.merge(selection); +selection.merge(selection, {}); +selection.merge(selection, { preserveFolds: true }); +selection.merge(selection, { autoscroll: true }); +selection.merge(selection, { preserveFolds: true, autoscroll: true }); + +// Comparing to other selections +num = selection.compare(selection); + +//// StyleManager ============================================================= +// Event Subscription +sub = styleManager.observeStyleElements(styleElement => styleElement.context); +sub = styleManager.onDidAddStyleElement(styleElement => styleElement.sourcePath); +sub = styleManager.onDidRemoveStyleElement(styleElement => styleElement.onkeydown); +sub = styleManager.onDidUpdateStyleElement(styleElement => styleElement.sourcePath); + +// Reading Style Elements +const styleElements: HTMLStyleElement[] = styleManager.getStyleElements(); + +// Paths +str = styleManager.getUserStyleSheetPath(); + +//// Task ===================================================================== +let task: Atom.Task = Task.once("File.path", {}, () => {}); +task = new Task("File.path"); + +task.start({}, () => {}); +task.send("test-message"); +sub = task.on("test-message", () => {}); +task.terminate(); +task.cancel(); + +//// TextBuffer -- See 'text-buffer' testing. +//// TextEditor =============================================================== +// Event Subscription +sub = editor.onDidChangeTitle(title => str = title.charAt(0)); +sub = editor.onDidChangePath(path => str = path.charAt(0)); + +sub = editor.onDidChange(changes => { + for (const change of changes) { + change.newExtent; + change.oldExtent; + change.start; + } +}); + +sub = editor.onDidStopChanging(event => { + for (const change of event.changes) { + change.newExtent && change.oldExtent && change.newRange && change.oldRange && + change.newText && change.oldText && change.start; + } +}); + +sub = editor.onDidChangeCursorPosition(event => event.newBufferPosition); +sub = editor.onDidChangeSelectionRange(event => event.selection); +sub = editor.onDidSave(event => event.path); +sub = editor.onDidDestroy(() => {}); +sub = editor.observeGutters(gutter => gutter.show()); +sub = editor.onDidAddGutter(gutter => gutter.hide()); +sub = editor.onDidRemoveGutter(name => name.length); +sub = editor.onDidChangeSoftWrapped(softWrapped => {}); +sub = editor.onDidChangeEncoding(encoding => {}); +sub = editor.observeGrammar(grammar => grammar.name); +sub = editor.onDidChangeGrammar(grammar => grammar.scopeName); +sub = editor.onDidChangeModified(modified => {}); +sub = editor.onDidConflict(() => {}); +sub = editor.onWillInsertText(event => event.cancel && event.text); +sub = editor.onDidInsertText(event => event.text); +sub = editor.observeCursors(cursor => cursor.moveToBottom()); +sub = editor.onDidAddCursor(cursor => cursor.getMarker()); +sub = editor.onDidRemoveCursor(cursor => cursor.compare(cursor)); +sub = editor.observeSelections(selection => selection.cutToEndOfBufferLine()); +sub = editor.onDidAddSelection(selection => selection.selectWord()); +sub = editor.onDidRemoveSelection(selection => selection.toggleLineComments()); +sub = editor.observeDecorations(decoration => decoration.getId()); +sub = editor.onDidAddDecoration(decoration => decoration.id); +sub = editor.onDidRemoveDecoration(decoration => decoration.getId()); +sub = editor.onDidChangePlaceholderText(placeholderText => + placeholderText.toLowerCase()); +buffer = editor.getBuffer(); + +// File Details +str = editor.getTitle(); +str = editor.getLongTitle(); + +const filePath = editor.getPath(); +if (filePath) { + str = filePath; +} + +bool = editor.isModified(); +bool = editor.isEmpty(); +str = editor.getEncoding(); +editor.setEncoding("utf8"); + +// File Operations +async function saveEditor() { + await editor.save(); + await editor.saveAs("test.file"); +} + +// Reading Text +str = editor.getText(); +str = editor.getTextInBufferRange(range); +num = editor.getLineCount(); +num = editor.getScreenLineCount(); +num = editor.getLastBufferRow(); +num = editor.getLastScreenRow(); +str = editor.lineTextForBufferRow(42); +str = editor.lineTextForScreenRow(42); +range = editor.getCurrentParagraphBufferRange(); + +// Mutating Text +editor.setText("Test"); + +editor.setTextInBufferRange(range, "Test"); +editor.setTextInBufferRange([pos, pos], "Test"); +editor.setTextInBufferRange([pos, [0, 0]], "Test"); +editor.setTextInBufferRange([[0, 0], pos], "Test"); +editor.setTextInBufferRange([[0, 0], [0, 0]], "Test"); +editor.setTextInBufferRange(range, "Test", {}); +editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true }); +editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true, + undo: "skip" }); + +editor.insertText("Test"); +editor.insertText("Test", {}); +editor.insertText("Test", { autoDecreaseIndent: true }); +editor.insertText("Test", { autoIndent: true }); +editor.insertText("Test", { autoIndentNewline: true }); +editor.insertText("Test", { normalizeLineEndings: true }); +editor.insertText("Test", { select: true }); +editor.insertText("Test", { undo: "skip" }); +editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false, + autoIndentNewline: false, normalizeLineEndings: false, select: false, undo: "skip" }); + +editor.insertNewline(); +editor.delete(); +editor.backspace(); +editor.mutateSelectedText((selection, index) => { selection.clear(); }); +editor.transpose(); +editor.upperCase(); +editor.lowerCase(); +editor.toggleLineCommentsInSelection(); +editor.insertNewlineBelow(); +editor.insertNewlineAbove(); +editor.deleteToBeginningOfWord(); +editor.deleteToPreviousWordBoundary(); +editor.deleteToNextWordBoundary(); +editor.deleteToBeginningOfSubword(); +editor.deleteToEndOfSubword(); +editor.deleteToBeginningOfLine(); +editor.deleteToEndOfLine(); +editor.deleteToEndOfWord(); +editor.deleteLine(); + +// History +editor.undo(); +editor.redo(); + +editor.transact(() => {}); +editor.transact(42, () => {}); + +editor.abortTransaction(); +num = editor.createCheckpoint(); +bool = editor.revertToCheckpoint(42); +bool = editor.groupChangesSinceCheckpoint(42); + +// TextEditor Coordinates +pos = editor.screenPositionForBufferPosition(pos); +pos = editor.screenPositionForBufferPosition([0, 0]); +pos = editor.screenPositionForBufferPosition(pos, {}); +pos = editor.screenPositionForBufferPosition(pos, { clipDirection: "backward" }); +pos = editor.screenPositionForBufferPosition([0, 0], { clipDirection: "forward" }); + +pos = editor.bufferPositionForScreenPosition(pos); +pos = editor.bufferPositionForScreenPosition([0, 0]); +pos = editor.bufferPositionForScreenPosition(pos, {}); +pos = editor.bufferPositionForScreenPosition(pos, { clipDirection: "backward" }); +pos = editor.bufferPositionForScreenPosition([0, 0], { clipDirection: "forward" }); + +range = editor.screenRangeForBufferRange(range); +range = editor.screenRangeForBufferRange([pos, pos]); +range = editor.screenRangeForBufferRange([pos, [0, 0]]); +range = editor.screenRangeForBufferRange([[0, 0], pos]); +range = editor.screenRangeForBufferRange([[0, 0], [0, 0]]); + +range = editor.bufferRangeForScreenRange(range); +range = editor.bufferRangeForScreenRange([pos, pos]); +range = editor.bufferRangeForScreenRange([pos, [0, 0]]); +range = editor.bufferRangeForScreenRange([[0, 0], pos]); +range = editor.bufferRangeForScreenRange([[0, 0], [0, 0]]); + +pos = editor.clipBufferPosition(pos); +pos = editor.clipBufferPosition([0, 0]); + +range = editor.clipBufferRange(range); +range = editor.clipBufferRange([pos, pos]); +range = editor.clipBufferRange([pos, [0, 0]]); +range = editor.clipBufferRange([[0, 0], pos]); +range = editor.clipBufferRange([[0, 0], [0, 0]]); + +pos = editor.clipScreenPosition(pos); +pos = editor.clipScreenPosition([0, 0]); +pos = editor.clipScreenPosition(pos, {}); +pos = editor.clipScreenPosition(pos, { clipDirection: "closest" }); +pos = editor.clipScreenPosition([0, 0], { clipDirection: "closest" }); + +range = editor.clipScreenRange(range); +range = editor.clipScreenRange([pos, pos]); +range = editor.clipScreenRange([pos, [0, 0]]); +range = editor.clipScreenRange([[0, 0], pos]); +range = editor.clipScreenRange([[0, 0], [0, 0]]); +range = editor.clipScreenRange(range, {}); +range = editor.clipScreenRange(range, { clipDirection: "closest" }); +range = editor.clipScreenRange([pos, pos], { clipDirection: "closest" }); + +// Decorations +decoration = editor.decorateMarker(displayMarker, { type: "line" }); +decoration = editor.decorateMarker(displayMarker, { type: "line", avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + +layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number" }); +layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number", + avoidOverflow: false, class: "test-class", item: element, onlyEmpty: false, onlyHead: false, + onlyNonEmpty: false, position: "after" }); + +decorations = editor.getDecorations(); +decorations = editor.getDecorations({}); +decorations = editor.getDecorations({ type: "line-number" }); +decorations = editor.getDecorations({ type: "line", avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + +decorations = editor.getLineDecorations(); +decorations = editor.getLineDecorations({}); +decorations = editor.getLineDecorations({ avoidOverflow: true }); +decorations = editor.getLineDecorations({ avoidOverflow: true, class: "test-class", + item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + +decorations = editor.getLineNumberDecorations(); +decorations = editor.getLineNumberDecorations({}); +decorations = editor.getLineNumberDecorations({ onlyHead: true }); +decorations = editor.getLineNumberDecorations({ avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + +decorations = editor.getHighlightDecorations(); +decorations = editor.getHighlightDecorations({}); +decorations = editor.getHighlightDecorations({ onlyHead: true }); +decorations = editor.getHighlightDecorations({ avoidOverflow: true, + class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + +decorations = editor.getOverlayDecorations(); +decorations = editor.getOverlayDecorations({}); +decorations = editor.getOverlayDecorations({ onlyHead: true }); +decorations = editor.getOverlayDecorations({ avoidOverflow: true, + class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + +// Markers +displayMarker = editor.markBufferRange(range); +displayMarker = editor.markBufferRange([pos, pos]); +displayMarker = editor.markBufferRange([pos, [0, 0]]); +displayMarker = editor.markBufferRange([[0, 0], pos]); +displayMarker = editor.markBufferRange([[0, 0], [0, 0]]); +displayMarker = editor.markBufferRange(range, {}); +displayMarker = editor.markBufferRange(range, { invalidate: "surround" }); +displayMarker = editor.markBufferRange(range, { maintainHistory: true }); +displayMarker = editor.markBufferRange(range, { reversed: true }); +displayMarker = editor.markBufferRange([[0, 0], [0, 0]], { invalidate: "overlap" }); +displayMarker = editor.markBufferRange(range, { invalidate: "surround", + maintainHistory: false, reversed: false }); + +displayMarker = editor.markBufferPosition(pos); +displayMarker = editor.markBufferPosition([0, 0]); +displayMarker = editor.markBufferPosition(pos, {}); +displayMarker = editor.markBufferPosition(pos, { invalidate: "never" }); +displayMarker = editor.markBufferPosition([0, 0], { invalidate: "surround" }); + +displayMarker = editor.markScreenPosition(pos); +displayMarker = editor.markScreenPosition([0, 0]); +displayMarker = editor.markScreenPosition(pos, {}); +displayMarker = editor.markScreenPosition(pos, { invalidate: "never" }); +displayMarker = editor.markScreenPosition(pos, { clipDirection: "forward" }); +displayMarker = editor.markScreenPosition([0, 0], { invalidate: "surround", + clipDirection: "backward" }); + +displayMarkers = editor.findMarkers({ startBufferRow: 42 }); +displayMarkers = editor.findMarkers({ endBufferRow: 42 }); +displayMarkers = editor.findMarkers({ containsBufferRange: range }); +displayMarkers = editor.findMarkers({ containsBufferRange: [pos, pos] }); +displayMarkers = editor.findMarkers({ containsBufferRange: [pos, [0, 0]] }); +displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], pos] }); +displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], [0, 0]] }); +displayMarkers = editor.findMarkers({ containsBufferPosition: pos }); +displayMarkers = editor.findMarkers({ containsBufferPosition: [42, 42] }); +displayMarkers = editor.findMarkers({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: 42, + endBufferRow: 42, + startScreenRow: 42, + endScreenRow: 42, + intersectsBufferRowRange: [42, 42], + intersectsScreenRowRange: [42, 42], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, +}); + +displayMarkerLayer = editor.addMarkerLayer(); +displayMarkerLayer = editor.addMarkerLayer({}); +displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true }); +displayMarkerLayer = editor.addMarkerLayer({ persistent: true }); +displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true, persistent: true }); + +const potentialMarkerLayer = editor.getMarkerLayer(42); +if (potentialMarkerLayer) { + displayMarkerLayer = potentialMarkerLayer; +} + +displayMarkerLayer = editor.getDefaultMarkerLayer(); +displayMarker = editor.getMarker(42); +displayMarkers = editor.getMarkers(); +num = editor.getMarkerCount(); + +// Cursors +pos = editor.getCursorBufferPosition(); +posArr = editor.getCursorBufferPositions(); + +editor.setCursorBufferPosition(pos); +editor.setCursorBufferPosition(pos, {}); +editor.setCursorBufferPosition(pos, { autoscroll: true }); +editor.setCursorBufferPosition([0, 0], { autoscroll: true }); + +let potentialCursor = editor.getCursorAtScreenPosition(pos); +if (potentialCursor) { + cursor = potentialCursor; +} + +potentialCursor = editor.getCursorAtScreenPosition([0, 0]); +if (potentialCursor) { + cursor = potentialCursor; +} + +pos = editor.getCursorScreenPosition(); +posArr = editor.getCursorScreenPositions(); + +editor.setCursorScreenPosition(pos); +editor.setCursorScreenPosition([0, 0]); +editor.setCursorScreenPosition(pos, {}); +editor.setCursorBufferPosition(pos, { autoscroll: true }); + +cursor = editor.addCursorAtBufferPosition(pos); +cursor = editor.addCursorAtBufferPosition([0, 0]); + +cursor = editor.addCursorAtScreenPosition(pos); +cursor = editor.addCursorAtScreenPosition([0, 0]); + +bool = editor.hasMultipleCursors(); + +editor.moveUp(); +editor.moveUp(42); + +editor.moveDown(); +editor.moveDown(42); + +editor.moveLeft(); +editor.moveLeft(42); + +editor.moveRight(); +editor.moveRight(42); + +editor.moveToBeginningOfLine(); +editor.moveToBeginningOfScreenLine(); +editor.moveToFirstCharacterOfLine(); +editor.moveToEndOfLine(); +editor.moveToEndOfScreenLine(); +editor.moveToBeginningOfWord(); +editor.moveToEndOfWord(); +editor.moveToTop(); +editor.moveToBottom(); +editor.moveToBeginningOfNextWord(); +editor.moveToPreviousWordBoundary(); +editor.moveToNextWordBoundary(); +editor.moveToPreviousSubwordBoundary(); +editor.moveToNextSubwordBoundary(); +editor.moveToBeginningOfNextParagraph(); +editor.moveToBeginningOfPreviousParagraph(); +cursor = editor.getLastCursor(); + +str = editor.getWordUnderCursor(); +str = editor.getWordUnderCursor({}); +str = editor.getWordUnderCursor({ allowPrevious: true }); +str = editor.getWordUnderCursor({ includeNonWordCharacters: true }); +str = editor.getWordUnderCursor({ wordRegex: /r/ }); +str = editor.getWordUnderCursor({ allowPrevious: true, includeNonWordCharacters: true, + wordRegex: /r/ }); + +cursors = editor.getCursors(); +cursors = editor.getCursorsOrderedByBufferPosition(); + +// Selections +str = editor.getSelectedText(); +range = editor.getSelectedBufferRange(); +ranges = editor.getSelectedBufferRanges(); + +editor.setSelectedBufferRange(range); +editor.setSelectedBufferRange(range, {}); +editor.setSelectedBufferRange(range, { preserveFolds: true }); +editor.setSelectedBufferRange(range, { reversed: true }); +editor.setSelectedBufferRange(range, { preserveFolds: true, reversed: true }); +editor.setSelectedBufferRange([pos, pos]); +editor.setSelectedBufferRange([pos, [0, 0]]); +editor.setSelectedBufferRange([[0, 0], pos]); +editor.setSelectedBufferRange([[0, 0], [0, 0]]); + +editor.setSelectedBufferRanges(ranges); +editor.setSelectedBufferRanges([[pos, pos]]); +editor.setSelectedBufferRanges([[pos, [0, 0]]]); +editor.setSelectedBufferRanges([[[0, 0], pos]]); +editor.setSelectedBufferRanges([[[0, 0], [0, 0]]]); +editor.setSelectedBufferRanges(ranges, {}); +editor.setSelectedBufferRanges([[pos, pos]], {}); +editor.setSelectedBufferRanges(ranges, { reversed: true }); +editor.setSelectedBufferRanges([[pos, pos]], { preserveFolds: true }); +editor.setSelectedBufferRanges([[pos, pos]], { reversed: true, preserveFolds: true }); + +range = editor.getSelectedScreenRange(); +ranges = editor.getSelectedScreenRanges(); + +editor.setSelectedScreenRange(range); +editor.setSelectedScreenRange([pos, pos]); +editor.setSelectedScreenRange([pos, [0, 0]]); +editor.setSelectedScreenRange([[0, 0], pos]); +editor.setSelectedScreenRange([[0, 0], [0, 0]]); +editor.setSelectedScreenRange(range, {}); +editor.setSelectedScreenRange([pos, pos], {}); +editor.setSelectedScreenRange(range, { reversed: true }); +editor.setSelectedScreenRange([pos, pos], { reversed: true }); + +editor.setSelectedScreenRanges(ranges); +editor.setSelectedScreenRanges([[pos, pos]]); +editor.setSelectedScreenRanges([[pos, [0, 0]]]); +editor.setSelectedScreenRanges([[[0, 0], pos]]); +editor.setSelectedScreenRanges([[[0, 0], [0, 0]]]); +editor.setSelectedScreenRanges(ranges, {}); +editor.setSelectedScreenRanges([[pos, pos]], {}); +editor.setSelectedScreenRanges(ranges, { reversed: true }); +editor.setSelectedScreenRanges([[pos, pos]], { reversed: true }); + +selection = editor.addSelectionForBufferRange(range); +selection = editor.addSelectionForBufferRange([pos, pos]); +selection = editor.addSelectionForBufferRange([pos, [0, 0]]); +selection = editor.addSelectionForBufferRange([[0, 0], pos]); +selection = editor.addSelectionForBufferRange([[0, 0], [0, 0]]); +selection = editor.addSelectionForBufferRange(range, {}); +selection = editor.addSelectionForBufferRange(range, { preserveFolds: true }); +selection = editor.addSelectionForBufferRange(range, { reversed: true }); +selection = editor.addSelectionForBufferRange(range, { preserveFolds: false, + reversed: false }); +selection = editor.addSelectionForBufferRange([pos, pos], { preserveFolds: false }); + +selection = editor.addSelectionForScreenRange(range); +selection = editor.addSelectionForScreenRange([pos, pos]); +selection = editor.addSelectionForScreenRange([pos, [0, 0]]); +selection = editor.addSelectionForScreenRange([[0, 0], pos]); +selection = editor.addSelectionForScreenRange([[0, 0], [0, 0]]); +selection = editor.addSelectionForScreenRange(range, {}); +selection = editor.addSelectionForScreenRange(range, { preserveFolds: true }); +selection = editor.addSelectionForScreenRange(range, { reversed: true }); +selection = editor.addSelectionForScreenRange(range, { preserveFolds: false, + reversed: false }); +selection = editor.addSelectionForScreenRange([pos, pos], { preserveFolds: false }); + +editor.selectToBufferPosition(pos); +editor.selectToScreenPosition(pos); + +editor.selectUp(); +editor.selectUp(42); + +editor.selectDown(); +editor.selectDown(42); + +editor.selectLeft(); +editor.selectLeft(42); + +editor.selectRight(); +editor.selectRight(42); + +editor.selectToTop(); +editor.selectToBottom(); +editor.selectAll(); +editor.selectToBeginningOfLine(); +editor.selectToFirstCharacterOfLine(); +editor.selectToEndOfLine(); +editor.selectToBeginningOfWord(); +editor.selectToEndOfWord(); +editor.selectLinesContainingCursors(); +editor.selectWordsContainingCursors(); +editor.selectToPreviousSubwordBoundary(); +editor.selectToNextSubwordBoundary(); +editor.selectToPreviousWordBoundary(); +editor.selectToNextWordBoundary(); +editor.selectToBeginningOfNextWord(); +editor.selectToBeginningOfNextParagraph(); +editor.selectToBeginningOfPreviousParagraph(); + +const potentialRange = editor.selectMarker(displayMarker); +if (potentialRange) { + range = potentialRange; +} + +selection = editor.getLastSelection(); +selections = editor.getSelections(); +selections = editor.getSelectionsOrderedByBufferPosition(); +bool = editor.selectionIntersectsBufferRange(range); // not range-compatible + +// Searching and Replacing +editor.scan(/r/, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); +}); + +editor.scan(/r/, {}, () => {}); +editor.scan(/r/, { leadingContextLineCount: 42 }, () => {}); +editor.scan(/r/, { trailingContextLineCount: 42 }, () => {}); +editor.scan(/r/, { leadingContextLineCount: 42, trailingContextLineCount: 42 }, + () => {}); + +editor.scanInBufferRange(/r/, range, () => {}); +editor.scanInBufferRange(/r/, [pos, pos], () => {}); +editor.scanInBufferRange(/r/, [pos, [0, 0]], () => {}); +editor.scanInBufferRange(/r/, [[0, 0], pos], () => {}); +editor.scanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); +editor.scanInBufferRange(/r/, range, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); +}); + +editor.backwardsScanInBufferRange(/r/, range, () => {}); +editor.backwardsScanInBufferRange(/r/, [pos, pos], () => {}); +editor.backwardsScanInBufferRange(/r/, [pos, [0, 0]], () => {}); +editor.backwardsScanInBufferRange(/r/, [[0, 0], pos], () => {}); +editor.backwardsScanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); +editor.backwardsScanInBufferRange(/r/, range, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); +}); + +// Tab Behavior +bool = editor.getSoftTabs(); +editor.setSoftTabs(true); +bool = editor.toggleSoftTabs(); +num = editor.getTabLength(); +editor.setTabLength(42); + +const potentialBool = editor.usesSoftTabs(); +if (potentialBool) { + bool = potentialBool; +} + +str = editor.getTabText(); + +// Soft Wrap Behavior +bool = editor.isSoftWrapped(); +editor.setSoftWrapped(true); +bool = editor.toggleSoftWrapped(); +num = editor.getSoftWrapColumn(); + +// Indentation +num = editor.indentationForBufferRow(42); + +editor.setIndentationForBufferRow(42, 42); +editor.setIndentationForBufferRow(42, 42, {}); +editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true }); + +editor.indentSelectedRows(); +editor.outdentSelectedRows(); +num = editor.indentLevelForLine("Test"); +editor.autoIndentSelectedRows(); + +// Grammars +grammar = editor.getGrammar(); +editor.setGrammar(grammar); + +// Managing Syntax Scopes +scopeDescriptor = editor.getRootScopeDescriptor(); + +scopeDescriptor = editor.scopeDescriptorForBufferPosition(pos); +scopeDescriptor = editor.scopeDescriptorForBufferPosition([0, 0]); + +range = editor.bufferRangeForScopeAtCursor("selector"); +bool = editor.isBufferRowCommented(42); + +// Clipboard Operations +editor.copySelectedText(); +editor.cutSelectedText(); + +editor.pasteText(); +editor.pasteText({}); +editor.pasteText({ autoIndentNewline: true }); +editor.pasteText({ autoIndent: true }); +editor.pasteText({ autoDecreaseIndent: true }); +editor.pasteText({ normalizeLineEndings: true }); +editor.pasteText({ select: true }); +editor.pasteText({ undo: "skip" }); +editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true, + normalizeLineEndings: true, select: true, undo: "skip" }); + +editor.cutToEndOfLine(); +editor.cutToEndOfBufferLine(); + +// Folds +editor.foldCurrentRow(); +editor.unfoldCurrentRow(); +editor.foldBufferRow(42); +editor.unfoldBufferRow(42); +editor.foldSelectedLines(); +editor.foldAll(); +editor.unfoldAll(); +editor.foldAllAtIndentLevel(42); +editor.isFoldableAtBufferRow(42); +editor.isFoldableAtScreenRow(42); +editor.toggleFoldAtBufferRow(42); +editor.isFoldedAtCursorRow(); +editor.isFoldedAtBufferRow(42); +editor.isFoldedAtScreenRow(42); + +// Gutters +editor.addGutter({ name: "Test" }); +editor.addGutter({ name: "Test", priority: 42 }); +editor.addGutter({ name: "Test", visible: true }); +editor.addGutter({ name: "Test", priority: 42, visible: true }); + +gutters = editor.getGutters(); + +const potentialGutter = editor.gutterWithName("test-gutter"); +if (potentialGutter) { + gutter = potentialGutter; +} + +editor.scrollToCursorPosition(); +editor.scrollToCursorPosition({}); +editor.scrollToCursorPosition({ center: true }); + +editor.scrollToBufferPosition(pos); +editor.scrollToBufferPosition([0, 0]); +editor.scrollToBufferPosition(pos, {}); +editor.scrollToBufferPosition([0, 0], {}); +editor.scrollToBufferPosition(pos, { center: true }); +editor.scrollToBufferPosition([0, 0], { center: true }); + +editor.scrollToScreenPosition(pos); +editor.scrollToScreenPosition([0, 0]); +editor.scrollToScreenPosition(pos, {}); +editor.scrollToScreenPosition([0, 0], {}); +editor.scrollToScreenPosition(pos, { center: true }); +editor.scrollToScreenPosition([0, 0], { center: true }); + +// TextEditor Rendering +str = editor.getPlaceholderText(); +editor.setPlaceholderText("Test"); + +//// ThemeManager ============================================================= +// Event Subscription +sub = atom.themes.onDidChangeActiveThemes(() => {}); + +// Accessing Loaded Themes +let potentialStrs = atom.themes.getLoadedThemeNames(); +if (potentialStrs) { + strs = potentialStrs; +} + +let potentialPacks = atom.themes.getLoadedThemes(); +if (potentialPacks) { + packs = potentialPacks; +} + +// Accessing Active Themes +potentialStrs = atom.themes.getActiveThemeNames(); +if (potentialStrs) { + strs = potentialStrs; +} + +potentialPacks = atom.themes.getActiveThemes(); +if (potentialPacks) { + packs = potentialPacks; +} + +// Managing Enabled Themes +strs = atom.themes.getEnabledThemeNames(); + +//// TooltipManager =========================================================== +sub = atom.tooltips.add(element, { title: "Test"}); +sub = atom.tooltips.add(element, { title: "

Test

", html: true }); +sub = atom.tooltips.add(element, { item: element}); +sub = atom.tooltips.add(element, { class: "test-class" }); +sub = atom.tooltips.add(element, { placement: "top" }); + +sub = atom.tooltips.add(element, { placement: () => "left" }); + +sub = atom.tooltips.add(element, { trigger: "click" }); +sub = atom.tooltips.add(element, { delay: { hide: 42, show: 42 }}); +sub = atom.tooltips.add(element, { keyBindingCommand: "test-command", + keyBindingTarget: element }); + +tooltips = atom.tooltips.findTooltips(element); + +//// ViewRegistry ============================================================= +atom.views.addViewProvider(Point, (point) => { + point.column; + return element; +}); + +element = atom.views.getView(element); + +//// Workspace ================================================================ +// Event Subscription +sub = atom.workspace.observeTextEditors(editor => editor.id); +sub = atom.workspace.observePaneItems((item) => {}); +sub = atom.workspace.onDidChangeActivePaneItem((item) => {}); +sub = atom.workspace.onDidStopChangingActivePaneItem((item) => {}); + +sub = atom.workspace.onDidChangeActiveTextEditor(editor => { + if (editor) { + editor.id; + } +}); + +sub = atom.workspace.observeActivePaneItem((item) => {}); + +sub = atom.workspace.observeActiveTextEditor(editor => { + if (editor) { + editor.id; + } +}); + +sub = atom.workspace.onDidOpen(event => event.index && event.item && event.pane && + event.uri); +sub = atom.workspace.onDidAddPane(event => event.pane); +sub = atom.workspace.onWillDestroyPane(event => event.pane); +sub = atom.workspace.onDidDestroyPane(event => event.pane); +sub = atom.workspace.observePanes(pane => pane.activate()); +sub = atom.workspace.onDidChangeActivePane(pane => pane.activate()); +sub = atom.workspace.observeActivePane(pane => pane.activate()); +sub = atom.workspace.onDidAddPaneItem(event => event.index && event.item && event.pane); +sub = atom.workspace.onWillDestroyPaneItem(event => event.index && event.item && event.pane); +sub = atom.workspace.onDidDestroyPaneItem(event => event.index && event.item && event.pane); +sub = atom.workspace.onDidAddTextEditor(event => event.index && event.pane && + event.textEditor); + +// Opening +async function workspaceOpen() { + obj = await atom.workspace.open(); + obj = await atom.workspace.open("https://test"); + obj = await atom.workspace.open("https://test", { activateItem: true }); + obj = await atom.workspace.open("https://test", { activatePane: true }); + obj = await atom.workspace.open("https://test", { initialColumn: 42 }); + obj = await atom.workspace.open("https://test", { initialLine: 42 }); + obj = await atom.workspace.open("https://test", { location: "right" }); + obj = await atom.workspace.open("https://test", { split: "up" }); + obj = await atom.workspace.open("https://test", { pending: true }); + obj = await atom.workspace.open("https://test", { searchAllPanes: true }); + obj = await atom.workspace.open("https://test", { + activateItem: true, + activatePane: true, + initialColumn: 42, + initialLine: 42, + location: "left", + split: "left", + pending: true, + searchAllPanes: true, + }); +} + +bool = atom.workspace.hide("https://test"); +bool = atom.workspace.hide(element); + +async function workspaceToggle() { + await atom.workspace.toggle("https://test"); + await atom.workspace.toggle(element); +} + +obj = atom.workspace.createItemForURI("https://test"); + +bool = atom.workspace.isTextEditor(obj); + +async function workspaceReopen() { + const result = await atom.workspace.reopenItem(); + if (result) obj = result; +} + +atom.workspace.addOpener(() => element); + +atom.workspace.buildTextEditor(obj); + +// Pane Items +objs = atom.workspace.getPaneItems(); +obj = atom.workspace.getActivePaneItem(); +editors = atom.workspace.getTextEditors(); + +let potentialEditor = atom.workspace.getActiveTextEditor(); +if (potentialEditor) { + editor = potentialEditor; +} + +// Panes +paneContainer = atom.workspace.getActivePaneContainer(); +panes = atom.workspace.getPanes(); +pane = atom.workspace.getActivePane(); +bool = atom.workspace.activateNextPane(); +bool = atom.workspace.activatePreviousPane(); + +let potentialPaneContainer = atom.workspace.paneContainerForURI("https://test"); +if (potentialPaneContainer) { + paneContainer = potentialPaneContainer; +} + +potentialPaneContainer = atom.workspace.paneContainerForItem(element); +if (potentialPaneContainer) { + paneContainer = potentialPaneContainer; +} + +let potentialPane = atom.workspace.paneForURI("https://test"); +if (potentialPane) { + pane = potentialPane; +} + +potentialPane = atom.workspace.paneForItem(element); +if (potentialPane) { + pane = potentialPane; +} + +// Pane Locations +workspaceCenter = atom.workspace.getCenter(); +dock = atom.workspace.getLeftDock(); +dock = atom.workspace.getRightDock(); +dock = atom.workspace.getBottomDock(); + +// Panels +panels = atom.workspace.getBottomPanels(); + +panel = atom.workspace.addBottomPanel({ item: element }); +panel = atom.workspace.addBottomPanel({ item: element, priority: 100, visible: true }); + +panels = atom.workspace.getLeftPanels(); + +panel = atom.workspace.addLeftPanel({ item: element }); +panel = atom.workspace.addLeftPanel({ item: element, priority: 100, visible: true }); + +panels = atom.workspace.getRightPanels(); + +panel = atom.workspace.addRightPanel({ item: element }); +panel = atom.workspace.addRightPanel({ item: element, priority: 100, visible: true }); + +panels = atom.workspace.getTopPanels(); + +panel = atom.workspace.addTopPanel({ item: element }); +panel = atom.workspace.addTopPanel({ item: element, priority: 100, visible: true }); + +panels = atom.workspace.getHeaderPanels(); + +panel = atom.workspace.addHeaderPanel({ item: element }); +panel = atom.workspace.addHeaderPanel({ item: element, priority: 100, visible: true }); + +panels = atom.workspace.getFooterPanels(); + +panel = atom.workspace.addFooterPanel({ item: element }); +panel = atom.workspace.addFooterPanel({ item: element, priority: 100, visible: true }); + +panels = atom.workspace.getModalPanels(); + +panel = atom.workspace.addModalPanel({ item: element }); +panel = atom.workspace.addModalPanel({ item: element, priority: 100, visible: true }); + +const potentialPanel = atom.workspace.panelForItem(element); +if (potentialPanel) { + panel = potentialPanel; +} + +const scanResults = atom.workspace.scan(/r/, () => {}); +scanResults.cancel(); + +// Searching and Replacing +async function workspaceScan() { + await scanResults; + + const scanOptions = { + onPathsSearched: (pathsSearched: number) => {}, + leadingContextLineCount: 5, + trailingContextLineCount: 5, + paths: ["a"], + }; + await atom.workspace.scan(/r/, scanOptions, (results) => { + str = results.filePath; + for (const match of results.matches) { + range = Range.fromObject(match.range); + strs = match.leadingContextLines; + strs = match.trailingContextLines; + } + }); +} + +async function workspaceReplace() { + await atom.workspace.replace(/r/, "Test", ["a"], (options) => {}); +} + +//// WorkspaceCenter ========================================================== +// Event Subscription +sub = workspaceCenter.observeTextEditors(editor => editor.id); +sub = workspaceCenter.observePaneItems(item => {}); +sub = workspaceCenter.onDidChangeActivePaneItem(item => {}); +sub = workspaceCenter.onDidStopChangingActivePaneItem(item => {}); +sub = workspaceCenter.observeActivePaneItem(item => {}); + +// Pane Items +objs = workspaceCenter.getPaneItems(); +workspaceCenter.getActivePaneItem(); +editors = workspaceCenter.getTextEditors(); + +potentialEditor = workspaceCenter.getActiveTextEditor(); +if (potentialEditor) { + editor = potentialEditor; +} + +// Panes +panes = workspaceCenter.getPanes(); +pane = workspaceCenter.getActivePane(); +workspaceCenter.activateNextPane(); +workspaceCenter.activatePreviousPane(); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 1cd7090403..4a7f23cf60 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,1977 +1,4262 @@ -// Type definitions for Atom -// Project: https://atom.io/ -// Definitions by: vvakame , smhxx +// Type definitions for Atom 1.21 +// Project: https://github.com/atom/atom +// Definitions by: GlenCFL // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +/// /// -/// -/// -/// +/// +/// +/// /// -/// -// Policy: this definition file only declare element related to `atom`. -// if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). -// you should create a separate file. +declare global { + /** The core classes for the Atom Text Editor. */ + namespace AtomCore { + /** Objects that appear as parameters to callbacks. */ + namespace Events { + interface ExceptionThrown { + originalError: Error; + message: string; + url: string; + line: number; + column: number; + } -// API documentation : https://atom.io/docs/api/v1.20.1 + interface PreventableExceptionThrown extends ExceptionThrown { + preventDefault(): void; + } -interface Window { - atom: AtomCore.IAtom; - measure(description:string, fn:Function):any; // return fn result - profile(description:string, fn:Function):any; // return fn result -} + interface SelectionChanged { + oldBufferRange: TextBuffer.Range; + oldScreenRange: TextBuffer.Range; + newBufferRange: TextBuffer.Range; + newScreenRange: TextBuffer.Range; + selection: Selection; + } -declare namespace AtomCore { + interface PaneItemObserved { + item: object; + pane: Pane; + index: number; + } - // https://atom.io/docs/v0.84.0/advanced/view-system - interface IWorkspaceViewStatic { - new ():IWorkspaceView; - version: number; - configDefaults:any; - content():any; - } + interface PaneItemOpened extends PaneItemObserved { + uri: string; + } - interface Decoration { - destroy(): void; - } + interface EditorChanged { + /** A Point representing where the change started. */ + start: TextBuffer.Point; - /** - * Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used - * to represent cursors, folds, snippet targets, misspelled words, any anything else that needs to track a - * logical location in the buffer over time. - */ - interface Marker { - /** - * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, a marker cannot be - * restored by undo/redo operations. + /** A Point representing the replaced extent. */ + oldExtent: TextBuffer.Point; + + /** A Point representing the replacement extent. */ + newExtent: TextBuffer.Point; + } + + interface StyleElementObserved extends HTMLStyleElement { + sourcePath: string; + context: string; + } + + interface TextEditorObserved { + textEditor: TextEditor; + pane: Pane; + index: number; + } + + interface RepoStatusChanged { + path: string; + + /** This value can be passed to ::isStatusModified or ::isStatusNew to get more + * information. + */ + pathStatus: number; + } + + interface PaneListItemShifted { + /** The pane item that was added or removed. */ + item: object; + + /** A number indicating where the item is located. */ + index: number; + } + + interface PaneItemMoved { + /** The removed pane item. */ + item: object; + + /** A number indicating where the item was located. */ + oldIndex: number; + + /** A number indicating where the item is now located. */ + newIndex: number; + } + + interface CursorPositionChanged { + oldBufferPosition: TextBuffer.Point; + oldScreenPosition: TextBuffer.Point; + newBufferPosition: TextBuffer.Point; + newScreenPosition: TextBuffer.Point; + textChanged: boolean; + Cursor: Cursor; + } + + interface DecorationPropsChanged { + /** Object the old parameters the decoration used to have. */ + oldProperties: Structures.DecorationProps; + + /** Object the new parameters the decoration now has */ + newProperties: Structures.DecorationProps; + } + + type FilesystemChange = Array<{ + /** A string describing the filesystem action that occurred. */ + action: "created"|"modified"|"deleted"|"renamed"; + + /** The absolute path to the filesystem entry that was acted upon. */ + path: string; + + /** For rename events, a string containing the filesystem entry's former + * absolute path. + */ + oldPath?: string; + }>; + } + + /** Objects that appear as parameters to functions. */ + namespace Options { + interface TextInsertion { + select?: boolean; + autoIndent?: boolean; + autoIndentNewline?: boolean; + autoDecreaseIndent?: boolean; + normalizeLineEndings?: boolean; + undo?: "skip"; + } + + interface Menu { + /** The menu itme's label. */ + label: string; + + /** An array of sub menus. */ + submenu?: ReadonlyArray; + + /** The command to trigger when the item is clicked. */ + command?: string; + } + + interface ContextMenu { + /** The menu item's label. */ + label?: string; + + /** The command to invoke on the target of the right click that invoked the + * context menu. + */ + command?: string; + + /** Whether the menu item should be clickable. Disabled menu items typically + * appear grayed out. Defaults to true. + */ + enabled?: boolean; + + /** An array of additional items. */ + submenu?: ReadonlyArray; + + /** If you want to create a separator, provide an item with type: 'separator' + * and no other keys. + */ + type?: "separator"; + + /** Whether the menu item should appear in the menu. Defaults to true. */ + visible?: boolean; + + /** A function that is called on the item each time a context menu is created + * via a right click. + */ + created?(event: Event): void; + + /** A function that is called to determine whether to display this item on a + * given context menu deployment. + */ + shouldDisplay?(event: Event): void; + } + + interface SpawnProcess { + /** Current working directory of the child process. */ + cwd?: string; + + /** Environment key-value pairs. */ + env?: { [key: string]: string }; + + /** The child's stdio configuration. */ + stdio?: string|Array; + + /** Prepare child to run independently of its parent process. */ + detached?: boolean; + + /** Sets the user identity of the process. */ + uid?: number; + + /** Sets the group identity of the process. */ + gid?: number; + + /** If true, runs command inside of a shell. Uses "/bin/sh" on UNIX, and process.env.ComSpec + * on Windows. A different shell can be specified as a string. + */ + shell?: boolean | string; + } + + interface NodeProcess { + /** The command to execute. */ + command: string; + + /** The array of arguments to pass to the command. */ + args?: ReadonlyArray; + + /** The options object to pass to Node's ChildProcess.spawn method. */ + options?: SpawnProcess; + + /** The callback that receives a single argument which contains the standard + * output from the command. + */ + stdout?(data: string): void; + + /** The callback that receives a single argument which contains the standard + * error output from the command. + */ + stderr?(data: string): void; + + /** The callback which receives a single argument containing the exit status. */ + exit?(code: number): void; + } + + interface Process extends NodeProcess { + /** Whether the command will automatically start when this BufferedProcess is + * created. + */ + autoStart?: boolean; + } + + interface Notification { + buttons?: Array<{ + className?: string; + onDidClick?(event: MouseEvent): void; + text?: string; + }>; + description?: string; + detail?: string; + dismissable?: boolean; + icon?: string; + } + + interface ErrorNotification extends Notification { + stack?: string; + } + + /** The options for a Bootstrap 3 Tooltip class, which Atom uses a variant of. */ + interface Tooltip { + /** Apply a CSS fade transition to the tooltip. */ + animation?: boolean; + + /** Appends the tooltip to a specific element. */ + container?: string|HTMLElement|false; + + /** Delay showing and hiding the tooltip (ms) - does not apply to manual + * trigger type. + */ + delay?: number|{ show: number, hide: number }; + + /** Allow HTML in the tooltip. */ + html?: boolean; + + /** How to position the tooltip. */ + placement?: "top"|"bottom"|"left"|"right"|"auto"; + + /** If a selector is provided, tooltip objects will be delegated to the + * specified targets. + */ + selector?: string; + + /** Base HTML to use when creating the tooltip. */ + template?: string; + + /** Default title value if title attribute isn't present. + * If a function is given, it will be called with its this reference set to + * the element that the tooltip is attached to. + */ + title?: string|HTMLElement|(() => string); + + /** How tooltip is triggered - click | hover | focus | manual. + * You may pass multiple triggers; separate them with a space. + */ + trigger?: string; + } + + interface WorkspaceScan { + /** An array of glob patterns to search within. */ + paths?: ReadonlyArray; + + /** A function to be periodically called with the number of paths searched. */ + onPathsSearched?(pathsSearched: number): void; + + /** The number of lines before the matched line to include in the results object. */ + leadingContextLineCount?: number; + + /** The number of lines after the matched line to include in the results object. */ + trailingContextLineCount?: number; + } + + interface BuildEnvironment { + /** An object responsible for Atom's interaction with the browser process and host OS. + * Use buildDefaultApplicationDelegate for a default instance. + */ + applicationDelegate?: object; + + /** A window global. */ + window?: Window; + + /** A document global. */ + document?: Document; + + /** A path to the configuration directory (usually ~/.atom). */ + configDirPath?: string; + + /** A boolean indicating whether the Atom environment should save or load state + * from the file system. You probably want this to be false. + */ + enablePersistence?: boolean; + } + } + + /** The static side to each exported class. Should generally only be used internally. */ + namespace Statics { + /* tslint:disable:no-unnecessary-qualifier */ + /** The static side to the BufferedProcess class. */ + interface BufferedProcess { + new (options: AtomCore.Options.Process): AtomCore.BufferedProcess; + } + + /** The static side to the BufferedNodeProcess class. */ + interface BufferedNodeProcess { + /** Runs the given Node script by spawning a new child process. */ + new (options: AtomCore.Options.NodeProcess): AtomCore.BufferedNodeProcess; + } + + /** The static side to the GitRepository class. */ + interface GitRepository { + /** Creates a new GitRepository instance. */ + open(path: string, options?: { refreshOnWindowFocus?: boolean }): AtomCore.GitRepository; + + new (path: string, options?: { refreshOnWindowFocus?: boolean, config?: AtomCore.Config, + project?: AtomCore.Project }): AtomCore.GitRepository; + } + + /** The static side to the Notification class. */ + interface Notification { + new (type: "warning"|"info"|"success", message: string, options?: + AtomCore.Options.Notification): AtomCore.Notification; + new (type: "fatal"|"error", message: string, options?: + AtomCore.Options.ErrorNotification): AtomCore.Notification; + } + + /** The static side to the Task class. */ + interface Task { + // NOTE: this is actually the best we can do here with the REST parameter for + // this appearing in the middle of the parameter list, which isn't aligned with + // the ES6 spec. Maybe when they rewrite it in JavaScript this will change. + /** A helper method to easily launch and run a task once. */ + // tslint:disable-next-line:no-any + once(taskPath: string, ...args: any[]): AtomCore.Task; + + /** Creates a task. You should probably use .once */ + new (taskPath: string): AtomCore.Task; + } + + /** The static side to the TextEditor class. */ + type TextEditor = object; + /* tslint:enable:no-unnecessary-qualifier */ + } + + /** Data structures that are used within classes. */ + namespace Structures { + interface SharedDecorationProps { + /** This CSS class will be applied to the decorated line number, line, highlight, + * or overlay. + */ + class?: string; + + /** An HTMLElement or a model Object with a corresponding view registered. Only + * applicable to the gutter, overlay and block types. + */ + item?: HTMLElement; + + /** If true, the decoration will only be applied to the head of the DisplayMarker. + * Only applicable to the line and line-number types. + */ + onlyHead?: boolean; + + /** If true, the decoration will only be applied if the associated DisplayMarker + * is empty. Only applicable to the gutter, line, and line-number types. + */ + onlyEmpty?: boolean; + + /** If true, the decoration will only be applied if the associated DisplayMarker + * is non-empty. Only applicable to the gutter, line, and line-number types. + */ + onlyNonEmpty?: boolean; + + /** Only applicable to decorations of type overlay and block. Controls where the + * view is positioned relative to the TextEditorMarker. Values can be + * 'head' (the default) or 'tail' for overlay decorations, and 'before' (the default) + * or 'after' for block decorations. + */ + position?: "head"|"tail"|"before"|"after"; + + /** Only applicable to decorations of type overlay. Determines whether the decoration + * adjusts its horizontal or vertical position to remain fully visible when it would + * otherwise overflow the editor. Defaults to true. + */ + avoidOverflow?: boolean; + } + + interface DecorationProps extends SharedDecorationProps { + /** One of several supported decoration types. */ + type?: "line"|"line-number"|"highlight"|"overlay"|"gutter"|"block"; + + /** The name of the gutter we're decorating, if type is "gutter". */ + gutterName?: string; + } + + interface DecorationLayerProps extends SharedDecorationProps { + /** One of several supported decoration types. */ + type?: "line"|"line-number"|"highlight"|"block"; + } + + interface Invisibles { + tab?: string|false; + cr?: string|false; + eol?: string|false; + space?: string|false; + } + + interface CancellablePromise extends Promise { + cancel(): void; + } + + interface ScandalResult { + filePath: string; + matches: Array<{ + matchText: string; + lineText: string; + lineTextOffset: number; + range: [[number, number], [number, number]]; + leadingContextLines: string[]; + trailingContextLines: string[]; + }>; + } + + interface WindowLoadSettings { + appVersion: string; + atomHome: string; + devMode: boolean; + env: { [key: string]: string|undefined }; + profileStartup: boolean; + resourcePath: string; + safeMode: boolean; + } + + interface TestRunnerArgs { + /** An array of paths to tests to run. Could be paths to files or directories. */ + testPaths: string[]; + + /** A function that can be called to construct an instance of the atom global. + * No atom global will be explicitly assigned, but you can assign one in your + * runner if desired. + */ + buildAtomEnvironment(options: Options.BuildEnvironment): AtomEnvironment; + + /** A function that builds a default instance of the application delegate, suitable + * to be passed as the applicationDelegate parameter to buildAtomEnvironment. + */ + buildDefaultApplicationDelegate(): object; + + /** An optional path to a log file to which test output should be logged. */ + logFile: string; + + /** A boolean indicating whether or not the tests are being run from the command + * line via atom --test. + */ + headless: boolean; + } + } + + /** Atom global for dealing with packages, themes, menus, and the window. + * An instance of this class is always available as the atom global. */ - destroy(): void; + interface AtomEnvironment { + // Properties + /** A CommandRegistry instance. */ + commands: CommandRegistry; - /** - * Gets the screen range of the display marker. + /** A Config instance. */ + config: Config; + + /** A Clipboard instance. */ + clipboard: Clipboard; + + /** A ContextMenuManager instance. */ + contextMenu: ContextMenuManager; + + /** A MenuManager instance. */ + menu: MenuManager; + + /** A KeymapManager instance. */ + keymaps: AtomKeymap.KeymapManager; + + /** A TooltipManager instance. */ + tooltips: TooltipManager; + + /** A NotificationManager instance. */ + notifications: NotificationManager; + + /** A Project instance. */ + project: Project; + + /** A GrammarRegistry instance. */ + grammars: FirstMate.GrammarRegistry; + + /** A HistoryManager instance. */ + history: HistoryManager; + + /** A PackageManager instance. */ + packages: PackageManager; + + /** A ThemeManager instance. */ + themes: ThemeManager; + + /** A StyleManager instance. */ + styles: StyleManager; + + /** A DeserializerManager instance. */ + deserializers: DeserializerManager; + + /** A ViewRegistry instance. */ + views: ViewRegistry; + + /** A Workspace instance. */ + workspace: Workspace; + + /** A TextEditorRegistry instance. */ + textEditors: TextEditorRegistry; + + // Event Subscription + /** Invoke the given callback whenever ::beep is called. */ + onDidBeep(callback: () => void): EventKit.Disposable; + + /** Invoke the given callback when there is an unhandled error, but before + * the devtools pop open. + */ + onWillThrowError(callback: (event: Events.PreventableExceptionThrown) => + void): EventKit.Disposable; + + /** Invoke the given callback whenever there is an unhandled error. */ + onDidThrowError(callback: (event: Events.ExceptionThrown) => void): + EventKit.Disposable; + + /** Invoke the given callback as soon as the shell environment is loaded (or + * immediately if it was already loaded). + */ + whenShellEnvironmentLoaded(callback: () => void): EventKit.Disposable; + + // Atom Details + /** Returns a boolean that is true if the current window is in development mode. */ + inDevMode(): boolean; + + /** Returns a boolean that is true if the current window is in safe mode. */ + inSafeMode(): boolean; + + /** Returns a boolean that is true if the current window is running specs. */ + inSpecMode(): boolean; + + /** Get the version of the Atom application. */ + getVersion(): string; + + /** Gets the release channel of the Atom application. + * Returns the release channel, which can be 'dev', 'beta', or 'stable'. + */ + getReleaseChannel(): "dev"|"beta"|"stable"; + + /** Returns a boolean that is true if the current version is an official release. */ + isReleasedVersion(): boolean; + + /** Get the time taken to completely load the current window. */ + getWindowLoadTime(): number; + + /** Get the load settings for the current window. */ + getLoadSettings(): Structures.WindowLoadSettings; + + // Managing the Atom Window + /** Open a new Atom window using the given options. */ + open(params: { + pathsToOpen: ReadonlyArray, + newWindow: boolean, + devMode: boolean, + safeMode: boolean, + }): void; + + /** Close the current window. */ + close(): void; + + /** Get the size of current window. */ + getSize(): { width: number, height: number }; + + /** Set the size of current window. */ + setSize(width: number, height: number): void; + + /** Get the position of current window. */ + getPosition(): { x: number, y: number }; + + /** Set the position of current window. */ + setPosition(x: number, y: number): void; + + /** Prompt the user to select one or more folders. */ + pickFolder(callback: (paths: string[]|null) => void): void; + + /** Get the current window. */ + getCurrentWindow(): object; // Electron's BrowserWindow class. + + /** Move current window to the center of the screen. */ + center(): void; + + /** Focus the current window. */ + focus(): void; + + /** Show the current window. */ + show(): void; + + /** Hide the current window. */ + hide(): void; + + /** Reload the current window. */ + reload(): void; + + /** Relaunch the entire application. */ + restartApplication(): void; + + /** Returns a boolean that is true if the current window is maximized. */ + isMaximized(): boolean; + + /** Returns a boolean that is true if the current window is in full screen mode. */ + isFullScreen(): boolean; + + /** Set the full screen state of the current window. */ + setFullScreen(fullScreen: boolean): void; + + /** Toggle the full screen state of the current window. */ + toggleFullScreen(): void; + + // Messaging the User + /** Visually and audibly trigger a beep. */ + beep(): void; + + /** A flexible way to open a dialog akin to an alert dialog. + * Returns the chosen button index number if the buttons option was an array. + */ + confirm(options: { + message: string, + detailedMessage?: string, + buttons?: ReadonlyArray, + }): void; + + /** A flexible way to open a dialog akin to an alert dialog. + * Returns the chosen button index number if the buttons option was an array. + */ + confirm(options: { + message: string, + detailedMessage?: string, + buttons?: { + [key: string]: () => void + }, + }): number; + + // Managing the Dev Tools + /** Open the dev tools for the current window. */ + openDevTools(): Promise; + + /** Toggle the visibility of the dev tools for the current window. */ + toggleDevTools(): Promise; + + /** Execute code in dev tools. */ + executeJavaScriptInDevTools(code: string): void; + } + + /** A wrapper which provides standard error/output line buffering for + * Node's ChildProcess. */ - getScreenRange(): Range; - } + interface BufferedProcess { + // Properties + process: NodeJS.EventEmitter; + + // Event Subscription + /** Will call your callback when an error will be raised by the process. Usually + * this is due to the command not being available or not on the PATH. You can + * call handle() on the object passed to your callback to indicate that you + * have handled this error. + */ + onWillThrowError(callback: (errorObject: { error: Error, handle(): void }) => + void): EventKit.Disposable; + + // Helper Methods + /** Terminate the process. */ + kill(): void; + + /** Runs the process. */ + start(): void; + } + + /** Like BufferedProcess, but accepts a Node script as the command to run. + * This is necessary on Windows since it doesn't support shebang #! lines. + */ + type BufferedNodeProcess = BufferedProcess; + + /** Represents the clipboard used for copying and pasting in Atom. */ + interface Clipboard { + /** Write the given text to the clipboard. */ + write(text: string, metadata?: object): void; + + /** Read the text from the clipboard. */ + read(): string; + + /** Read the text from the clipboard and return both the text and the associated + * metadata. + */ + readWithMetadata(): { text: string, metadata: object }; + } + + /** A simple color class returned from Config::get when the value at the key path is + * of type 'color'. + */ + interface Color { + /** Returns a string in the form '#abcdef'. */ + toHexString(): string; + + /** Returns a string in the form 'rgba(25, 50, 75, .9)'. */ + toRGBAString(): string; + } + + /** Used to access all of Atom's configuration details. */ + interface Config { + // Config Subscription + /** Add a listener for changes to a given key path. This is different than ::onDidChange in + * that it will immediately call your callback with the current value of the config entry. + */ + // tslint:disable-next-line:no-any + observe(keyPath: string, callback: (value: any) => void): + EventKit.Disposable; + /** Add a listener for changes to a given key path. This is different than ::onDidChange in + * that it will immediately call your callback with the current value of the config entry. + */ + // tslint:disable:no-any + observe(keyPath: string, options: { scope: string[]|ScopeDescriptor }, + callback: (value: any) => void): EventKit.Disposable; + // tslint:enable:no-any + + /** Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + // tslint:disable-next-line:no-any + onDidChange(callback: (values: { newValue: T, oldValue: T }) => void): + EventKit.Disposable; + /** Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + // tslint:disable-next-line:no-any + onDidChange(keyPath: string, callback: (values: { newValue: T, + oldValue: T }) => void): EventKit.Disposable; + /** Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + // tslint:disable-next-line:no-any + onDidChange(keyPath: string, options: { scope: string[]|ScopeDescriptor }, + callback: (values: { newValue: T, oldValue: T }) => void): EventKit.Disposable; + + // Managing Settings + /** Retrieves the setting for the given key. */ + // tslint:disable:no-any + get(keyPath: string, options?: { sources?: string[], excludeSources?: string[], + scope?: string[]|ScopeDescriptor }): any; + // tslint:enable:no-any + + /** Sets the value for a configuration setting. + * This value is stored in Atom's internal configuration file. + */ + // tslint:disable-next-line:no-any + set(keyPath: string, value: any, options?: { scopeSelector?: string, source?: + string }): void; + + /** Restore the setting at keyPath to its default value. */ + unset(keyPath: string, options?: { scopeSelector?: string, source?: string }): void; + + /** Get all of the values for the given key-path, along with their associated + * scope selector. + */ + // tslint:disable:no-any + getAll(keyPath: string, options?: { sources?: string[], excludeSources?: string[], + scope?: ScopeDescriptor }): Array<{ scopeDescriptor: ScopeDescriptor, value: any}>; + // tslint:enable:no-any + + /** Get an Array of all of the source Strings with which settings have been added + * via ::set. + */ + getSources(): string[]; + + /** Retrieve the schema for a specific key path. The schema will tell you what type + * the keyPath expects, and other metadata about the config option. + */ + getSchema(keyPath: string): object|null; + + /** Get the string path to the config file being used. */ + getUserConfigPath(): string; + + /** Suppress calls to handler functions registered with ::onDidChange and ::observe + * for the duration of callback. After callback executes, handlers will be called + * once if the value for their key-path has changed. + */ + transact(callback: () => void): void; + } + + /** Provides a registry for commands that you'd like to appear in the context menu. */ + interface ContextMenuManager { + /** Add context menu items scoped by CSS selectors. */ + add(itemsBySelector: { + [key: string]: ReadonlyArray + }): EventKit.Disposable; + } + + /** Associates listener functions with commands in a context-sensitive way + * using CSS selectors. + */ + interface CommandRegistry { + /** Register a single command. */ + add(target: string|Node, commandName: string, listener: { + didDispatch(event: AtomKeymap.CommandEvent): void, + displayName?: string, + description?: string, + } | ((event: AtomKeymap.CommandEvent) => void)): EventKit.Disposable; + + /** Register multiple commands. */ + add(target: string|Node, commands: { [key: string]: (event: + AtomKeymap.CommandEvent) => void }): EventKit.CompositeDisposable; + + /** Find all registered commands matching a query. */ + findCommands(params: { target: Node }): Array<{ + name: string, + displayName: string, + description?: string, + tags?: string[], + }>; + + /** Simulate the dispatch of a command on a DOM node. */ + dispatch(target: Node, commandName: string): void; + + /** Invoke the given callback before dispatching a command event. */ + onWillDispatch(callback: (event: AtomKeymap.CommandEvent) => void): EventKit.Disposable; + + /** Invoke the given callback after dispatching a command event. */ + onDidDispatch(callback: (event: AtomKeymap.CommandEvent) => void): EventKit.Disposable; + } + + /** The Cursor class represents the little blinking line identifying where text + * can be inserted. + */ + interface Cursor { + // Event Subscription + /** Calls your callback when the cursor has been moved. */ + onDidChangePosition(callback: (event: Events.CursorPositionChanged) => void): + EventKit.Disposable; + + /** Calls your callback when the cursor is destroyed. */ + onDidDestroy(callback: () => void): EventKit.Disposable; + + /** Calls your callback when the cursor's visibility has changed. */ + onDidChangeVisibility(callback: (visibility: boolean) => void): + EventKit.Disposable; + + // Managing Cursor Position + /** Moves a cursor to a given screen position. */ + setScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], + options?: { autoscroll?: boolean }): void; + + /** Returns the screen position of the cursor as a Point. */ + getScreenPosition(): TextBuffer.Point; + + /** Moves a cursor to a given buffer position. */ + setBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], + options?: { autoscroll?: boolean }): void; + + /** Returns the current buffer position as an Array. */ + getBufferPosition(): TextBuffer.Point; + + /** Returns the cursor's current screen row. */ + getScreenRow(): number; + + /** Returns the cursor's current screen column. */ + getScreenColumn(): number; - interface IWorkspaceView extends View { - // Delegator.includeInto(WorkspaceView); - - // delegate to model property's property - fullScreen:boolean; - - // delegate to model property's method - open(uri:string, options:any):Q.Promise; - openSync(uri:string, options?:any):any; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - saveAll():void; - destroyActivePaneItem():any; - destroyActivePane():any; - increaseFontSize():void; - decreaseFontSize():void; - - // own property & methods - initialize(model:IWorkspace):any; - initialize(view:View, args:any):void; // do not use - model:IWorkspace; - panes: IPaneContainerView; - getModel():IWorkspace; - installShellCommands():any; - handleFocus():any; - afterAttach(onDom?:any):any; - confirmClose():boolean; - updateTitle():any; - setTitle(title:string):any; - getEditorViews():any[]; // atom.EditorView - prependToTop(element:any):any; - appendToTop(element:any):any; - prependToBottom(element:any):any; - appendToBottom(element:any):any; - prependToLeft(element:any):any; - appendToLeft(element:any):any; - prependToRight(element:any):any; - appendToRight(element:any):any; - getActivePaneView():IPaneView; - getActiveView():View; - focusPreviousPaneView():any; - focusNextPaneView():any; - focusPaneViewAbove():any; - focusPaneViewBelow():any; - focusPaneViewOnLeft():any; - focusPaneViewOnRight():any; - eachPaneView(callback:(paneView:IPaneView)=>any):{ off():any; }; - getPaneViews():IPaneView[]; - eachEditorView(callback:(editorView:any /* EditorView */)=>any):{ off():any; }; - beforeRemove():any; - - command(eventName:string, handler:Function):any; - command(eventName:string, selector:Function, handler:Function):any; - command(eventName:string, options:any, handler:Function):any; - command(eventName:string, selector:Function, options:any, handler:Function):any; - - statusBar:StatusBar.IStatusBarView; - } + /** Retrieves the cursor's current buffer row. */ + getBufferRow(): number; - interface IPanes { - // TBD - } + /** Returns the cursor's current buffer column. */ + getBufferColumn(): number; - interface IPaneView { - // TBD - } + /** Returns the cursor's current buffer row of text excluding its line ending. */ + getCurrentBufferLine(): string; - interface IPaneContainerView { - // TBD - } + /** Returns whether the cursor is at the start of a line. */ + isAtBeginningOfLine(): boolean; - interface ITreeView { - // TBD - } + /** Returns whether the cursor is on the line return character. */ + isAtEndOfLine(): boolean; - interface IGutterViewStatic { - new(): IGutterView; - content():any; - } + // Cursor Position Details + /** Returns the underlying DisplayMarker for the cursor. Useful with overlay + * Decorations. + */ + getMarker(): TextBuffer.DisplayMarker; - interface IGutterView extends View { - firstScreenRow:any; - lastScreenRow:any; - initialize():void; - initialize(view:View, args:any):void; // do not use - afterAttach(onDom?:any):any; - beforeRemove():any; - handleMouseEvents(e:JQueryMouseEventObject):any; - getEditorView():any; /* EditorView */ - getEditor():IEditor; - getLineNumberElements():HTMLCollection; - getLineNumberElementsForClass(klass:string):NodeList; - getLineNumberElement(bufferRow:number):NodeList; - addClassToAllLines(klass:string):boolean; - removeClassFromAllLines(klass:string):boolean; - addClassToLine(bufferRow:number, klass:string):boolean; - removeClassFromLine(bufferRow:number, klass:string):boolean; - updateLineNumbers(changes:any[], startScreenRow?:number, endScreenRow?:number):any; - prependLineElements(lineElements:any):void; - appendLineElements(lineElements:any):void; - removeLineElements(numberOfElements:number):void; - buildLineElements(startScreenRow:any, endScreenRow:any):any; - buildLineElementsHtml(startScreenRow:any, endScreenRow:any):any; - updateFoldableClasses(changes:any[]):any; - removeLineHighlights():void; - addLineHighlight(row:number, emptySelection?:boolean):any; - highlightLines():boolean; - } + /** Identifies if the cursor is surrounded by whitespace. + * "Surrounded" here means that the character directly before and after the cursor + * are both whitespace. + */ + isSurroundedByWhitespace(): boolean; - interface ICommandRegistry { - add(target: string, commandName: Object, callback?: (event: any) => void): any; // selector:'atom-editor'|'atom-workspace' - findCommands(params: Object): Object[]; - dispatch(selector: any, name:string): void; - } + /** This method returns false if the character before or after the cursor is whitespace. */ + isBetweenWordAndNonWord(): boolean; - interface ICommandPanel { - // TBD - } + /** Returns whether this cursor is between a word's start and end. */ + isInsideWord(options?: { wordRegex?: RegExp }): boolean; - interface IDisplayBufferStatic { - new(_arg?:any):IDisplayBuffer; - } + /** Returns the indentation level of the current line. */ + getIndentLevel(): number; - interface IDisplayBuffer /* extends Theorist.Model */ { - // Serializable.includeInto(Editor); - - constructor:IDisplayBufferStatic; - - verticalScrollMargin:number; - horizontalScrollMargin:number; - - declaredPropertyValues:any; - tokenizedBuffer: ITokenizedBuffer; - buffer: TextBuffer.ITextBuffer; - charWidthsByScope:any; - markers:{ [index:number]:IDisplayBufferMarker; }; - foldsByMarkerId:any; - maxLineLength:number; - screenLines:ITokenizedLine[]; - rowMap:any; // return type are RowMap - longestScreenRow:number; - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // return type are WeakMap - behaviors:any; - subscriptionCounts:any; - eventHandlersByEventName:any; - pendingChangeEvent:any; - - softWrap:boolean; - - serializeParams():{id:number; softWrap:boolean; editorWidthInChars: number; scrollTop: number; scrollLeft: number; tokenizedBuffer: any; }; - deserializeParams(params:any):any; - copy():IDisplayBuffer; - updateAllScreenLines():any; - emitChanged(eventProperties:any, refreshMarkers?:boolean):any; - updateWrappedScreenLines():any; - setVisible(visible:any):any; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):number; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):number; - getHeight():any; - setHeight(height:any):any; - getWidth():any; - setWidth(newWidth:any):any; - getScrollTop():number; - setScrollTop(scrollTop:number):number; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):number; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):number; - getScrollRight():number; - setScrollRight(scrollRight:number):number; - getLineHeight():any; - setLineHeight(lineHeight:any):any; - getDefaultCharWidth():any; - setDefaultCharWidth(defaultCharWidth:any):any; - getScopedCharWidth(scopeNames:any, char:any):any; - getScopedCharWidths(scopeNames:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - setScopedCharWidths(scopeNames:any, charWidths:any):any; - clearScopedCharWidths():any; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number[]; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - scrollToScreenRange(screenRange:any):any; - scrollToScreenPosition(screenPosition:any):any; - scrollToBufferPosition(bufferPosition:any):any; - pixelRectForScreenRange(screenRange:TextBuffer.IRange):any; - getTabLength():number; - setTabLength(tabLength:number):any; - setSoftWrap(softWrap:boolean):boolean; - getSoftWrap():boolean; - setEditorWidthInChars(editorWidthInChars:number):any; - getEditorWidthInChars():number; - getSoftWrapColumn():number; - lineForRow(row:number):any; - linesForRows(startRow:number, endRow:number):any; - getLines():any[]; - indentLevelForLine(line:any):any; - bufferRowsForScreenRows(startScreenRow:any, endScreenRow:any):any; - createFold(startRow:number, endRow:number):IFold; - isFoldedAtBufferRow(bufferRow:number):boolean; - isFoldedAtScreenRow(screenRow:number):boolean; - destroyFoldWithId(id:number):any; - unfoldBufferRow(bufferRow:number):any[]; - largestFoldStartingAtBufferRow(bufferRow:number):any; - foldsStartingAtBufferRow(bufferRow:number):any; - largestFoldStartingAtScreenRow(screenRow:any):any; - largestFoldContainingBufferRow(bufferRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - foldsContainingBufferRow(bufferRow:any):any[]; - screenRowForBufferRow(bufferRow:number):number; - lastScreenRowForBufferRow(bufferRow:number):number; - bufferRowForScreenRow(screenRow:number):number; - - screenRangeForBufferRange(bufferRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:TextBuffer.IRange):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IRange):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IPoint[], clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IRange, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - - pixelPositionForScreenPosition(screenPosition:TextBuffer.IPoint, clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:number[], clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:{row:number; col:number;}, clip?:boolean):TextBuffer.IPoint; - - screenPositionForPixelPosition(pixelPosition:any):TextBuffer.IPoint; - - pixelPositionForBufferPosition(bufferPosition:any):any; - getLineCount():number; - getLastRow():number; - getMaxLineLength():number; - screenPositionForBufferPosition(bufferPosition:any, options:any):any; - bufferPositionForScreenPosition(bufferPosition:any, options:any):any; - scopesForBufferPosition(bufferPosition:any):any; - bufferRangeForScopeAtPosition(selector:any, position:any):any; - tokenForBufferPosition(bufferPosition:any):any; - getGrammar():IGrammar; - setGrammar(grammar:IGrammar):any; - reloadGrammar():any; - clipScreenPosition(screenPosition:any, options:any):any; - findWrapColumn(line:any, softWrapColumn:any):any; - rangeForAllLines():TextBuffer.IRange; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - getMarkerCount():number; - markScreenRange(range:TextBuffer.IRange, ...args:any[]):IDisplayBufferMarker; - markBufferRange(range:TextBuffer.IRange, options?:any):IDisplayBufferMarker; - markScreenPosition(screenPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - markBufferPosition(bufferPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - destroyMarker(id:number):any; - findMarker(params?:any):IDisplayBufferMarker; - findMarkers(params?:any):IDisplayBufferMarker[]; - translateToBufferMarkerParams(params?:any):any; - findFoldMarker(attributes:any):IMarker; - findFoldMarkers(attributes:any):IMarker[]; - getFoldMarkerAttributes(attributes?:any):any; - pauseMarkerObservers():any; - resumeMarkerObservers():any; - refreshMarkerScreenPositions():any; - destroy():any; - logLines(start:number, end:number):any[]; - handleTokenizedBufferChange(tokenizedBufferChange:any):any; - updateScreenLines(startBufferRow:any, endBufferRow:any, bufferDelta?:number, options?:any):any; - buildScreenLines(startBufferRow:any, endBufferRow:any):any; - findMaxLineLength(startScreenRow:any, endScreenRow:any, newScreenLines:any):any; - handleBufferMarkersUpdated():any; - handleBufferMarkerCreated(marker:any):any; - createFoldForMarker(maker:any):IFold; - foldForMarker(marker:any):any; - } + /** Retrieves the scope descriptor for the cursor's current position. */ + getScopeDescriptor(): ScopeDescriptor; - interface IViewRegistry { - getView(selector:any):any; - } + /** Returns true if this cursor has no non-whitespace characters before its + * current position. + */ + hasPrecedingCharactersOnLine(): boolean; - interface ICursorStatic { - new (arg:{editor:IEditor; marker:IDisplayBufferMarker; id: number;}):ICursor; - } + /** Identifies if this cursor is the last in the TextEditor. + * "Last" is defined as the most recently added cursor. + */ + isLastCursor(): boolean; - interface ScopeDescriptor { - scopes: string[]; - } + // Moving the Cursor + /** Moves the cursor up one screen row. */ + moveUp(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - interface ICursor /* extends Theorist.Model */ { - getScopeDescriptor(): ScopeDescriptor; - screenPosition:any; - bufferPosition:any; - goalColumn:any; - visible:boolean; - needsAutoscroll:boolean; - - editor:IEditor; - marker:IDisplayBufferMarker; - id: number; - - destroy():any; - changePosition(options:any, fn:Function):any; - getPixelRect():any; - setScreenPosition(screenPosition:any, options?:any):any; - getScreenPosition():TextBuffer.IPoint; - getScreenRange():TextBuffer.IRange; - setBufferPosition(bufferPosition:any, options?:any):any; - getBufferPosition():TextBuffer.IPoint; - autoscroll():any; - updateVisibility():any; - setVisible(visible:boolean):any; - isVisible():boolean; - wordRegExp(arg?:any):any; - isLastCursor():boolean; - isSurroundedByWhitespace():boolean; - isBetweenWordAndNonWord():boolean; - isInsideWord():boolean; - clearAutoscroll():void; - clearSelection():void; - getScreenRow():number; - getScreenColumn():number; - getBufferRow():number; - getBufferColumn():number; - getCurrentBufferLine():string; - moveUp(rowCount:number, arg?:any):any; - moveDown(rowCount:number, arg?:any):any; - moveLeft(arg?:any):any; - moveRight(arg?:any):any; - moveToTop():any; - moveToBottom():void; - moveToBeginningOfScreenLine():void; - moveToBeginningOfLine():void; - moveToFirstCharacterOfLine():void; - moveToEndOfScreenLine():void; - moveToEndOfLine():void; - moveToBeginningOfWord():void; - moveToEndOfWord():void; - moveToBeginningOfNextWord():void; - moveToPreviousWordBoundary():void; - moveToNextWordBoundary():void; - getBeginningOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getPreviousWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getMoveNextWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getEndOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getBeginningOfNextWordBufferPosition(options?:any):TextBuffer.IPoint; - getCurrentWordBufferRange(options?:any):TextBuffer.IPoint; - getCurrentLineBufferRange(options?:any):TextBuffer.IPoint; - getCurrentParagraphBufferRange():any; - getCurrentWordPrefix():string; - isAtBeginningOfLine():boolean; - getIndentLevel():number; - isAtEndOfLine():boolean; - getScopes():string[]; - hasPrecedingCharactersOnLine():boolean; - getMarker(): Marker; - } + /** Moves the cursor down one screen row. */ + moveDown(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - interface ILanguageMode { - // TBD - } + /** Moves the cursor left one screen column. */ + moveLeft(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - interface ISelection { - // https://atom.io/docs/api/v1.7.3/Selection - - // Event Subscription - onDidChangeRange(callback: (event: { - oldBufferRange: TextBuffer.IRange; - oldScreenRange: TextBuffer.IRange; - newBufferRange: TextBuffer.IRange; - newScreenRange: TextBuffer.IRange; - selection: ISelection; - }) => {}): Disposable; - onDidDestroy(callback: () => {}): Disposable; - - // Managing the selection range - getScreenRange(): TextBuffer.IRange; - setScreenRange(screenRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRange(): TextBuffer.IRange; - setBufferRange(bufferRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRowRange(): [number]; - - // Info about the selection - isEmpty(): boolean; - isReversed(): boolean; - isSingleScreenLine(): boolean; - getText(): string; - intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; - intersectsWith(otherSelection: ISelection): boolean; - - // Modifying the selected range - clear(options?: {autoscroll?: boolean}): void; - selectToScreenPosition(position: any): void; - selectToBufferPosition(position: any): void; - selectRight(columnCount?: number): void; - selectLeft(columnCount?: number): void; - selectUp(rowCount: number): void; - selectDown(rowCount: number): void; - selectToTop(): void; - selectToBottom(): void; - selectAll(): void; - selectToBeginningOfLine(): void; - selectToFirstCharacterOfLine(): void; - selectToEndOfLine(): void; - selectToEndOfBufferLine(): void; - selectToBeginningOfWord(): void; - selectToEndOfWord(): void; - selectToBeginningOfNextWord(): void; - selectToPreviousWordBoundary(): void; - selectToNextWordBoundary(): void; - selectToPreviousSubwordBoundary(): void; - selectToNextSubwordBoundary(): void; - selectToBeginningOfNextParagraph(): void; - selectToBeginningOfPreviousParagraph(): void; - selectWord(): TextBuffer.IRange; - expandOverWord(): void; - selectLine(row?: number): void; - expandOverLine(): void; - - // Modifying the selected text - insertText(text: string, options?: { - select: boolean; - autoIndent: boolean; - autoIndentNewline: boolean; - autoDecreaseIndent: boolean; - normalizeLineEndings?: boolean; - undo?: 'skip'; - }): void; - backspace(): void; - deleteToPreviousWordBoundary(): void; - deleteToNextWordBoundary(): void; - deleteToBeginningOfWord(): void; - deleteToBeginningOfLine(): void; - delete(): void; - deleteToEndOfLine(): void; - deleteToEndOfWord(): void; - deleteToBeginningOfSubword(): void; - deleteToEndOfSubword(): void; - deleteSelectedText(): void; - deleteLine(): void; - joinLines(): void; - outdentSelectedRows(): void; - autoIndentSelectedRows(): void; - toggleLineComments(): void; - cutToEndOfLine(): void; - cutToEndOfBufferLine(): void; - cut(maintainClipboard?: boolean, fullLine?: boolean): void; - copy(maintainClipboard?: boolean, fullLine?: boolean): void; - fold(): void; - indentSelectedRows(): void; - - // Managing multiple selections - addSelectionBelow(): void; - addSelectionAbove(): void; - merge(otherSelection: ISelection, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - - // Comparing to other selections - compare(otherSelection: ISelection): any; - } + /** Moves the cursor right one screen column. */ + moveRight(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - interface IDecorationParams { - id?: number; - class: string; - type: any /* string or string[] */; - } + /** Moves the cursor to the top of the buffer. */ + moveToTop(): void; - interface IDecorationStatic { - isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean; - new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration; - } + /** Moves the cursor to the bottom of the buffer. */ + moveToBottom(): void; - interface IDecoration extends Emissary.IEmitter { - marker: IDisplayBufferMarker; - displayBuffer: IDisplayBuffer; - params: IDecorationParams - id: number; - flashQueue: any[]; - isDestroyed: boolean; - - destroy():void; - update(newParams:IDecorationParams):void; - getMarker():IDisplayBufferMarker; - getParams():IDecorationParams; - isType(type:string):boolean; - matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean; - flash(klass:string, duration?:number):void; - consumeNextFlash():any; - } + /** Moves the cursor to the beginning of the line. */ + moveToBeginningOfScreenLine(): void; - interface IEditor { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - deserializing:boolean; - callDisplayBufferCreatedHook:boolean; - registerEditor:boolean; - buffer:TextBuffer.ITextBuffer; - languageMode: ILanguageMode; - cursors:ICursor[]; - selections: ISelection[]; - suppressSelectionMerging:boolean; - updateBatchDepth: number; - selectionFlashDuration: number; - softTabs: boolean; - displayBuffer: IDisplayBuffer; - - id:number; - behaviors:any; - declaredPropertyValues: any; - eventHandlersByEventName: any; - eventHandlersByNamespace: any; - lastOpened: number; - subscriptionCounts: any; - subscriptionsByObject: any; /* WeakMap */ - subscriptions: Emissary.ISubscription[]; - destroy():void; - - mini: any; - - serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;}; - deserializeParams(params:any):any; - subscribeToBuffer():void; - subscribeToDisplayBuffer():void; - getViewClass():any; // return type are EditorView - destroyed():void; - isDestroyed():boolean; - copy():IEditor; - getTitle():string; - getLongTitle():string; - setVisible(visible:boolean):void; - setMini(mini:any):void; - setScrollTop(scrollTop:any):void; - getScrollTop():number; - setScrollLeft(scrollLeft:any):void; - getScrollLeft():number; - setEditorWidthInChars(editorWidthInChars:any):void; - getSoftWrapColumn():number; - getSoftTabs():boolean; - setSoftTabs(softTabs:boolean):void; - getSoftWrap():boolean; - setSoftWrap(softWrap:any):void; - getTabText():string; - getTabLength():number; - setTabLength(tabLength:any):void; - usesSoftTabs():boolean; - clipBufferPosition(bufferPosition:any):void; - clipBufferRange(range:any):void; - indentationForBufferRow(bufferRow:any):void; - setIndentationForBufferRow(bufferRow:any, newLevel:any, _arg:any):void; - indentLevelForLine(line:any):number; - buildIndentString(number:any):string; - save():void; - saveAs(filePath:any):void; - copyPathToClipboard():void; - getPath():string; - getText():string; - setText(text:any):void; - getTextInRange(range:any):any; - getLineCount():number; - getBuffer():TextBuffer.ITextBuffer; - getURI():string; - isBufferRowBlank(bufferRow:any):boolean; - isBufferRowCommented(bufferRow:any):void; - nextNonBlankBufferRow(bufferRow:any):void; - getEofBufferPosition():TextBuffer.IPoint; - getLastBufferRow():number; - bufferRangeForBufferRow(row:any, options:any):TextBuffer.IRange; - lineForBufferRow(row:number):string; - lineLengthForBufferRow(row:number):number; - scan():any; - scanInBufferRange():any; - backwardsScanInBufferRange():any; - isModified():boolean; - isEmpty():boolean; - shouldPromptToSave():boolean; - screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint; - bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint; - screenRangeForBufferRange(bufferRange:any):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:any):TextBuffer.IRange; - clipScreenPosition(screenPosition:any, options:any):TextBuffer.IRange; - lineForScreenRow(row:any):ITokenizedLine; - linesForScreenRows(start?:any, end?:any):ITokenizedLine[]; - getScreenLineCount():number; - getMaxScreenLineLength():number; - getLastScreenRow():number; - bufferRowsForScreenRows(startRow:any, endRow:any):any[]; - bufferRowForScreenRow(row:any):number; - scopesForBufferPosition(bufferPosition:any):string[]; - bufferRangeForScopeAtCursor(selector:string):any; - tokenForBufferPosition(bufferPosition:any):IToken; - getCursorScopes():string[]; - logCursorScope():void; - insertText(text:string, options?:any):TextBuffer.IRange[]; - insertNewline():TextBuffer.IRange[]; - insertNewlineBelow():TextBuffer.IRange[]; - insertNewlineAbove():any; - indent(options?:any):any; - backspace():any[]; - // deprecated backspaceToBeginningOfWord():any[]; - // deprecated backspaceToBeginningOfLine():any[]; - deleteToBeginningOfWord():any[]; - deleteToBeginningOfLine():any[]; - delete():any[]; - deleteToEndOfLine():any[]; - deleteToEndOfWord():any[]; - deleteLine():TextBuffer.IRange[]; - indentSelectedRows():TextBuffer.IRange[][]; - outdentSelectedRows():TextBuffer.IRange[][]; - toggleLineCommentsInSelection():TextBuffer.IRange[]; - autoIndentSelectedRows():TextBuffer.IRange[][]; - normalizeTabsInBufferRange(bufferRange:any):any; - cutToEndOfLine():boolean[]; - cutSelectedText():boolean[]; - copySelectedText():boolean[]; - pasteText(options?:any):TextBuffer.IRange[]; - undo():any[]; - redo():any[]; - foldCurrentRow():any; - unfoldCurrentRow():any[]; - foldSelectedLines():any[]; - foldAll():any[]; - unfoldAll():any[]; - foldAllAtIndentLevel(level:any):any; - foldBufferRow(bufferRow:any):any; - unfoldBufferRow(bufferRow:any):any; - isFoldableAtBufferRow(bufferRow:any):boolean; - isFoldableAtScreenRow(screenRow:any):boolean; - createFold(startRow:any, endRow:any):IFold; - destroyFoldWithId(id:any):any; - destroyFoldsIntersectingBufferRange(bufferRange:any):any; - toggleFoldAtBufferRow(bufferRow:any):any; - isFoldedAtCursorRow():boolean; - isFoldedAtBufferRow(bufferRow:any):boolean; - isFoldedAtScreenRow(screenRow:any):boolean; - largestFoldContainingBufferRow(bufferRow:any):boolean; - largestFoldStartingAtScreenRow(screenRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - moveLineUp():ISelection[]; - moveLineDown():ISelection[]; - duplicateLines():any[][]; - // duprecated duplicateLine():any[][]; - mutateSelectedText(fn:(selection:ISelection)=>any):any; - replaceSelectedText(options:any, fn:(selection:string)=>any):any; - decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]}; - decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration; - decorationForId(id:number):IDecoration; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - findMarkers(...args:any[]):IDisplayBufferMarker[]; - markScreenRange(...args:any[]):IDisplayBufferMarker; - markBufferRange(...args:any[]):IDisplayBufferMarker; - markScreenPosition(...args:any[]):IDisplayBufferMarker; - markBufferPosition(...args:any[]):IDisplayBufferMarker; - destroyMarker(...args:any[]):boolean; - getMarkerCount():number; - hasMultipleCursors():boolean; - getCursors():ICursor[]; - getCursor():ICursor; - addCursorAtScreenPosition(screenPosition:any):ICursor; - addCursorAtBufferPosition(bufferPosition:any):ICursor; - addCursor(marker:any):ICursor; - removeCursor(cursor:any):ICursor[]; - addSelection(marker:any, options:any):ISelection; - addSelectionForBufferRange(bufferRange:any, options:any):ISelection; - setSelectedBufferRange(bufferRange:any, options:any):any; - setSelectedBufferRanges(bufferRanges:any, options:any):any; - removeSelection(selection:ISelection):any; - clearSelections():boolean; - consolidateSelections():boolean; - selectionScreenRangeChanged(selection:any):void; - getSelections():ISelection[]; - getSelection(index?:number):ISelection; - getLastSelection():ISelection; - getSelectionsOrderedByBufferPosition():ISelection[]; - getLastSelectionInBuffer():ISelection; - selectionIntersectsBufferRange(bufferRange:any):any; - setCursorScreenPosition(position:TextBuffer.IPoint, options?:any):any; - getCursorScreenPosition():TextBuffer.IPoint; - getCursorScreenRow():number; - setCursorBufferPosition(position:any, options?:any):any; - getCursorBufferPosition():TextBuffer.IPoint; - getSelectedScreenRange():TextBuffer.IRange; - getSelectedBufferRange():TextBuffer.IRange; - getSelectedBufferRanges():TextBuffer.IRange[]; - getSelectedText():string; - getTextInBufferRange(range:TextBuffer.IRange):string; - setTextInBufferRange(range:TextBuffer.IRange | any[], text:string):any; - getCurrentParagraphBufferRange():TextBuffer.IRange; - getWordUnderCursor(options?:any):string; - moveCursorUp(lineCount?:number):void; - moveCursorDown(lineCount?:number):void; - moveCursorLeft():void; - moveCursorRight():void; - moveCursorToTop():void; - moveCursorToBottom():void; - moveCursorToBeginningOfScreenLine():void; - moveCursorToBeginningOfLine():void; - moveCursorToFirstCharacterOfLine():void; - moveCursorToEndOfScreenLine():void; - moveCursorToEndOfLine():void; - moveCursorToBeginningOfWord():void; - moveCursorToEndOfWord():void; - moveCursorToBeginningOfNextWord():void; - moveCursorToPreviousWordBoundary():void; - moveCursorToNextWordBoundary():void; - moveCursorToBeginningOfNextParagraph():void; - moveCursorToBeginningOfPreviousParagraph():void; - moveToBottom():void; - scrollToCursorPosition(options:any):any; - pageUp():void; - pageDown():void; - selectPageUp():void; - selectPageDown():void; - getRowsPerPage():number; - moveCursors(fn:(cursor:ICursor)=>any):any; - cursorMoved(event:any):void; - selectToScreenPosition(position:TextBuffer.IPoint):any; - selectRight():ISelection[]; - selectLeft():ISelection[]; - selectUp(rowCount?:number):ISelection[]; - selectDown(rowCount?:number):ISelection[]; - selectToTop():ISelection[]; - selectAll():ISelection[]; - selectToBottom():ISelection[]; - selectToBeginningOfLine():ISelection[]; - selectToFirstCharacterOfLine():ISelection[]; - selectToEndOfLine():ISelection[]; - selectToPreviousWordBoundary():ISelection[]; - selectToNextWordBoundary():ISelection[]; - selectLine():ISelection[]; - selectLinesContainingCursors():ISelection[]; - addSelectionBelow():ISelection[]; - addSelectionAbove():ISelection[]; - splitSelectionsIntoLines():any[]; - transpose():TextBuffer.IRange[]; - upperCase():boolean[]; - lowerCase():boolean[]; - joinLines():any[]; - selectToBeginningOfWord():ISelection[]; - selectToEndOfWord():ISelection[]; - selectToBeginningOfNextWord():ISelection[]; - selectWord():ISelection[]; - selectToBeginningOfNextParagraph():ISelection[]; - selectToBeginningOfPreviousParagraph():ISelection[]; - selectMarker(marker:any):any; - mergeCursors():number[]; - expandSelectionsForward():any; - expandSelectionsBackward(fn:(selection:ISelection)=>any):ISelection[]; - finalizeSelections():boolean[]; - mergeIntersectingSelections():any; - preserveCursorPositionOnBufferReload():Emissary.ISubscription; - getGrammar(): IGrammar; - setGrammar(grammer:IGrammar):void; - reloadGrammar():any; - shouldAutoIndent():boolean; - shouldShowInvisibles():boolean; - updateInvisibles():void; - transact(fn:Function):any; - beginTransaction():ITransaction; - commitTransaction():any; - abortTransaction():any[]; - inspect():string; - logScreenLines(start:number, end:number):any[]; - handleTokenization():void; - handleGrammarChange():void; - handleMarkerCreated(marker:any):any; - getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; }; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):void; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):void; - getLineHeightInPixels():number; - setLineHeightInPixels(lineHeightInPixels:number):void; - batchCharacterMeasurement(fn:Function):void; - getScopedCharWidth(scopeNames:any, char:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - getScopedCharWidths(scopeNames:any):any; - clearScopedCharWidths():any; - getDefaultCharWidth():number; - setDefaultCharWidth(defaultCharWidth:number):void; - setHeight(height:number):void; - getHeight():number; - getClientHeight():number; - setWidth(width:number):void; - getWidth():number; - getScrollTop():number; - setScrollTop(scrollTop:number):void; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):void; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):void; - getScrollRight():number; - setScrollRight(scrollRight:number):void; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - pixelPositionForScreenPosition(screenPosition:any):any; - pixelPositionForBufferPosition(bufferPosition:any):any; - screenPositionForPixelPosition(pixelPosition:any):any; - pixelRectForScreenRange(screenRange:any):any; - scrollToScreenRange(screenRange:any, options:any):any; - scrollToScreenPosition(screenPosition:any, options:any):any; - scrollToBufferPosition(bufferPosition:any, options:any):any; - horizontallyScrollable():any; - verticallyScrollable():any; - getHorizontalScrollbarHeight():any; - setHorizontalScrollbarHeight(height:any):any; - getVerticalScrollbarWidth():any; - setVerticalScrollbarWidth(width:any):any; - // deprecated joinLine():any; - - onDidChange(callback: Function): Disposable; - onDidDestroy(callback: Function): Disposable; - onDidStopChanging(callback: Function): Disposable; - onDidChangeCursorPosition(callback: Function): Disposable; - onDidSave(callback: (event: { path: string }) => void): Disposable; - - decorateMarker(marker: Marker, options: any): Decoration; - getLastCursor(): ICursor; - } + /** Moves the cursor to the beginning of the buffer line. */ + moveToBeginningOfLine(): void; - interface IGrammar { - bundledPackage: boolean; - emitter: any; - fileTypes: [string]; - firstLineRegex: any; - foldingStopMarker: any; - includedGrammarScopes: [any]; - initialRule: any; - injectionSelector: any; - injections: any; - maxTokensPerLine: Number; - name: string; - packageName: string; - path: string; - rawPatterns: [any]; - rawRepository: any; - registration: Disposable; - registry: any; - repository: Object; - scopeName: string; - tokenizeLines: (text: string) => any; - // TBD + /** Moves the cursor to the beginning of the first character in the line. */ + moveToFirstCharacterOfLine(): void; - } + /** Moves the cursor to the end of the line. */ + moveToEndOfScreenLine(): void; - interface IGrammars { - grammarForScopeName(scope: string): IGrammar; - } - - interface IPane /* extends Theorist.Model */ { - itemForURI: (uri:string)=>IEditor; - items:any[]; - activeItem:any; - - serializeParams():any; - deserializeParams(params:any):any; - getViewClass():any; // return type are PaneView - isActive():boolean; - isDestroyed():boolean; - focus():void; - blur():void; - activate():void; - getPanes():IPane[]; - getItems():any[]; - getActiveItem():any; - getActiveEditor():any; - itemAtIndex(index:number):any; - activateNextItem():any; - activatePreviousItem():any; - getActiveItemIndex():number; - activateItemAtIndex(index:number):any; - activateItem(item:any):any; - addItem(item:any, index:number):any; - addItems(items:any[], index:number):any[]; - removeItem(item:any, destroying:any):void; - moveItem(item:any, newIndex:number):void; - moveItemToPane(item:any, pane:IPane, index:number):void; - destroyActiveItem():boolean; // always return false - destroyItem(item:any):boolean; - destroyItems():any[]; - destroyInactiveItems():any[]; - destroy():void; - destroyed():any[]; - promptToSaveItem(item:any):boolean; - saveActiveItem():void; - saveActiveItemAs():void; - saveItem(item:any, nextAction:Function):void; - saveItemAs(item:any, nextAction:Function):void; - saveItems():any[]; - activateItemForURI(uri:any):any; - copyActiveItem():void; - splitLeft(params:any):IPane; - splitRight(params:any):IPane; - splitUp(params:any):IPane; - splitDown(params:any):IPane; - split(orientation:string, side:string, params:any):IPane; - findLeftmostSibling():IPane; - findOrCreateRightmostSibling():IPane; - } + /** Moves the cursor to the end of the buffer line. */ + moveToEndOfLine(): void; - // https://atom.io/docs/v0.84.0/advanced/serialization - interface ISerializationStatic { - deserialize(data:ISerializationInfo):T; - new (data:T): ISerialization; - } + /** Moves the cursor to the beginning of the word. */ + moveToBeginningOfWord(): void; - interface ISerialization { - serialize():ISerializationInfo; - } + /** Moves the cursor to the end of the word. */ + moveToEndOfWord(): void; - interface ISerializationInfo { - deserializer: string; - } + /** Moves the cursor to the beginning of the next word. */ + moveToBeginningOfNextWord(): void; - interface IBrowserWindow { - getPosition():number[]; - getSize():number[]; - } + /** Moves the cursor to the previous word boundary. */ + moveToPreviousWordBoundary(): void; - interface IAtomWindowDimentions { - x:number; - y:number; - width:number; - height:number; - } + /** Moves the cursor to the next word boundary. */ + moveToNextWordBoundary(): void; - interface IProjectStatic { - pathForRepositoryUrl(repoUrl:string):string; + /** Moves the cursor to the previous subword boundary. */ + moveToPreviousSubwordBoundary(): void; - new (arg?:{path:any; buffers:any[];}):IProject; - } + /** Moves the cursor to the next subword boundary. */ + moveToNextSubwordBoundary(): void; - interface IProject /* extends Theorist.Model */ { - // Serializable.includeInto(Project); - - path:string; - /** deprecated */ - rootDirectory?:PathWatcher.IDirectory; - rootDirectories:PathWatcher.IDirectory[]; - - serializeParams():any; - deserializeParams(params:any):any; - destroyed():any; - destroyRepo():any; - destroyUnretainedBuffers():any; - getRepo():IGit; - getPath():string; - setPath(projectPath:string):any; - getRootDirectory():PathWatcher.IDirectory; - resolve(uri:string):string; - relativize(fullPath:string):string; - contains(pathToCheck:string):boolean; - open(filePath:string, options?:any):Q.Promise; - openSync(filePath:string, options?:any):IEditor; - getBuffers():TextBuffer.ITextBuffer; - isPathModified(filePath:string):boolean; - findBufferForPath(filePath:string):TextBuffer.ITextBuffer; - bufferForPathSync(filePath:string):TextBuffer.ITextBuffer; - bufferForPath(filePath:string):Q.Promise; - bufferForId(id:any):TextBuffer.ITextBuffer; - buildBufferSync(absoluteFilePath:string):TextBuffer.ITextBuffer; - buildBuffer(absoluteFilePath:string):Q.Promise; - addBuffer(buffer:TextBuffer.ITextBuffer, options?:any):any; - addBufferAtIndex(buffer:TextBuffer.ITextBuffer, index:number, options?:any):any; - scan(regex:any, options:any, iterator:any):Q.Promise; - replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise; - buildEditorForBuffer(buffer:any, editorOptions:any):IEditor; - eachBuffer(...args:any[]):any; - - onDidChangePaths(callback: Function): Disposable; - } + /** Moves the cursor to the beginning of the buffer line, skipping all whitespace. */ + skipLeadingWhitespace(): void; - interface IWorkspaceStatic { - new():IWorkspace; - } + /** Moves the cursor to the beginning of the next paragraph. */ + moveToBeginningOfNextParagraph(): void; - interface IWorkspacePanelOptions{ - item:any; - visible?:boolean; - priority?:number; - } + /** Moves the cursor to the beginning of the previous paragraph. */ + moveToBeginningOfPreviousParagraph(): void; - interface Panel{ - getItem():any; - getPriority():any; - isVisible():boolean; - show():void; - hide():void; - } + // Local Positions and Ranges + /** Returns buffer position of previous word boundary. It might be on the current + * word, or the previous word. + */ + getPreviousWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): + TextBuffer.Point; - interface IWorkspace { - addBottomPanel(options:IWorkspacePanelOptions):Panel; - addLeftPanel(options:IWorkspacePanelOptions):Panel; - addRightPanel(options:IWorkspacePanelOptions):Panel; - addTopPanel(options:IWorkspacePanelOptions):Panel; - addModalPanel(options:IWorkspacePanelOptions):Panel; - addOpener(opener: Function): any; - - deserializeParams(params:any):any; - serializeParams():{paneContainer:any;fullScreen:boolean;}; - eachEditor(callback: Function): void; - getTextEditors():IEditor[]; - open(uri:string, options:any):Q.Promise; - openLicense():void; - openSync(uri:string, options:any):any; - openUriInPane(uri: string, pane: any, options: any): Q.Promise; - observeTextEditors(callback: Function): Disposable; - reopenItemSync():any; - registerOpener(opener:(urlToOpen:string)=>any):void; - unregisterOpener(opener:Function):void; - getOpeners():any; - getActivePane(): IPane; - getActivePaneItem(): IPane; - getActiveTextEditor(): IEditor; - getPanes():any; - saveAll():void; - activateNextPane():any; - activatePreviousPane():any; - paneForURI: (uri:string) => IPane; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - destroyActivePaneItem():any; - destroyActivePane():any; - getActiveEditor():IEditor; - increaseFontSize():void; - decreaseFontSize():void; - resetFontSize():void; - itemOpened(item:any):void; - onPaneItemDestroyed(item:any):void; - destroyed():void; - isTextEditor(object: any): boolean; - - onDidChangeActivePaneItem(item:any):Disposable; - } + /** Returns buffer position of the next word boundary. It might be on the current + * word, or the previous word. + */ + getNextWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): + TextBuffer.Point; - interface IAtomSettings { - appVersion: string; - bootstrapScript: string; - devMode: boolean; - initialPath: string; - pathToOpen: string; - resourcePath: string; - shellLoadTime: number; - windowState:string; - } + /** Retrieves the buffer position of where the current word starts. */ + getBeginningOfCurrentWordBufferPosition(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean, + allowPrevious?: boolean + }): TextBuffer.Point; - interface IAtomState { - mode:string; - packageStates:any; - project:any; - syntax:any; - version:number; - windowDimensions:any; - workspace:any; - } + /** Retrieves the buffer position of where the current word ends. */ + getEndOfCurrentWordBufferPosition(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean + }): TextBuffer.Point; - interface IDeserializerManager { - deserializers:Function; - add:Function; - remove:Function; - deserialize:Function; - get:Function; - } + /** Retrieves the buffer position of where the next word starts. */ + getBeginningOfNextWordBufferPosition(options?: { wordRegex?: RegExp }): TextBuffer.Point; - interface IColorlike { - red: number; - green: number; - blue: number; - alpha: number; - } + /** Returns the buffer Range occupied by the word located under the cursor. */ + getCurrentWordBufferRange(options?: { wordRegex?: RegExp }): TextBuffer.Range; - class Color { - public static parse(value:string): Color - public static parse(value:IColorlike): Color - public toHexString(): string - public toRGBAString(): string - } + /** Returns the buffer Range for the current line. */ + getCurrentLineBufferRange(options?: { includeNewline?: boolean }): TextBuffer.Range; - interface IConfigGetOptions { - sources?:Array; - excludeSources?:Array; - scope?:ScopeDescriptor; - } + /** Retrieves the range for the current paragraph. + * A paragraph is defined as a block of text surrounded by empty lines or comments. + */ + getCurrentParagraphBufferRange(): TextBuffer.Range; - interface IConfigSetOptions { - scopeSelector?:string; - source?:string; - } + /** Returns the characters preceding the cursor in the current word. */ + getCurrentWordPrefix(): string; - interface IConfigObserveOptions { - scope?:ScopeDescriptor; - } + // Visibility + /** Sets whether the cursor is visible. */ + setVisible(visible: boolean): void; - interface IConfigChangeEvent { - newValue:T; - oldValue:T; - } + /** Returns the visibility of the cursor. */ + isVisible(): boolean; - type ConfigSetting = string | number | boolean | Color | IConfigArray | IConfigObject + // Comparing to another cursor + /** Compare this cursor's buffer position to another cursor's buffer position. + * See Point::compare for more details. + */ + compare(otherCursor: Cursor): number; - interface IConfigArray extends Array { } + // Utilities + /** Prevents this cursor from causing scrolling. */ + clearAutoscroll(): void; - interface IConfigObject { [key: string]: ConfigSetting } + /** Deselects the current selection. */ + clearSelection(): void; - interface IConfig { - get(keyPath:string, options?:IConfigGetOptions):ConfigSetting; - set(keyPath:string, value:ConfigSetting, options?:IConfigSetOptions):boolean; - unset(keyPath:string, options?:IConfigSetOptions):void; - observe(keyPath:string, options?:IConfigObserveOptions, callback?:(value:ConfigSetting) => void):Disposable; - onDidChange(keyPath?:string, options?:IConfigObserveOptions, callback?:(event:IConfigChangeEvent) => void):Disposable; - } + /** Get the RegExp used by the cursor to determine what a "word" is. */ + wordRegExp(options?: { includeNonWordCharacters?: boolean }): RegExp; + + /** Get the RegExp used by the cursor to determine what a "subword" is. */ + subwordRegExp(options?: { backwards?: boolean }): RegExp; + } - interface IKeymapManager { - defaultTarget:HTMLElement; - // TBD - } + /** Represents a decoration that follows a DisplayMarker. A decoration is basically + * a visual representation of a marker. It allows you to add CSS classes to line + * numbers in the gutter, lines, and add selection-line regions around marked ranges + * of text. + */ + interface Decoration { + id: number; + + // Construction and Destruction + /** Destroy this marker decoration. + * You can also destroy the marker if you own it, which will destroy this decoration. + */ + destroy(): void; + + // Event Subscription + /** When the Decoration is updated via Decoration::setProperties. */ + onDidChangeProperties(callback: (event: Events.DecorationPropsChanged) => void): + EventKit.Disposable; + + /** Invoke the given callback when the Decoration is destroyed. */ + onDidDestroy(callback: () => void): EventKit.Disposable; + + // Decoration Details + /** An id unique across all Decoration objects. */ + getId(): number; + + /** Returns the marker associated with this Decoration. */ + getMarker(): TextBuffer.DisplayMarker; + + // Properties + /** Returns the Decoration's properties. */ + getProperties(): Structures.DecorationProps; + + /** Update the marker with new Properties. Allows you to change the decoration's + * class. + */ + setProperties(newProperties: Structures.DecorationProps): void; + } + + interface Deserializer { + name: string; + deserialize(state: object): object; + } + + /** Manages the deserializers used for serialized state. */ + interface DeserializerManager { + /** Register the given class(es) as deserializers. */ + add(...deserializers: Deserializer[]): EventKit.Disposable; - interface IPackage { - mainModulePath: string; - mainModule: any; - enable(): void; - disable(): void; - isTheme(): boolean; - getType(): string; - getStylesheetType(): string; - load(): IPackage; - reset(): void; - activate(): Q.Promise; - activateNow(): void; - // TBD - } + /** Deserialize the state and params. */ + deserialize(state: object): object|undefined; + } - interface IPackageManager extends Emissary.IEmitter { - packageDirPaths:string[]; - loadedPackages:any; - activePackages:any; - packageStates:any; - packageActivators:any[]; - - getApmPath():string; - getPackageDirPaths():string; - getPackageState(name:string):any; - setPackageState(name:string, state:any):void; - enablePackage(name:string):any; - disablePackage(name:string):any; - activate():void; - registerPackageActivator(activator:any, types:any):void; - activatePackages(packages:any):void; - activatePackage(name:string):Q.Promise; - deactivatePackages():void; - deactivatePackage(name:string):void; - getActivePackages():any; - getActivePackage(name:string):any; - isPackageActive(name:string):boolean; - unobserveDisabledPackages():void; - observeDisabledPackages():void; - loadPackages():void; - loadPackage(nameOrPath:string):void; - unloadPackages():void; - unloadPackage(name:string):void; - getLoadedPackage(name:string):any; - isPackageLoaded(name:string):boolean; - getLoadedPackages():any; - getLoadedPackagesForTypes(types:any):any[]; - resolvePackagePath(name:string):string; - isPackageDisabled(name:string):boolean; - hasAtomEngine(packagePath:string):boolean; - isBundledPackage(name:string):boolean; - getPackageDependencies():any; - getAvailablePackagePaths():any[]; - getAvailablePackageNames():any[]; - getAvailablePackageMetadata():any[]; - } + /** A container at the edges of the editor window capable of holding items. */ + interface Dock { + // Methods + /** Show the dock and focus its active Pane. */ + activate(): void; - interface INotifications { - addInfo: Function; - addError: Function; - addSuccess: Function; - addWarning: Function; - } + /** Show the dock without focusing it. */ + show(): void; - interface IThemeManager { - // TBD - } + /** Hide the dock and activate the WorkspaceCenter if the dock was was previously focused. */ + hide(): void; - interface IContextMenuManager { - // TBD - } + /** Toggle the dock's visibility without changing the Workspace's active pane container. */ + toggle(): void; + + /** Check if the dock is visible. */ + isVisible(): boolean; + + // Event Subscription + /** Invoke the given callback when the visibility of the dock changes. */ + onDidChangeVisible(callback: (visible: boolean) => void): EventKit.Disposable; + + /** Invoke the given callback with the current and all future visibilities of the dock. */ + observeVisible(callback: (visible: boolean) => void): EventKit.Disposable; + + /** Invoke the given callback with all current and future panes items in the dock. */ + observePaneItems(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane item changes. + * + * Because observers are invoked synchronously, it's important not to perform any expensive + * operations via this method. Consider ::onDidStopChangingActivePaneItem to delay operations + * until after changes stop occurring. + */ + onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - interface IMenuManager { - // TBD - } + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - interface IClipboard { - write(text:string, metadata?:any):any; - read():string; - } + /** Invoke the given callback with the current active pane item and with all future + * active pane items in the dock. + */ + observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - interface ISyntax { - // TBD - } + /** Invoke the given callback when a pane is added to the dock. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - interface IWindowEventHandler { - // TBD - } + /** Invoke the given callback before a pane is destroyed in the dock. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - interface IAtomStatic extends ISerializationStatic { - version: number; - loadSettings: IAtomSettings; - - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'editor'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'spec'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:string):IAtom; - - loadState(mode:any):void; - getStatePath(mode:any):string; - getConfigDirPath():string; - getStorageDirPath():string; - getLoadSettings():IAtomSettings; - getCurrentWindow():IBrowserWindow; - getVersion():string; - isReleasedVersion():boolean; - - new(state:IAtomState):IAtom; - } + /** Invoke the given callback when a pane is destroyed in the dock. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - class Disposable { - constructor(disposalAction:any) - static isDisposable(object: any): boolean - dispose():void - } + /** Invoke the given callback with all current and future panes in the dock. */ + observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - class CompositeDisposable { - constructor(... disposables: Array) - clear():void - dispose():void - add(... disposables: Array): void - remove(disposable: Disposable): void - delete(disposable: Disposable): void - } + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - // https://atom.io/docs/api/v0.106.0/api/classes/Atom.html - /* Global Atom class : instance members */ - interface IAtom { - constructor:IAtomStatic; - - state:IAtomState; - mode:string; - deserializers:IDeserializerManager; - config: IConfig; - commands: ICommandRegistry; - grammars: IGrammars; - keymaps: IKeymapManager; - keymap: IKeymapManager; - packages: IPackageManager; - themes: IThemeManager; - contextManu: IContextMenuManager; - menu: IMenuManager; - notifications: INotifications; // https://github.com/atom/notifications - clipboard:IClipboard; - syntax:ISyntax; - views: IViewRegistry; - windowEventHandler: IWindowEventHandler; - - // really exists? start - subscribe:Function; - unsubscribe:Function; - loadTime:number; - workspaceViewParentSelector:string; - - project: IProject; - workspaceView: IWorkspaceView; - workspace: IWorkspace; - // really exists? end - - initialize:Function; - // registerRepresentationClass:Function; - // registerRepresentationClasses:Function; - setBodyPlatformClass:Function; - getCurrentWindow():IBrowserWindow; - getWindowDimensions:Function; - setWindowDimensions:Function; - restoreWindowDimensions:Function; - storeWindowDimensions:Function; - getLoadSettings:Function; - deserializeProject: Function; - deserializeWorkspaceView:Function; - deserializePackageStates:Function; - deserializeEditorWindow:Function; - startEditorWindow:Function; - unloadEditorWindow:Function; - loadThemes:Function; - watchThemes:Function; - open:Function; - confirm:Function; - showSaveDialog:Function; - showSaveDialogSync:Function; - openDevTools:Function; - toggleDevTools:Function; - executeJavaScriptInDevTools:Function; - reload:Function; - focus:Function; - show:Function; - hide:Function; - setSize:Function; - setPosition:Function; - center:Function; - displayWindow:Function; - close:Function; - exit:Function; - inDevMode:Function; - inSpecMode:Function; - toggleFullScreen:Function; - setFullScreen:Function; - isFullScreen:Function; - getVersion:Function; - isReleasedVersion:Function; - getGitHubAuthTokenName:Function; - setGitHubAuthToken:Function; - getGitHubAuthToken:Function; - getConfigDirPath:Function; - saveSync:Function; - getWindowLoadTime():number; - crashMainProcess:Function; - crashRenderProcess:Function; - beep:Function; - getUserInitScriptPath:Function; - requireUserInitScript:Function; - requireWithGlobals:Function; - - services: any; // TODO: New services api - } + /** Invoke the given callback with the current active pane and when the active pane changes. */ + observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - interface IBufferedNodeProcessStatic { - new (arg:any):IBufferedNodeProcess; - } + /** Invoke the given callback when a pane item is added to the dock. */ + onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; - interface IBufferedNodeProcess extends IBufferedProcess { - } + /** Invoke the given callback when a pane item is about to be destroyed, before the user is + * prompted to save it. + */ + onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; - interface IBufferedProcessStatic { - new (arg:any):IBufferedProcess; - } + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; - interface IBufferedProcess { - process:Function; - killed:boolean; + // Pane Items + /** Get all pane items in the dock. */ + getPaneItems(): object[]; - bufferStream:Function; - kill:Function; - } + /** Get the active Pane's active item. */ + getActivePaneItem(): object; - interface IGitStatic { - new(path:any, options:any):IGit; - } + // Panes + /** Returns an Array of Panes. */ + getPanes(): Pane[]; - interface IGit { - } + /** Get the active Pane. */ + getActivePane(): Pane; - interface ITokenizedBuffer { - // TBD - } + /** Make the next pane active. */ + activateNextPane(): boolean; - interface ITokenizedLine { - // TBD - } + /** Make the previous pane active. */ + activatePreviousPane(): boolean; + } - interface IToken { - // TBD - } + /** Represents the underlying git operations performed by Atom. */ + interface GitRepository { + // Lifecycle + /** Destroy this GitRepository object. */ + destroy(): void; - interface IFoldStatic { - new (displayBuffer:IDisplayBuffer, marker:IMarker):IFold; - // TBD - } + /** Returns a boolean indicating if this repository has been destroyed. */ + isDestroyed(): boolean; - interface IFold { - id:number; - displayBuffer:IDisplayBuffer; - marker:IMarker; + // Event Subscription + /** Invoke the given callback when this GitRepository's destroy() method is + * invoked. + */ + onDidDestroy(callback: () => void): EventKit.Disposable; - // TBD - } + /** Invoke the given callback when a specific file's status has changed. When + * a file is updated, reloaded, etc, and the status changes, this will be fired. + */ + onDidChangeStatus(callback: (event: Events.RepoStatusChanged) => void): + EventKit.Disposable; - interface IDisplayBufferMarkerStatic { - new (_arg:{bufferMarker:IMarker; displayBuffer: IDisplayBuffer}):IDisplayBufferMarker; - } + /** Invoke the given callback when a multiple files' statuses have changed. */ + onDidChangeStatuses(callback: () => void): EventKit.Disposable; - interface IDisplayBufferMarker extends Emissary.IEmitter, Emissary.ISubscriber { - constructor:IDisplayBufferMarkerStatic; - - id: number; - - bufferMarkerSubscription:any; - oldHeadBufferPosition:TextBuffer.IPoint; - oldHeadScreenPosition:TextBuffer.IPoint; - oldTailBufferPosition:TextBuffer.IPoint; - oldTailScreenPosition:TextBuffer.IPoint; - wasValid:boolean; - - bufferMarker: IMarker; - displayBuffer: IDisplayBuffer; - globalPauseCount:number; - globalQueuedEvents:any; - - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // WeakMap - - copy(attributes?:any /* maybe IMarker */):IDisplayBufferMarker; - getScreenRange():TextBuffer.IRange; - setScreenRange(screenRange:any, options:any):any; - getBufferRange():TextBuffer.IRange; - setBufferRange(bufferRange:any, options:any):any; - getPixelRange():any; - getHeadScreenPosition():TextBuffer.IPoint; - setHeadScreenPosition(screenPosition:any, options:any):any; - getHeadBufferPosition():TextBuffer.IPoint; - setHeadBufferPosition(bufferPosition:any):any; - getTailScreenPosition():TextBuffer.IPoint; - setTailScreenPosition(screenPosition:any, options:any):any; - getTailBufferPosition():TextBuffer.IPoint; - setTailBufferPosition(bufferPosition:any):any; - plantTail():boolean; - clearTail():boolean; - hasTail():boolean; - isReversed():boolean; - isValid():boolean; - isDestroyed():boolean; - getAttributes():any; - setAttributes(attributes:any):any; - matchesAttributes(attributes:any):any; - destroy():any; - isEqual(other:IDisplayBufferMarker):boolean; - compare(other:IDisplayBufferMarker):boolean; - inspect():string; - destroyed():any; - notifyObservers(_arg:any):any; - } + // Repository Details + /** A string indicating the type of version control system used by this repository. */ + getType(): "git"; - interface ITransaction { - // TBD - } + /** Returns the string path of the repository. */ + getPath(): string; - interface IMarker extends Emissary.IEmitter { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); + /** Returns the string working directory path of the repository. */ + getWorkingDirectory(): string; - // TBD - } + /** Returns true if at the root, false if in a subfolder of the repository. */ + isProjectAtRoot(): boolean; - interface ITaskStatic { - new(taskPath:any):ITask; - } + /** Makes a path relative to the repository's working directory. */ + relativize(): string; + + /** Returns true if the given branch exists. */ + hasBranch(branch: string): boolean; + + /** Retrieves a shortened version of the HEAD reference value. */ + getShortHead(path?: string): string; + + /** Is the given path a submodule in the repository? */ + isSubmodule(path: string): boolean; + + /** Returns the number of commits behind the current branch is from the its + * upstream remote branch. The default reference is the HEAD. + * @param reference The branch reference name. + * @param path The path in the repository to get this ifnromation for, only + * needed if the repository contains submodules. + * @return Returns the number of commits behind the current branch is from its + * upstream remote branch. + */ + getAheadBehindCount(reference: string, path?: string): { ahead: number, behind: number }; + + /** Get the cached ahead/behind commit counts for the current branch's + * upstream branch. + */ + getCachedUpstreamAheadBehindCount(path?: string): { ahead: number, behind: number }; + + /** Returns the git configuration value specified by the key. */ + getConfigValue(key: string, path?: string): string; + + /** Returns the origin url of the repository. */ + getOriginURL(path?: string): string; + + /** Returns the upstream branch for the current HEAD, or null if there is no + * upstream branch for the current HEAD. + */ + getUpstreamBranch(path?: string): string|null; + + /** Gets all the local and remote references. */ + getReferences(path?: string): { heads: string[], remotes: string[], tags: string[] }; + + /** Returns the current string SHA for the given reference. */ + getReferenceTarget(reference: string, path?: string): string; + + // Reading Status + /** Returns true if the given path is modified. */ + isPathModified(path: string): boolean; + + /** Returns true if the given path is new. */ + isPathNew(path: string): boolean; + + /** Is the given path ignored? */ + isPathIgnored(path: string): boolean; + + /** Get the status of a directory in the repository's working directory. */ + getDirectoryStatus(path: string): number; + + /** Get the status of a single path in the repository. */ + getPathStatus(path: string): number; + + /** Get the cached status for the given path. */ + getCachedPathStatus(path: string): number|null; + + /** Returns true if the given status indicates modification. */ + isStatusModified(status: number): boolean; + + /** Returns true if the given status indicates a new path. */ + isStatusNew(status: number): boolean; + + // Retrieving Diffs + /** Retrieves the number of lines added and removed to a path. + * This compares the working directory contents of the path to the HEAD version. + */ + getDiffStats(path: string): { added: number, deleted: number }; + + /** Retrieves the line diffs comparing the HEAD version of the given path + * and the given text. + */ + getLineDiffs(path: string, text: string): Array<{ oldStart: number, + newStart: number, oldLines: number, newLines: number }>; + + // Checking Out + /** Restore the contents of a path in the working directory and index to the + * version at HEAD. + */ + checkoutHead(path: string): boolean; + + /** Checks out a branch in your repository. */ + checkoutReference(reference: string, create: boolean): boolean; + } + + /** Represents a gutter within a TextEditor. */ + interface Gutter { + // Gutter Destruction + /** Destroys the gutter. */ + destroy(): void; + + // Event Subscription + /** Calls your callback when the gutter's visibility changes. */ + onDidChangeVisible(callback: (gutter: Gutter) => void): EventKit.Disposable; + + /** Calls your callback when the gutter is destroyed. */ + onDidDestroy(callback: () => void): EventKit.Disposable; + + // Visibility + /** Hide the gutter. */ + hide(): void; + + /** Show the gutter. */ + show(): void; + + /** Determine whether the gutter is visible. */ + isVisible(): boolean; + + /** Add a decoration that tracks a DisplayMarker. When the marker moves, is + * invalidated, or is destroyed, the decoration will be updated to reflect + * the marker's state. + */ + decorateMarker(marker: TextBuffer.DisplayMarker, decorationParams: + Structures.DecorationProps): Decoration; + } + + /** History manager for remembering which projects have been opened. + * An instance of this class is always available as the atom.history global. + * The project history is used to enable the 'Reopen Project' menu. + */ + interface HistoryManager { + /** Obtain a list of previously opened projects. */ + getProjects(): HistoryProject[]; + + /** Clear all projects from the history. + * Note: This is not a privacy function - other traces will still exist, e.g. + * window state. + */ + clearProjects(): void; + + /** Invoke the given callback when the list of projects changes. */ + onDidChangeProjects(callback: (args: { reloaded: boolean }) => void): EventKit.Disposable; + } + + interface HistoryProject { + paths: string[]; + lastOpened: Date; + } + + /** Represents a decoration that applies to every marker on a given layer. Created via + * TextEditor::decorateMarkerLayer. + */ + interface LayerDecoration { + /** Destroys the decoration. */ + destroy(): void; + + /** Determine whether this decoration is destroyed. */ + isDestroyed(): boolean; + + /** Get this decoration's properties. */ + getProperties(): Structures.DecorationLayerProps; + + /** Set this decoration's properties. */ + setProperties(newProperties: Structures.DecorationLayerProps): void; + + /** Override the decoration properties for a specific marker. */ + setPropertiesForMarker(marker: TextBuffer.DisplayMarker|TextBuffer.Marker, + properties: Structures.DecorationLayerProps): void; + } + + /** Provides a registry for menu items that you'd like to appear in the application menu. */ + interface MenuManager { + /** Adds the given items to the application menu. */ + add(items: ReadonlyArray): EventKit.Disposable; + + /** Refreshes the currently visible menu. */ + update(): void; + } + + /** A notification to the user containing a message and type. */ + interface Notification { + // Properties + dismissed: boolean; + displayed: boolean; + timestamp: Date; + + // Event Subscription + /** Invoke the given callback when the notification is dismissed. */ + onDidDismiss(callback: (notification: Notification) => void): EventKit.Disposable; + + /** Invoke the given callback when the notification is displayed. */ + onDidDisplay(callback: (notification: Notification) => void): EventKit.Disposable; + + // Methods + /** Returns the Notification's type. */ + getType(): string; + + /** Returns the Notification's message. */ + getMessage(): string; + + /** Dismisses the notification, removing it from the UI. Calling this + * programmatically will call all callbacks added via onDidDismiss. + */ + dismiss(): void; + } + + /** A notification manager used to create Notifications to be shown to the user. */ + interface NotificationManager { + // Properties + notifications: Notification[]; + + // Events + /** Invoke the given callback after a notification has been added. */ + onDidAddNotification(callback: (notification: Notification) => void): + EventKit.Disposable; + + // Adding Notifications + /** Add a success notification. */ + addSuccess(message: string, options?: Options.Notification): Notification; + + /** Add an informational notification. */ + addInfo(message: string, options?: Options.Notification): Notification; + + /** Add a warning notification. */ + addWarning(message: string, options?: Options.Notification): Notification; + + /** Add an error notification. */ + addError(message: string, options?: Options.ErrorNotification): Notification; + + /** Add a fatal error notification. */ + addFatalError(message: string, options?: Options.ErrorNotification): Notification; + + // Getting Notifications + /** Get all the notifications. */ + getNotifications(): Notification[]; + } + + /** Loads and activates a package's main module and resources such as stylesheets, + * keymaps, grammar, editor properties, and menus. + */ + interface Package { + // Properties + name: string; + bundledPackage: boolean; + path: string; + + // Event Subscription + /** Invoke the given callback when all packages have been activated. */ + onDidDeactivate(callback: () => void): EventKit.Disposable; + + // Native Module Compatibility + /** Are all native modules depended on by this package correctly compiled + * against the current version of Atom? + */ + isCompatible(): boolean; + + /** Rebuild native modules in this package's dependencies for the current + * version of Atom. + */ + rebuild(): Promise<{ code: number, stdout: string, stderr: string }>; + + /** If a previous rebuild failed, get the contents of stderr. */ + getBuildFailureOutput(): string|null; + } + + /** Package manager for coordinating the lifecycle of Atom packages. */ + interface PackageManager { + // Event Subscription + /** Invoke the given callback when all packages have been loaded. */ + onDidLoadInitialPackages(callback: () => void): EventKit.Disposable; + + /** Invoke the given callback when all packages have been activated. */ + onDidActivateInitialPackages(callback: () => void): EventKit.Disposable; + + /** Invoke the given callback when a package is activated. */ + onDidActivatePackage(callback: (package: Package) => void): EventKit.Disposable; + + /** Invoke the given callback when a package is deactivated. */ + onDidDeactivatePackage(callback: (package: Package) => void): EventKit.Disposable; + + /** Invoke the given callback when a package is loaded. */ + onDidLoadPackage(callback: (package: Package) => void): EventKit.Disposable; + + /** Invoke the given callback when a package is unloaded. */ + onDidUnloadPackage(callback: (package: Package) => void): EventKit.Disposable; + + // Package System Data + /** Get the path to the apm command. */ + getApmPath(): string; + + /** Get the paths being used to look for packages. */ + getPackageDirPaths(): string[]; + + // General Package Data + /** Resolve the given package name to a path on disk. */ + resolvePackagePath(name: string): string|undefined; + + /** Is the package with the given name bundled with Atom? */ + isBundledPackage(name: string): boolean; + + // Enabling and Disabling Packages + /** Enable the package with the given name. */ + enablePackage(name: string): Package|undefined; + + /** Disable the package with the given name. */ + disablePackage(name: string): Package|undefined; + + /** Is the package with the given name disabled? */ + isPackageDisabled(name: string): boolean; + + // Accessing Active Packages + /** Get an Array of all the active Packages. */ + getActivePackages(): Package[]; + + /** Get the active Package with the given name. */ + getActivePackage(name: string): Package|undefined; + + /** Is the Package with the given name active? */ + isPackageActive(name: string): boolean; + + /** Returns a boolean indicating whether package activation has occurred. */ + hasActivatedInitialPackages(): boolean; + + // Accessing Loaded Packages + /** Get an Array of all the loaded Packages. */ + getLoadedPackages(): Package[]; + + /** Get the loaded Package with the given name. */ + getLoadedPackage(name: string): Package|undefined; + + /** Is the package with the given name loaded? */ + isPackageLoaded(name: string): boolean; + + /** Returns a boolean indicating whether package loading has occurred. */ + hasLoadedInitialPackages(): boolean; + + // Accessing Available Packages + /** Returns an Array of strings of all the available package paths. */ + getAvailablePackagePaths(): string[]; + + /** Returns an Array of strings of all the available package names. */ + getAvailablePackageNames(): string[]; + + /** Returns an Array of strings of all the available package metadata. */ + getAvailablePackageMetadata(): string[]; + } + + /** A container for presenting content in the center of the workspace. */ + interface Pane { + // Event Subscription + /** Invoke the given callback when the pane resizes. */ + onDidChangeFlexScale(callback: (flexScale: number) => void): EventKit.Disposable; + + /** Invoke the given callback with the current and future values of ::getFlexScale. */ + observeFlexScale(callback: (flexScale: number) => void): EventKit.Disposable; + + /** Invoke the given callback when the pane is activated. */ + onDidActivate(callback: () => void): EventKit.Disposable; + + /** Invoke the given callback before the pane is destroyed. */ + onWillDestroy(callback: () => void): EventKit.Disposable; - interface ITask { - // TBD + /** Invoke the given callback when the pane is destroyed. */ + onDidDestroy(callback: () => void): EventKit.Disposable; + + /** Invoke the given callback when the value of the ::isActive property changes. */ + onDidChangeActive(callback: (active: boolean) => void): EventKit.Disposable; + + /** Invoke the given callback with the current and future values of the ::isActive + * property. + */ + observeActive(callback: (active: boolean) => void): EventKit.Disposable; + + /** Invoke the given callback when an item is added to the pane. */ + onDidAddItem(callback: (event: Events.PaneListItemShifted) => void): + EventKit.Disposable; + + /** Invoke the given callback when an item is removed from the pane. */ + onDidRemoveItem(callback: (event: Events.PaneListItemShifted) => void): + EventKit.Disposable; + + /** Invoke the given callback before an item is removed from the pane. */ + onWillRemoveItem(callback: (event: Events.PaneListItemShifted) => void): + EventKit.Disposable; + + /** Invoke the given callback when an item is moved within the pane. */ + onDidMoveItem(callback: (event: Events.PaneItemMoved) => void): + EventKit.Disposable; + + /** Invoke the given callback with all current and future items. */ + observeItems(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when the value of ::getActiveItem changes. */ + onDidChangeActiveItem(callback: (activeItem: object) => void): EventKit.Disposable; + + /** Invoke the given callback when ::activateNextRecentlyUsedItem has been called, + * either initiating or continuing a forward MRU traversal of pane items. + */ + onChooseNextMRUItem(callback: (nextRecentlyUsedItem: object) => void): EventKit.Disposable; + + /** Invoke the given callback when ::activatePreviousRecentlyUsedItem has been called, + * either initiating or continuing a reverse MRU traversal of pane items. + */ + onChooseLastMRUItem(callback: (previousRecentlyUsedItem: object) => void): + EventKit.Disposable; + + /** Invoke the given callback when ::moveActiveItemToTopOfStack has been called, + * terminating an MRU traversal of pane items and moving the current active item + * to the top of the stack. Typically bound to a modifier (e.g. CTRL) key up event. + */ + onDoneChoosingMRUItem(callback: () => void): EventKit.Disposable; + + /** Invoke the given callback with the current and future values of ::getActiveItem. */ + observeActiveItem(callback: (activeItem: object) => void): EventKit.Disposable; + + /** Invoke the given callback before items are destroyed. */ + onWillDestroyItem(callback: (event: Events.PaneListItemShifted) => void): + EventKit.Disposable; + + // Items + /** Get the items in this pane. */ + getItems(): object[]; + + /** Get the active pane item in this pane. */ + getActiveItem(): object; + + /** Return the item at the given index. */ + itemAtIndex(index: number): object|undefined; + + /** Makes the next item active. */ + activateNextItem(): void; + + /** Makes the previous item active. */ + activatePreviousItem(): void; + + /** Move the active tab to the right. */ + moveItemRight(): void; + + /** Move the active tab to the left. */ + moveItemLeft(): void; + + /** Get the index of the active item. */ + getActiveItemIndex(): number; + + /** Activate the item at the given index. */ + activateItemAtIndex(index: number): void; + + /** Make the given item active, causing it to be displayed by the pane's view. */ + activateItem(item: object, options?: { pending: boolean }): void; + + /** Add the given item to the pane. */ + addItem(item: object, options?: { index?: number, pending?: boolean }): object; + + /** Add the given items to the pane. */ + addItems(items: object[], index?: number): object[]; + + /** Move the given item to the given index. */ + moveItem(item: object, index: number): void; + + /** Move the given item to the given index on another pane. */ + moveItemToPane(item: object, pane: Pane, index: number): void; + + /** Destroy the active item and activate the next item. */ + destroyActiveItem(): void; + + /** Destroy the given item. */ + destroyItem(item: object, force?: boolean): Promise; + + /** Destroy all items. */ + destroyItems(): void; + + /** Destroy all items except for the active item. */ + destroyInactiveItems(): void; + + /** Save the active item. */ + saveActiveItem(nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Prompt the user for a location and save the active item with the path + * they select. + */ + saveActiveItemAs(nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Save the given item. */ + saveItem(item: object, nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Prompt the user for a location and save the active item with the path + * they select. + */ + saveItemAs(item: object, nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Save all items. */ + saveItems(): void; + + /** Return the first item that matches the given URI or undefined if none exists. */ + itemForURI(uri: string): object|undefined; + + /** Activate the first item that matches the given URI. */ + activateItemForURI(uri: string): boolean; + + // Lifecycle + /** Determine whether the pane is active. */ + isActive(): boolean; + + /** Makes this pane the active pane, causing it to gain focus. */ + activate(): void; + + /** Close the pane and destroy all its items. */ + destroy(): void; + + /** Determine whether this pane has been destroyed. */ + isDestroyed(): boolean; + + // Splitting + /** Create a new pane to the left of this pane. */ + splitLeft(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Create a new pane to the right of this pane. */ + splitRight(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Creates a new pane above the receiver. */ + splitUp(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Creates a new pane below the receiver. */ + splitDown(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + } + + /** A container representing a panel on the edges of the editor window. You + * should not create a Panel directly, instead use Workspace::addTopPanel and + * friends to add panels. + */ + interface Panel { + visible: boolean; + + // Construction and Destruction + /** Destroy and remove this panel from the UI. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when the pane hidden or shown. */ + onDidChangeVisible(callback: (visible: boolean) => void): EventKit.Disposable; + + /** Invoke the given callback when the pane is destroyed. */ + onDidDestroy(callback: (panel: Panel) => void): EventKit.Disposable; + + // Panel Details + /** Returns the panel's item. */ + getItem(): object; + + /** Returns a number indicating this panel's priority. */ + getPriority(): number; + + /** Returns a boolean true when the panel is visible. */ + isVisible(): boolean; + + /** Hide this panel. */ + hide(): void; + + /** Show this panel. */ + show(): void; + } + + /** Manage a subscription to filesystem events that occur beneath a root directory. */ + interface PathWatcher extends EventKit.DisposableLike { + /** Return a Promise that will resolve when the underlying native watcher is + * ready to begin sending events. + */ + getStartPromise(): Promise; + + /** Invokes a function when any errors related to this watcher are reported. */ + onDidError(callback: (error: Error) => void): EventKit.Disposable; + + /** Unsubscribe all subscribers from filesystem events. Native resources will be + * release asynchronously, but this watcher will stop broadcasting events + * immediately. + */ + dispose(): void; + } + + /** Represents a project that's opened in Atom. */ + interface Project { + // Event Subscription + /** Invoke the given callback when the project paths change. */ + onDidChangePaths(callback: (projectPaths: string[]) => void): EventKit.Disposable; + + /** Invoke the given callback when a text buffer is added to the project. */ + onDidAddBuffer(callback: (buffer: TextBuffer.TextBuffer) => void): EventKit.Disposable; + + /** Invoke the given callback with all current and future text buffers in + * the project. + */ + observeBuffers(callback: (buffer: TextBuffer.TextBuffer) => void): EventKit.Disposable; + + /** Invoke a callback when a filesystem change occurs within any open project path. */ + onDidChangeFiles(callback: (events: Events.FilesystemChange) => void): EventKit.Disposable; + + // Accessing the Git Repository + /** Get an Array of GitRepositorys associated with the project's directories. */ + getRepositories(): GitRepository[]; + + /** Get the repository for a given directory asynchronously. */ + repositoryForDirectory(directory: PathWatcher.Directory): Promise; + + // Managing Paths + /** Get an Array of strings containing the paths of the project's directories. */ + getPaths(): string[]; + + /** Set the paths of the project's directories. */ + setPaths(projectPaths: string[]): void; + + /** Add a path to the project's list of root paths. */ + addPath(projectPath: string): void; + + /** Access a promise that resolves when the filesystem watcher associated with a + * project root directory is ready to begin receiving events. + */ + getWatcherPromise(projectPath: string): Promise; + + /** Remove a path from the project's list of root paths. */ + removePath(projectPath: string): void; + + /** Get an Array of Directorys associated with this project. */ + getDirectories(): PathWatcher.Directory[]; + + /** Get the relative path from the project directory to the given path. */ + relativize(fullPath: string): string; + + /** Get the path to the project directory that contains the given path, and + * the relative path from that project directory to the given path. + */ + relativizePath(fullPath: string): [string|null, string]; + + /** Determines whether the given path (real or symbolic) is inside the + * project's directory. + */ + contains(pathToCheck: string): boolean; + } + + /** Wraps an Array of Strings. The Array describes a path from the root of the + * syntax tree to a token including all scope names for the entire path. + */ + interface ScopeDescriptor { + scopes: string[]; + + /** Returns all scopes for this descriptor. */ + getScopesArray(): string[]; + } + + /** Represents a selection in the TextEditor. */ + interface Selection { + // Event Subscription + /** Calls your callback when the selection was moved. */ + onDidChangeRange(callback: (event: Events.SelectionChanged) => void): + EventKit.Disposable; + + /** Calls your callback when the selection was destroyed. */ + onDidDestroy(callback: () => void): EventKit.Disposable; + + // Managing the selection range + /** Returns the screen Range for the selection. */ + getScreenRange(): TextBuffer.Range; + + /** Modifies the screen range for the selection. */ + setScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], options?: + { preserveFolds?: boolean, autoscroll?: boolean }): void; + + /** Returns the buffer Range for the selection. */ + getBufferRange(): TextBuffer.Range; + + /** Modifies the buffer Range for the selection. */ + setBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], options?: + { preserveFolds?: boolean, autoscroll?: boolean }): void; + + /** Returns the starting and ending buffer rows the selection is highlighting. */ + getBufferRowRange(): [number, number]; + + // Info about the selection + /** Determines if the selection contains anything. */ + isEmpty(): boolean; + + /** Determines if the ending position of a marker is greater than the starting position. + * This can happen when, for example, you highlight text "up" in a TextBuffer. + */ + isReversed(): boolean; + + /** Returns whether the selection is a single line or not. */ + isSingleScreenLine(): boolean; + + /** Returns the text in the selection. */ + getText(): string; + + // NOTE: this calls into Range.intersectsWith(), which is one of the few functions + // that doesn't take a range-compatible range, despite what the API says. + /** Identifies if a selection intersects with a given buffer range. */ + intersectsBufferRange(bufferRange: TextBuffer.RangeLike): boolean; + + /** Identifies if a selection intersects with another selection. */ + intersectsWith(otherSelection: Selection): boolean; + + // Modifying the selected range + /** Clears the selection, moving the marker to the head. */ + clear(options?: { autoscroll?: boolean }): void; + + /** Selects the text from the current cursor position to a given screen position. */ + selectToScreenPosition(position: TextBuffer.PointLike|[number, number]): void; + + /** Selects the text from the current cursor position to a given buffer position. */ + selectToBufferPosition(position: TextBuffer.PointLike|[number, number]): void; + + /** Selects the text one position right of the cursor. */ + selectRight(columnCount?: number): void; + + /** Selects the text one position left of the cursor. */ + selectLeft(columnCount?: number): void; + + /** Selects all the text one position above the cursor. */ + selectUp(rowCount?: number): void; + + /** Selects all the text one position below the cursor. */ + selectDown(rowCount?: number): void; + + /** Selects all the text from the current cursor position to the top of the + * buffer. + */ + selectToTop(): void; + + /** Selects all the text from the current cursor position to the bottom of + * the buffer. + */ + selectToBottom(): void; + + /** Selects all the text in the buffer. */ + selectAll(): void; + + /** Selects all the text from the current cursor position to the beginning of + * the line. + */ + selectToBeginningOfLine(): void; + + /** Selects all the text from the current cursor position to the first character + * of the line. + */ + selectToFirstCharacterOfLine(): void; + + /** Selects all the text from the current cursor position to the end of the + * screen line. + */ + selectToEndOfLine(): void; + + /** Selects all the text from the current cursor position to the end of the + * buffer line. + */ + selectToEndOfBufferLine(): void; + + /** Selects all the text from the current cursor position to the beginning + * of the word. + */ + selectToBeginningOfWord(): void; + + /** Selects all the text from the current cursor position to the end of the word. */ + selectToEndOfWord(): void; + + /** Selects all the text from the current cursor position to the beginning of + * the next word. + */ + selectToBeginningOfNextWord(): void; + + /** Selects text to the previous word boundary. */ + selectToPreviousWordBoundary(): void; + + /** Selects text to the next word boundary. */ + selectToNextWordBoundary(): void; + + /** Selects text to the previous subword boundary. */ + selectToPreviousSubwordBoundary(): void; + + /** Selects text to the next subword boundary. */ + selectToNextSubwordBoundary(): void; + + /** Selects all the text from the current cursor position to the beginning of + * the next paragraph. + */ + selectToBeginningOfNextParagraph(): void; + + /** Selects all the text from the current cursor position to the beginning of + * the previous paragraph. + */ + selectToBeginningOfPreviousParagraph(): void; + + /** Modifies the selection to encompass the current word. */ + selectWord(): void; + + /** Expands the newest selection to include the entire word on which the + * cursors rests. + */ + expandOverWord(): void; + + /** Selects an entire line in the buffer. */ + selectLine(row: number): void; + + /** Expands the newest selection to include the entire line on which the cursor + * currently rests. + * It also includes the newline character. + */ + expandOverLine(): void; + + // Modifying the selected text + /** Replaces text at the current selection. */ + insertText(text: string, options?: Options.TextInsertion): void; + + /** Removes the first character before the selection if the selection is empty + * otherwise it deletes the selection. + */ + backspace(): void; + + /** Removes the selection or, if nothing is selected, then all characters from + * the start of the selection back to the previous word boundary. + */ + deleteToPreviousWordBoundary(): void; + + /** Removes the selection or, if nothing is selected, then all characters from + * the start of the selection up to the next word boundary. + */ + deleteToNextWordBoundary(): void; + + /** Removes from the start of the selection to the beginning of the current + * word if the selection is empty otherwise it deletes the selection. + */ + deleteToBeginningOfWord(): void; + + /** Removes from the beginning of the line which the selection begins on all + * the way through to the end of the selection. + */ + deleteToBeginningOfLine(): void; + + /** Removes the selection or the next character after the start of the selection + * if the selection is empty. + */ + delete(): void; + + /** If the selection is empty, removes all text from the cursor to the end of + * the line. If the cursor is already at the end of the line, it removes the following + * newline. If the selection isn't empty, only deletes the contents of the selection. + */ + deleteToEndOfLine(): void; + + /** Removes the selection or all characters from the start of the selection to + * the end of the current word if nothing is selected. + */ + deleteToEndOfWord(): void; + + /** Removes the selection or all characters from the start of the selection to + * the end of the current word if nothing is selected. + */ + deleteToBeginningOfSubword(): void; + + /** Removes the selection or all characters from the start of the selection to + * the end of the current word if nothing is selected. + */ + deleteToEndOfSubword(): void; + + /** Removes only the selected text. */ + deleteSelectedText(): void; + + /** Removes the line at the beginning of the selection if the selection is empty + * unless the selection spans multiple lines in which case all lines are removed. + */ + deleteLine(): void; + + /** Joins the current line with the one below it. Lines will be separated by a single space. + * If there selection spans more than one line, all the lines are joined together. + */ + joinLines(): void; + + /** Removes one level of indent from the currently selected rows. */ + outdentSelectedRows(): void; + + /** Sets the indentation level of all selected rows to values suggested by the + * relevant grammars. + */ + autoIndentSelectedRows(): void; + + /** Wraps the selected lines in comments if they aren't currently part of a comment. + * Removes the comment if they are currently wrapped in a comment. + */ + toggleLineComments(): void; + + /** Cuts the selection until the end of the screen line. */ + cutToEndOfLine(): void; + + /** Cuts the selection until the end of the buffer line. */ + cutToEndOfBufferLine(): void; + + /** Copies the selection to the clipboard and then deletes it. */ + cut(maintainClipboard?: boolean, fullLine?: boolean): void; + + /** Copies the current selection to the clipboard. */ + copy(maintainClipboard?: boolean, fullLine?: boolean): void; + + /** Creates a fold containing the current selection. */ + fold(): void; + + /** If the selection spans multiple rows, indent all of them. */ + indentSelectedRows(): void; + + // Managing multiple selections + /** Moves the selection down one row. */ + addSelectionBelow(): void; + + /** Moves the selection up one row. */ + addSelectionAbove(): void; + + /** Combines the given selection into this selection and then destroys the + * given selection. + */ + merge(otherSelection: Selection, options?: { preserveFolds?: boolean, + autoscroll?: boolean }): void; + + // Comparing to other selections + /** Compare this selection's buffer range to another selection's buffer range. + * See Range::compare for more details. + */ + compare(otherSelection: Selection): number; + } + + /** A singleton instance of this class available via atom.styles, which you can + * use to globally query and observe the set of active style sheets. + */ + interface StyleManager { + // Event Subscription + /** Invoke callback for all current and future style elements. */ + observeStyleElements(callback: (styleElement: Events.StyleElementObserved) => + void): EventKit.Disposable; + + /** Invoke callback when a style element is added. */ + onDidAddStyleElement(callback: (styleElement: Events.StyleElementObserved) => + void): EventKit.Disposable; + + /** Invoke callback when a style element is removed. */ + onDidRemoveStyleElement(callback: (styleElement: HTMLStyleElement) => void): + EventKit.Disposable; + + /** Invoke callback when an existing style element is updated. */ + onDidUpdateStyleElement(callback: (styleElement: Events.StyleElementObserved) => + void): EventKit.Disposable; + + // Reading Style Elements + /** Get all loaded style elements. */ + getStyleElements(): HTMLStyleElement[]; + + // Paths + /** Get the path of the user style sheet in ~/.atom. */ + getUserStyleSheetPath(): string; + } + + /** Run a node script in a separate process. */ + interface Task { + // NOTE: this is actually the best we can do here with the REST parameter + // for this appearing in the beginning of the parameter list, which isn't + // aligned with the ES6 spec. + /** Starts the task. + * Throws an error if this task has already been terminated or if sending a + * message to the child process fails. + */ + // tslint:disable-next-line:no-any + start(...args: any[]): void; + + /** Send message to the task. + * Throws an error if this task has already been terminated or if sending a + * message to the child process fails. + */ + send(message: string): void; + + /** Call a function when an event is emitted by the child process. */ + // tslint:disable-next-line:no-any + on(eventName: string, callback: (param: any) => void): EventKit.Disposable; + + /** Forcefully stop the running task. + * No more events are emitted once this method is called. + */ + terminate(): void; + + /** Cancel the running task and emit an event if it was canceled. */ + cancel(): boolean; + } + + /** An interface which all custom test runners should implement. */ + type TestRunner = (params: Structures.TestRunnerArgs) => Promise; + + /** This class represents all essential editing state for a single TextBuffer, + * including cursor and selection positions, folds, and soft wraps. + */ + interface TextEditor { + // Properties + id: number; + buffer: TextBuffer.TextBuffer; + element: HTMLElement; + + // Event Subscription + /** Calls your callback when the buffer's title has changed. */ + onDidChangeTitle(callback: (title: string) => void): EventKit.Disposable; + + /** Calls your callback when the buffer's path, and therefore title, has changed. */ + onDidChangePath(callback: (path: string) => void): EventKit.Disposable; + + /** Invoke the given callback synchronously when the content of the buffer + * changes. + */ + onDidChange(callback: (event: Events.EditorChanged[]) => void): + EventKit.Disposable; + + /** Invoke callback when the buffer's contents change. It is emit + * asynchronously 300ms after the last buffer change. This is a good place + * to handle changes to the buffer without compromising typing performance. + */ + onDidStopChanging(callback: (event: TextBuffer.Events.BufferStoppedChanging) => void): + EventKit.Disposable; + + /** Calls your callback when a Cursor is moved. If there are multiple cursors, + * your callback will be called for each cursor. + */ + onDidChangeCursorPosition(callback: (event: Events.CursorPositionChanged) => void): + EventKit.Disposable; + + /** Calls your callback when a selection's screen range changes. */ + onDidChangeSelectionRange(callback: (event: Events.SelectionChanged) => void): + EventKit.Disposable; + + /** Invoke the given callback after the buffer is saved to disk. */ + onDidSave(callback: (event: { path: string }) => void): EventKit.Disposable; + + /** Invoke the given callback when the editor is destroyed. */ + onDidDestroy(callback: () => void): EventKit.Disposable; + + /** Retrieves the current TextBuffer. */ + getBuffer(): TextBuffer.TextBuffer; + + /** Calls your callback when a Gutter is added to the editor. Immediately calls + * your callback for each existing gutter. + */ + observeGutters(callback: (gutter: Gutter) => void): EventKit.Disposable; + + /** Calls your callback when a Gutter is added to the editor. */ + onDidAddGutter(callback: (gutter: Gutter) => void): EventKit.Disposable; + + /** Calls your callback when a Gutter is removed from the editor. */ + onDidRemoveGutter(callback: (name: string) => void): EventKit.Disposable; + + /** Calls your callback when soft wrap was enabled or disabled. */ + onDidChangeSoftWrapped(callback: (softWrapped: boolean) => void): EventKit.Disposable; + + /** Calls your callback when the buffer's encoding has changed. */ + onDidChangeEncoding(callback: (encoding: string) => void): EventKit.Disposable; + + /** Calls your callback when the grammar that interprets and colorizes the text + * has been changed. Immediately calls your callback with the current grammar. + */ + observeGrammar(callback: (grammar: FirstMate.Grammar) => void): EventKit.Disposable; + + /** Calls your callback when the grammar that interprets and colorizes the text + * has been changed. + */ + onDidChangeGrammar(callback: (grammar: FirstMate.Grammar) => void): EventKit.Disposable; + + /** Calls your callback when the result of ::isModified changes. */ + onDidChangeModified(callback: (modified: boolean) => void): EventKit.Disposable; + + /** Calls your callback when the buffer's underlying file changes on disk at a + * moment when the result of ::isModified is true. + */ + onDidConflict(callback: () => void): EventKit.Disposable; + + /** Calls your callback before text has been inserted. */ + onWillInsertText(callback: (event: { text: string, cancel(): void }) => void): + EventKit.Disposable; + + /** Calls your callback after text has been inserted. */ + onDidInsertText(callback: (event: { text: string }) => void): EventKit.Disposable; + + /** Calls your callback when a Cursor is added to the editor. Immediately calls + * your callback for each existing cursor. + */ + observeCursors(callback: (cursor: Cursor) => void): EventKit.Disposable; + + /** Calls your callback when a Cursor is added to the editor. */ + onDidAddCursor(callback: (cursor: Cursor) => void): EventKit.Disposable; + + /** Calls your callback when a Cursor is removed from the editor. */ + onDidRemoveCursor(callback: (cursor: Cursor) => void): EventKit.Disposable; + + /** Calls your callback when a Selection is added to the editor. Immediately + * calls your callback for each existing selection. + */ + observeSelections(callback: (selection: Selection) => void): EventKit.Disposable; + + /** Calls your callback when a Selection is added to the editor. */ + onDidAddSelection(callback: (selection: Selection) => void): EventKit.Disposable; + + /** Calls your callback when a Selection is removed from the editor. */ + onDidRemoveSelection(callback: (selection: Selection) => void): EventKit.Disposable; + + /** Calls your callback with each Decoration added to the editor. Calls your + * callback immediately for any existing decorations. + */ + observeDecorations(callback: (decoration: Decoration) => void): EventKit.Disposable; + + /** Calls your callback when a Decoration is added to the editor. */ + onDidAddDecoration(callback: (decoration: Decoration) => void): EventKit.Disposable; + + /** Calls your callback when a Decoration is removed from the editor. */ + onDidRemoveDecoration(callback: (decoration: Decoration) => void): EventKit.Disposable; + + /** Calls your callback when the placeholder text is changed. */ + onDidChangePlaceholderText(callback: (placeholderText: string) => void): EventKit.Disposable; + + // File Details + /** Get the editor's title for display in other parts of the UI such as the tabs. + * If the editor's buffer is saved, its title is the file name. If it is unsaved, + * its title is "untitled". + */ + getTitle(): string; + + /** Get unique title for display in other parts of the UI, such as the window title. + * If the editor's buffer is unsaved, its title is "untitled" If the editor's + * buffer is saved, its unique title is formatted as one of the following, + * + * "" when it is the only editing buffer with this file name. + * " — " when other buffers have this file name. + */ + getLongTitle(): string; + + /** Returns the string path of this editor's text buffer. */ + getPath(): string|undefined; + + /** Returns boolean true if this editor has been modified. */ + isModified(): boolean; + + /** Returns boolean true if this editor has no content. */ + isEmpty(): boolean; + + /** Returns the string character set encoding of this editor's text buffer. */ + getEncoding(): string; + + /** Set the character set encoding to use in this editor's text buffer. */ + setEncoding(encoding: string): void; + + // File Operations + /** Saves the editor's text buffer. + * See TextBuffer::save for more details. + */ + save(): Promise; + + /** Saves the editor's text buffer as the given path. + * See TextBuffer::saveAs for more details. + */ + saveAs(filePath: string): Promise; + + // Reading Text + /** Returns a string representing the entire contents of the editor. */ + getText(): string; + + /** Get the text in the given range in buffer coordinates. */ + getTextInBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]]): string; + + /** Returns a number representing the number of lines in the buffer. */ + getLineCount(): number; + + /** Returns a number representing the number of screen lines in the editor. + * This accounts for folds. + */ + getScreenLineCount(): number; + + /** Returns a number representing the last zero-indexed buffer row number of + * the editor. + */ + getLastBufferRow(): number; + + /** Returns a number representing the last zero-indexed screen row number of + * the editor. + */ + getLastScreenRow(): number; + + /** Returns a string representing the contents of the line at the given + * buffer row. + */ + lineTextForBufferRow(bufferRow: number): string; + + /** Returns a string representing the contents of the line at the given + * screen row. + */ + lineTextForScreenRow(screenRow: number): string; + + /** Get the range of the paragraph surrounding the most recently added cursor. */ + getCurrentParagraphBufferRange(): TextBuffer.Range; + + // Mutating Text + /** Replaces the entire contents of the buffer with the given string. */ + setText(text: string): void; + + /** Set the text in the given Range in buffer coordinates. */ + setTextInBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], text: string, + options?: { normalizeLineEndings?: boolean, undo?: "skip" }): void; + + /* For each selection, replace the selected text with the given text. */ + insertText(text: string, options?: { select?: boolean, autoIndent?: boolean, + autoIndentNewline?: boolean, autoDecreaseIndent?: boolean, + normalizeLineEndings?: boolean, undo?: "skip" }): TextBuffer.Range|boolean; + + /** For each selection, replace the selected text with a newline. */ + insertNewline(): void; + + /** For each selection, if the selection is empty, delete the character following + * the cursor. Otherwise delete the selected text. + */ + delete(): void; + + /** For each selection, if the selection is empty, delete the character preceding + * the cursor. Otherwise delete the selected text. + */ + backspace(): void; + + /** Mutate the text of all the selections in a single transaction. + * All the changes made inside the given function can be reverted with a single + * call to ::undo. + */ + mutateSelectedText(fn: (selection: Selection, index: number) => void): void; + + /** For each selection, transpose the selected text. + * If the selection is empty, the characters preceding and following the cursor + * are swapped. Otherwise, the selected characters are reversed. + */ + transpose(): void; + + /** Convert the selected text to upper case. + * For each selection, if the selection is empty, converts the containing word + * to upper case. Otherwise convert the selected text to upper case. + */ + upperCase(): void; + + /** Convert the selected text to lower case. + * For each selection, if the selection is empty, converts the containing word + * to upper case. Otherwise convert the selected text to upper case. + */ + lowerCase(): void; + + /** Toggle line comments for rows intersecting selections. + * If the current grammar doesn't support comments, does nothing. + */ + toggleLineCommentsInSelection(): void; + + /** For each cursor, insert a newline at beginning the following line. */ + insertNewlineBelow(): void; + + /** For each cursor, insert a newline at the end of the preceding line. */ + insertNewlineAbove(): void; + + /** For each selection, if the selection is empty, delete all characters of the + * containing word that precede the cursor. Otherwise delete the selected text. + */ + deleteToBeginningOfWord(): void; + + /** Similar to ::deleteToBeginningOfWord, but deletes only back to the previous + * word boundary. + */ + deleteToPreviousWordBoundary(): void; + + /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */ + deleteToNextWordBoundary(): void; + + /** For each selection, if the selection is empty, delete all characters of the + * containing subword following the cursor. Otherwise delete the selected text. + */ + deleteToBeginningOfSubword(): void; + + /** For each selection, if the selection is empty, delete all characters of the + * containing subword following the cursor. Otherwise delete the selected text. + */ + deleteToEndOfSubword(): void; + + /** For each selection, if the selection is empty, delete all characters of the + * containing line that precede the cursor. Otherwise delete the selected text. + */ + deleteToBeginningOfLine(): void; + + /** For each selection, if the selection is not empty, deletes the selection + * otherwise, deletes all characters of the containing line following the cursor. + * If the cursor is already at the end of the line, deletes the following newline. + */ + deleteToEndOfLine(): void; + + /** For each selection, if the selection is empty, delete all characters of the + * containing word following the cursor. Otherwise delete the selected text. + */ + deleteToEndOfWord(): void; + + /** Delete all lines intersecting selections. */ + deleteLine(): void; + + // History + /** Undo the last change. */ + undo(): void; + + /** Redo the last change. */ + redo(): void; + + /** Batch multiple operations as a single undo/redo step. + * Any group of operations that are logically grouped from the perspective of undoing + * and redoing should be performed in a transaction. If you want to abort the transaction, + * call ::abortTransaction to terminate the function's execution and revert any changes + * performed up to the abortion. + */ + transact(fn: () => void): void; + /** Batch multiple operations as a single undo/redo step. + * Any group of operations that are logically grouped from the perspective of undoing + * and redoing should be performed in a transaction. If you want to abort the transaction, + * call ::abortTransaction to terminate the function's execution and revert any changes + * performed up to the abortion. + */ + transact(groupingInterval: number, fn: () => void): void; + + /** Abort an open transaction, undoing any operations performed so far within the transaction. */ + abortTransaction(): void; + + /** Create a pointer to the current state of the buffer for use with ::revertToCheckpoint + * and ::groupChangesSinceCheckpoint. + */ + createCheckpoint(): number; + + /** Revert the buffer to the state it was in when the given checkpoint was created. + * The redo stack will be empty following this operation, so changes since the checkpoint + * will be lost. If the given checkpoint is no longer present in the undo history, no + * changes will be made to the buffer and this method will return false. + */ + revertToCheckpoint(checkpoint: number): boolean; + + /** Group all changes since the given checkpoint into a single transaction for purposes + * of undo/redo. + * If the given checkpoint is no longer present in the undo history, no grouping will be + * performed and this method will return false. + */ + groupChangesSinceCheckpoint(checkpoint: number): boolean; + + // TextEditor Coordinates + /** Convert a position in buffer-coordinates to screen-coordinates. */ + screenPositionForBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], + options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; + + /** Convert a position in screen-coordinates to buffer-coordinates. */ + bufferPositionForScreenPosition(bufferPosition: TextBuffer.PointLike|[number, number], + options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; + + /** Convert a range in buffer-coordinates to screen-coordinates. */ + screenRangeForBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]]): TextBuffer.Range; + + /** Convert a range in screen-coordinates to buffer-coordinates. */ + bufferRangeForScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]]): TextBuffer.Range; + + /** Clip the given Point to a valid position in the buffer. */ + clipBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): + TextBuffer.Point; + + /** Clip the start and end of the given range to valid positions in the buffer. + * See ::clipBufferPosition for more information. + */ + clipBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| + [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| + [[number, number], [number, number]]): TextBuffer.Range; + + /** Clip the given Point to a valid position on screen. */ + clipScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], + options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; + + /** Clip the start and end of the given range to valid positions on screen. + * See ::clipScreenPosition for more information. + */ + clipScreenRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| + [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| + [[number, number], [number, number]], options?: { clipDirection?: + "backward"|"forward"|"closest"}): TextBuffer.Range; + + // Decorations + /** Add a decoration that tracks a DisplayMarker. When the marker moves, is + * invalidated, or is destroyed, the decoration will be updated to reflect + * the marker's state. + */ + decorateMarker(marker: TextBuffer.DisplayMarker, decorationParams: + Structures.DecorationProps): Decoration; + + /** Add a decoration to every marker in the given marker layer. Can be used to + * decorate a large number of markers without having to create and manage many + * individual decorations. + */ + decorateMarkerLayer(markerLayer: TextBuffer.MarkerLayer|TextBuffer.DisplayMarkerLayer, + decorationParams: Structures.DecorationLayerProps): LayerDecoration; + + /** Get all decorations. */ + getDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; + + /** Get all decorations of type 'line'. */ + getLineDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; + + /** Get all decorations of type 'line-number'. */ + getLineNumberDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; + + /** Get all decorations of type 'highlight'. */ + getHighlightDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; + + /** Get all decorations of type 'overlay'. */ + getOverlayDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; + + // Markers + /** Create a marker on the default marker layer with the given range in buffer coordinates. + * This marker will maintain its logical location as the buffer is changed, so if you mark + * a particular word, the marker will remain over that word even if the word's location + * in the buffer changes. + */ + markBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| + [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| + [[number, number], [number, number]], properties?: { maintainHistory?: boolean, + reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): + TextBuffer.DisplayMarker; + + /** Create a marker on the default marker layer with the given range in screen coordinates. + * This marker will maintain its logical location as the buffer is changed, so if you mark + * a particular word, the marker will remain over that word even if the word's location in + * the buffer changes. + */ + markScreenRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| + [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| + [[number, number], [number, number]], properties?: { maintainHistory?: boolean, + reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): + TextBuffer.DisplayMarker; + + /** Create a marker on the default marker layer with the given buffer position and no tail. + * To group multiple markers together in their own private layer, see ::addMarkerLayer. + */ + markBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], options?: + { invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): + TextBuffer.DisplayMarker; + + /** Create a marker on the default marker layer with the given screen position and no tail. + * To group multiple markers together in their own private layer, see ::addMarkerLayer. + */ + markScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], options?: + { invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", clipDirection?: + "backward"|"forward"|"closest" }): TextBuffer.DisplayMarker; + + /** Find all DisplayMarkers on the default marker layer that match the given properties. + * + * This method finds markers based on the given properties. Markers can be associated + * with custom properties that will be compared with basic equality. In addition, there + * are several special properties that will be compared with the range of the markers + * rather than their properties. + */ + findMarkers(properties: TextBuffer.Options.FindDisplayMarker): TextBuffer.DisplayMarker[]; + + /** Create a marker layer to group related markers. */ + addMarkerLayer(options?: { + maintainHistory?: boolean, + persistent?: boolean, + }): TextBuffer.DisplayMarkerLayer; + + /** Get a DisplayMarkerLayer by id. */ + getMarkerLayer(id: number): TextBuffer.DisplayMarkerLayer|undefined; + + /** Get the default DisplayMarkerLayer. + * All marker APIs not tied to an explicit layer interact with this default layer. + */ + getDefaultMarkerLayer(): TextBuffer.DisplayMarkerLayer; + + /** Get the DisplayMarker on the default layer for the given marker id. */ + getMarker(id: number): TextBuffer.DisplayMarker; + + /** Get all DisplayMarkers on the default marker layer. Consider using ::findMarkers. */ + getMarkers(): TextBuffer.DisplayMarker[]; + + /** Get the number of markers in the default marker layer. */ + getMarkerCount(): number; + + // Cursors + /** Get the position of the most recently added cursor in buffer coordinates. */ + getCursorBufferPosition(): TextBuffer.Point; + + /** Get the position of all the cursor positions in buffer coordinates. */ + getCursorBufferPositions(): TextBuffer.Point[]; + + /** Move the cursor to the given position in buffer coordinates. + * If there are multiple cursors, they will be consolidated to a single cursor. + */ + setCursorBufferPosition(position: TextBuffer.PointLike|[number, number], options?: + { autoscroll?: boolean }): void; + + /** Get a Cursor at given screen coordinates Point. */ + getCursorAtScreenPosition(position: TextBuffer.PointLike|[number, number]): + Cursor|undefined; + + /** Get the position of the most recently added cursor in screen coordinates. */ + getCursorScreenPosition(): TextBuffer.Point; + + /** Get the position of all the cursor positions in screen coordinates. */ + getCursorScreenPositions(): TextBuffer.Point[]; + + /** Move the cursor to the given position in screen coordinates. + * If there are multiple cursors, they will be consolidated to a single cursor. + */ + setCursorScreenPosition(position: TextBuffer.PointLike|[number, number], + options?: { autoscroll?: boolean }): void; + + /** Add a cursor at the given position in buffer coordinates. */ + addCursorAtBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): Cursor; + + /** Add a cursor at the position in screen coordinates. */ + addCursorAtScreenPosition(screenPosition: TextBuffer.PointLike|[number, number]): Cursor; + + /** Returns a boolean indicating whether or not there are multiple cursors. */ + hasMultipleCursors(): boolean; + + /** Move every cursor up one row in screen coordinates. */ + moveUp(lineCount?: number): void; + + /** Move every cursor down one row in screen coordinates. */ + moveDown(lineCount?: number): void; + + /** Move every cursor left one column. */ + moveLeft(columnCount?: number): void; + + /** Move every cursor right one column. */ + moveRight(columnCount?: number): void; + + /** Move every cursor to the beginning of its line in buffer coordinates. */ + moveToBeginningOfLine(): void; + + /** Move every cursor to the beginning of its line in screen coordinates. */ + moveToBeginningOfScreenLine(): void; + + /** Move every cursor to the first non-whitespace character of its line. */ + moveToFirstCharacterOfLine(): void; + + /** Move every cursor to the end of its line in buffer coordinates. */ + moveToEndOfLine(): void; + + /** Move every cursor to the end of its line in screen coordinates. */ + moveToEndOfScreenLine(): void; + + /** Move every cursor to the beginning of its surrounding word. */ + moveToBeginningOfWord(): void; + + /** Move every cursor to the end of its surrounding word. */ + moveToEndOfWord(): void; + + /** Move every cursor to the top of the buffer. + * If there are multiple cursors, they will be merged into a single cursor. + */ + moveToTop(): void; + + /** Move every cursor to the bottom of the buffer. + * If there are multiple cursors, they will be merged into a single cursor. + */ + moveToBottom(): void; + + /** Move every cursor to the beginning of the next word. */ + moveToBeginningOfNextWord(): void; + + /** Move every cursor to the previous word boundary. */ + moveToPreviousWordBoundary(): void; + + /** Move every cursor to the next word boundary. */ + moveToNextWordBoundary(): void; + + /** Move every cursor to the previous subword boundary. */ + moveToPreviousSubwordBoundary(): void; + + /** Move every cursor to the next subword boundary. */ + moveToNextSubwordBoundary(): void; + + /** Move every cursor to the beginning of the next paragraph. */ + moveToBeginningOfNextParagraph(): void; + + /** Move every cursor to the beginning of the previous paragraph. */ + moveToBeginningOfPreviousParagraph(): void; + + /** Returns the most recently added Cursor. */ + getLastCursor(): Cursor; + + /** Returns the word surrounding the most recently added cursor. */ + getWordUnderCursor(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean, + allowPrevious?: boolean, + }): string; + + /** Get an Array of all Cursors. */ + getCursors(): Cursor[]; + + /** Get all Cursorss, ordered by their position in the buffer instead of the + * order in which they were added. + */ + getCursorsOrderedByBufferPosition(): Cursor[]; + + // Selections + /** Get the selected text of the most recently added selection. */ + getSelectedText(): string; + + /** Get the Range of the most recently added selection in buffer coordinates. */ + getSelectedBufferRange(): TextBuffer.Range; + + /** Get the Ranges of all selections in buffer coordinates. + * The ranges are sorted by when the selections were added. Most recent at the end. + */ + getSelectedBufferRanges(): TextBuffer.Range[]; + + /** Set the selected range in buffer coordinates. If there are multiple selections, + * they are reduced to a single selection with the given range. + */ + setSelectedBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], options?: + { reversed?: boolean, preserveFolds?: boolean}): void; + + /** Set the selected ranges in buffer coordinates. If there are multiple selections, + * they are replaced by new selections with the given ranges. + */ + setSelectedBufferRanges(bufferRanges: ReadonlyArray, + options?: { reversed?: boolean, preserveFolds?: boolean}): void; + + /** Get the Range of the most recently added selection in screen coordinates. */ + getSelectedScreenRange(): TextBuffer.Range; + + /** Get the Ranges of all selections in screen coordinates. + * The ranges are sorted by when the selections were added. Most recent at the end. + */ + getSelectedScreenRanges(): TextBuffer.Range[]; + + /** Set the selected range in screen coordinates. If there are multiple selections, + * they are reduced to a single selection with the given range. + */ + setSelectedScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], options?: + { reversed?: boolean }): void; + + /** Set the selected ranges in screen coordinates. If there are multiple selections, + * they are replaced by new selections with the given ranges. + */ + setSelectedScreenRanges(screenRanges: ReadonlyArray, options?: { reversed?: boolean }): void; + + /** Add a selection for the given range in buffer coordinates. */ + addSelectionForBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], options?: + { reversed?: boolean, preserveFolds?: boolean }): Selection; + + /** Add a selection for the given range in screen coordinates. */ + addSelectionForScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], options?: + { reversed?: boolean, preserveFolds?: boolean }): Selection; + + /** Select from the current cursor position to the given position in buffer coordinates. + * This method may merge selections that end up intersecting. + */ + selectToBufferPosition(position: TextBuffer.PointLike|[number, number]): void; + + /** Select from the current cursor position to the given position in screen coordinates. + * This method may merge selections that end up intersecting. + */ + selectToScreenPosition(position: TextBuffer.PointLike|[number, number]): void; + + /** Move the cursor of each selection one character upward while preserving the + * selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectUp(rowCount?: number): void; + + /** Move the cursor of each selection one character downward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectDown(rowCount?: number): void; + + /** Move the cursor of each selection one character leftward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectLeft(columnCount?: number): void; + + /** Move the cursor of each selection one character rightward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectRight(columnCount?: number): void; + + /** Select from the top of the buffer to the end of the last selection in the buffer. + * This method merges multiple selections into a single selection. + */ + selectToTop(): void; + + /** Selects from the top of the first selection in the buffer to the end of the buffer. + * This method merges multiple selections into a single selection. + */ + selectToBottom(): void; + + /** Select all text in the buffer. + * This method merges multiple selections into a single selection. + */ + selectAll(): void; + + /** Move the cursor of each selection to the beginning of its line while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToBeginningOfLine(): void; + + /** Move the cursor of each selection to the first non-whitespace character of its + * line while preserving the selection's tail position. If the cursor is already + * on the first character of the line, move it to the beginning of the line. + * This method may merge selections that end up intersecting. + */ + selectToFirstCharacterOfLine(): void; + + /** Move the cursor of each selection to the end of its line while preserving the + * selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToEndOfLine(): void; + + /** Expand selections to the beginning of their containing word. + * Operates on all selections. Moves the cursor to the beginning of the containing + * word while preserving the selection's tail position. + */ + selectToBeginningOfWord(): void; + + /** Expand selections to the end of their containing word. + * Operates on all selections. Moves the cursor to the end of the containing word + * while preserving the selection's tail position. + */ + selectToEndOfWord(): void; + + /** For each cursor, select the containing line. + * This method merges selections on successive lines. + */ + selectLinesContainingCursors(): void; + + /** Select the word surrounding each cursor. */ + selectWordsContainingCursors(): void; + + /** For each selection, move its cursor to the preceding subword boundary while + * maintaining the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToPreviousSubwordBoundary(): void; + + /** For each selection, move its cursor to the next subword boundary while maintaining + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToNextSubwordBoundary(): void; + + /** For each selection, move its cursor to the preceding word boundary while + * maintaining the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToPreviousWordBoundary(): void; + + /** For each selection, move its cursor to the next word boundary while maintaining + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToNextWordBoundary(): void; + + /** Expand selections to the beginning of the next word. + * Operates on all selections. Moves the cursor to the beginning of the next word + * while preserving the selection's tail position. + */ + selectToBeginningOfNextWord(): void; + + /** Expand selections to the beginning of the next paragraph. + * Operates on all selections. Moves the cursor to the beginning of the next + * paragraph while preserving the selection's tail position. + */ + selectToBeginningOfNextParagraph(): void; + + /** Expand selections to the beginning of the next paragraph. + * Operates on all selections. Moves the cursor to the beginning of the next + * paragraph while preserving the selection's tail position. + */ + selectToBeginningOfPreviousParagraph(): void; + + /** Select the range of the given marker if it is valid. */ + selectMarker(marker: TextBuffer.DisplayMarker): TextBuffer.Range|undefined; + + /** Get the most recently added Selection. */ + getLastSelection(): Selection; + + /** Get current Selections. */ + getSelections(): Selection[]; + + /** Get all Selections, ordered by their position in the buffer instead of the + * order in which they were added. + */ + getSelectionsOrderedByBufferPosition(): Selection[]; + + // NOTE: this calls into Selection::intersectsBufferRange, which itself calls + // into Range::intersectsWith. Range::intersectsWith is one of the few functions + // which does NOT take a range-compatible array. + /** Determine if a given range in buffer coordinates intersects a selection. */ + selectionIntersectsBufferRange(bufferRange: TextBuffer.RangeLike): boolean; + + // Searching and Replacing + /** Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + * + * ::scan functions as the replace method as well via the replace. + */ + scan(regex: RegExp, options: TextBuffer.Options.ScanContext, iterator: (params: + TextBuffer.Structures.ContextualBufferScanResult) => void): void; + /** Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + * + * ::scan functions as the replace method as well via the replace. + */ + scan(regex: RegExp, iterator: (params: TextBuffer.Structures.BufferScanResult) => void): + void; + + /** Scan regular expression matches in a given range, calling the given iterator. + * function on each match. + */ + scanInBufferRange(regex: RegExp, range: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], iterator: (params: + TextBuffer.Structures.BufferScanResult) => void): void; + + /** Scan regular expression matches in a given range in reverse order, calling the + * given iterator function on each match. + */ + backwardsScanInBufferRange(regex: RegExp, range: TextBuffer.RangeLike|[TextBuffer.PointLike, + TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], + TextBuffer.PointLike]|[[number, number], [number, number]], iterator: (params: + TextBuffer.Structures.BufferScanResult) => void): void; + + // Tab Behavior + /** Returns a boolean indicating whether softTabs are enabled for this editor. */ + getSoftTabs(): boolean; + + /** Enable or disable soft tabs for this editor. */ + setSoftTabs(softTabs: boolean): void; + + /** Toggle soft tabs for this editor. */ + toggleSoftTabs(): boolean; + + /** Get the on-screen length of tab characters. */ + getTabLength(): number; + + /** Set the on-screen length of tab characters. Setting this to a number will + * override the editor.tabLength setting. + */ + setTabLength(tabLength: number): void; + + /** Determine if the buffer uses hard or soft tabs. */ + usesSoftTabs(): boolean|undefined; + + /** Get the text representing a single level of indent. + * If soft tabs are enabled, the text is composed of N spaces, where N is the + * tab length. Otherwise the text is a tab character (\t). + */ + getTabText(): string; + + // Soft Wrap Behavior + /** Determine whether lines in this editor are soft-wrapped. */ + isSoftWrapped(): boolean; + + /** Enable or disable soft wrapping for this editor. */ + setSoftWrapped(softWrapped: boolean): boolean; + + /** Toggle soft wrapping for this editor. */ + toggleSoftWrapped(): boolean; + + /** Gets the column at which column will soft wrap. */ + getSoftWrapColumn(): number; + + // Indentation + /** Get the indentation level of the given buffer row. + * Determines how deeply the given row is indented based on the soft tabs and tab + * length settings of this editor. Note that if soft tabs are enabled and the tab + * length is 2, a row with 4 leading spaces would have an indentation level of 2. + */ + indentationForBufferRow(bufferRow: number): number; + + /** Set the indentation level for the given buffer row. + * Inserts or removes hard tabs or spaces based on the soft tabs and tab length settings + * of this editor in order to bring it to the given indentation level. Note that if soft + * tabs are enabled and the tab length is 2, a row with 4 leading spaces would have an + * indentation level of 2. + */ + setIndentationForBufferRow(bufferRow: number, newLevel: number, options?: + { preserveLeadingWhitespace?: boolean }): void; + + /** Indent rows intersecting selections by one level. */ + indentSelectedRows(): void; + + /** Outdent rows intersecting selections by one level. */ + outdentSelectedRows(): void; + + /** Get the indentation level of the given line of text. + * Determines how deeply the given line is indented based on the soft tabs and tab length + * settings of this editor. Note that if soft tabs are enabled and the tab length is 2, + * a row with 4 leading spaces would have an indentation level of 2. + */ + indentLevelForLine(line: string): number; + + /** Indent rows intersecting selections based on the grammar's suggested indent level. */ + autoIndentSelectedRows(): void; + + // Grammars + /** Get the current Grammar of this editor. */ + getGrammar(): FirstMate.Grammar; + + /** Set the current Grammar of this editor. + * Assigning a grammar will cause the editor to re-tokenize based on the new grammar. + */ + setGrammar(grammar: FirstMate.Grammar): void; + + // Managing Syntax Scopes + /** Returns a ScopeDescriptor that includes this editor's language. + * e.g. [".source.ruby"], or [".source.coffee"]. + */ + getRootScopeDescriptor(): ScopeDescriptor; + + /** Get the syntactic scopeDescriptor for the given position in buffer coordinates. */ + scopeDescriptorForBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): + ScopeDescriptor; + + /** Get the range in buffer coordinates of all tokens surrounding the cursor + * that match the given scope selector. + */ + bufferRangeForScopeAtCursor(scopeSelector: string): TextBuffer.Range; + + /** Determine if the given row is entirely a comment. */ + isBufferRowCommented(bufferRow: number): boolean; + + // Clipboard Operations + /** For each selection, copy the selected text. */ + copySelectedText(): void; + + /** For each selection, cut the selected text. */ + cutSelectedText(): void; + + /** For each selection, replace the selected text with the contents of the clipboard. + * If the clipboard contains the same number of selections as the current editor, + * each selection will be replaced with the content of the corresponding clipboard + * selection text. + */ + pasteText(options?: Options.TextInsertion): void; + + /** For each selection, if the selection is empty, cut all characters of the + * containing screen line following the cursor. Otherwise cut the selected text. + */ + cutToEndOfLine(): void; + + /** For each selection, if the selection is empty, cut all characters of the + * containing buffer line following the cursor. Otherwise cut the selected text. + */ + cutToEndOfBufferLine(): void; + + // Folds + /** Fold the most recent cursor's row based on its indentation level. + * The fold will extend from the nearest preceding line with a lower indentation + * level up to the nearest following row with a lower indentation level. + */ + foldCurrentRow(): void; + + /** Unfold the most recent cursor's row by one level. */ + unfoldCurrentRow(): void; + + /** Fold the given row in buffer coordinates based on its indentation level. + * If the given row is foldable, the fold will begin there. Otherwise, it will + * begin at the first foldable row preceding the given row. + */ + foldBufferRow(bufferRow: number): void; + + /** Unfold all folds containing the given row in buffer coordinates. */ + unfoldBufferRow(bufferRow: number): void; + + /** For each selection, fold the rows it intersects. */ + foldSelectedLines(): void; + + /** Fold all foldable lines. */ + foldAll(): void; + + /** Unfold all existing folds. */ + unfoldAll(): void; + + /** Fold all foldable lines at the given indent level. */ + foldAllAtIndentLevel(level: number): void; + + /** Determine whether the given row in buffer coordinates is foldable. + * A foldable row is a row that starts a row range that can be folded. + */ + isFoldableAtBufferRow(bufferRow: number): boolean; + + /** Determine whether the given row in screen coordinates is foldable. + * A foldable row is a row that starts a row range that can be folded. + */ + isFoldableAtScreenRow(bufferRow: number): boolean; + + /** Fold the given buffer row if it isn't currently folded, and unfold it otherwise. */ + toggleFoldAtBufferRow(bufferRow: number): void; + + /** Determine whether the most recently added cursor's row is folded. */ + isFoldedAtCursorRow(): boolean; + + /** Determine whether the given row in buffer coordinates is folded. */ + isFoldedAtBufferRow(bufferRow: number): boolean; + + /** Determine whether the given row in screen coordinates is folded. */ + isFoldedAtScreenRow(screenRow: number): boolean; + + // Gutters + /** Add a custom Gutter. */ + addGutter(options: { + name: string, + priority?: number, + visible?: boolean, + }): Gutter; + + /** Get this editor's gutters. */ + getGutters(): Gutter[]; + + /** Get the gutter with the given name. */ + gutterWithName(name: string): Gutter|null; + + // Scrolling the TextEditor + /** Scroll the editor to reveal the most recently added cursor if it is off-screen. */ + scrollToCursorPosition(options?: { center?: boolean }): void; + + /** Scrolls the editor to the given buffer position. */ + scrollToBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], + options?: { center?: boolean }): void; + + /** Scrolls the editor to the given screen position. */ + scrollToScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], + options?: { center?: boolean }): void; + + // TextEditor Rendering + /** Retrieves the rendered line height in pixels. */ + getLineHeightInPixels(): number; + + /** Retrieves the greyed out placeholder of a mini editor. */ + getPlaceholderText(): string; + + /** Set the greyed out placeholder of a mini editor. Placeholder text will be + * displayed when the editor has no content. + */ + setPlaceholderText(placeholderText: string): void; + } + + /** Experimental: This global registry tracks registered TextEditors. */ + interface TextEditorRegistry { + // Managing Text Editors + /** Remove all editors from the registry. */ + clear(): void; + + /** Register a TextEditor. */ + add(editor: TextEditor): EventKit.Disposable; + + /** Remove the given TextEditor from the registry. */ + remove(editor: TextEditor): boolean; + + /** Keep a TextEditor's configuration in sync with Atom's settings. */ + maintainConfig(editor: TextEditor): EventKit.Disposable; + + /** Set a TextEditor's grammar based on its path and content, and continue + * to update its grammar as gramamrs are added or updated, or the editor's + * file path changes. + */ + maintainGrammar(editor: TextEditor): EventKit.Disposable; + + /** Force a TextEditor to use a different grammar than the one that would + * otherwise be selected for it. + */ + setGrammarOverride(editor: TextEditor, scopeName: string): void; + + /** Retrieve the grammar scope name that has been set as a grammar override + * for the given TextEditor. + */ + getGrammarOverride(editor: TextEditor): string|null; + + /** Remove any grammar override that has been set for the given {TextEditor}. */ + clearGrammarOverride(editor: TextEditor): void; + + // Event Subscription + /** Invoke the given callback with all the current and future registered TextEditors. */ + observe(callback: (editor: TextEditor) => void): EventKit.Disposable; + } + + /** Handles loading and activating available themes. */ + interface ThemeManager { + // Event Subscription + /** Invoke callback when style sheet changes associated with updating the + * list of active themes have completed. + */ + onDidChangeActiveThemes(callback: () => void): EventKit.Disposable; + + // Accessing Loaded Themes + /** Returns an Array of strings of all the loaded theme names. */ + getLoadedThemeNames(): string[]|undefined; + + /** Returns an Array of all the loaded themes. */ + getLoadedThemes(): Package[]|undefined; + + // Accessing Active Themes + /** Returns an Array of strings all the active theme names. */ + getActiveThemeNames(): string[]|undefined; + + /** Returns an Array of all the active themes. */ + getActiveThemes(): Package[]|undefined; + + // Managing Enabled Themes + /** Get the enabled theme names from the config. */ + getEnabledThemeNames(): string[]; + } + + /** This tooltip class is derived from Bootstrap 3, but modified to not require + * jQuery, which is an expensive dependency we want to eliminate. + */ + interface Tooltip { + options: Options.Tooltip; + enabled: boolean; + timeout: number; + hoverState: "in"|"out"|null; + element: JQuery|HTMLElement; + + getTitle(): string; + getTooltipElement(): HTMLElement; + getArrowElement(): HTMLElement; + enable(): void; + disable(): void; + toggleEnabled(): void; + toggle(): void; + recalculatePosition(): void; + } + + /** Associates tooltips with HTML elements or selectors. */ + interface TooltipManager { + /** Add a tooltip to the given element. */ + add(target: JQuery|HTMLElement, options: { + title?: string, + html?: boolean, + item?: HTMLElement|{ element: HTMLElement }, + class?: string, + placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), + trigger?: "click"|"hover"|"focus"|"manual", + delay?: { show: number, hide: number }, + keyBindingCommand?: string, + keyBindingTarget?: HTMLElement + } | { + title?: string|(() => string), + html?: boolean, + item?: HTMLElement|{ element: HTMLElement }, + class?: string, + placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), + trigger?: "click"|"hover"|"focus"|"manual", + delay?: { show: number, hide: number }, + }): EventKit.Disposable; + + /** Find the tooltips that have been applied to the given element. */ + findTooltips(target: HTMLElement): Tooltip[]; + } + + /** ViewRegistry handles the association between model and view types in Atom. + * We call this association a View Provider. As in, for a given model, this class + * can provide a view via ::getView, as long as the model/view association was + * registered via ::addViewProvider. + */ + interface ViewRegistry { + /** Add a provider that will be used to construct views in the workspace's view + * layer based on model objects in its model layer. + */ + addViewProvider(createView: (model: object) => HTMLElement|undefined): EventKit.Disposable; + /** Add a provider that will be used to construct views in the workspace's view + * layer based on model objects in its model layer. + */ + // tslint:disable-next-line:no-any + addViewProvider(modelConstructor: { new (...args: any[]): T }, createView: + (instance: T) => HTMLElement|undefined): EventKit.Disposable; + + /** Get the view associated with an object in the workspace. */ + getView(obj: object): HTMLElement; + } + + /** Represents the state of the user interface for the entire window. */ + interface Workspace { + // Event Subscription + /** Invoke the given callback with all current and future text editors in + * the workspace. + */ + observeTextEditors(callback: (editor: TextEditor) => void): EventKit.Disposable; + + /** Invoke the given callback with all current and future panes items in the + * workspace. + */ + observePaneItems(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane item changes. */ + onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when a text editor becomes the active text editor and + * when there is no longer an active text editor. + */ + onDidChangeActiveTextEditor(callback: (editor?: TextEditor) => void): EventKit.Disposable; + + /** Invoke the given callback with the current active pane item and with all + * future active pane items in the workspace. + */ + observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback with the current active text editor (if any), with all + * future active text editors, and when there is no longer an active text editor. + */ + observeActiveTextEditor(callback: (editor?: TextEditor) => void): EventKit.Disposable; + + /** Invoke the given callback whenever an item is opened. Unlike ::onDidAddPaneItem, + * observers will be notified for items that are already present in the workspace + * when they are reopened. + */ + onDidOpen(callback: (event: Events.PaneItemOpened) => void): EventKit.Disposable; + + /** Invoke the given callback when a pane is added to the workspace. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; + + /** Invoke the given callback before a pane is destroyed in the workspace. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; + + /** Invoke the given callback when a pane is destroyed in the workspace. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; + + /** Invoke the given callback with all current and future panes in the workspace. */ + observePanes(callback: (pane: Pane) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; + + /** Invoke the given callback with the current active pane and when the + * active pane changes. + */ + observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; + + /** Invoke the given callback when a pane item is added to the workspace. */ + onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; + + /** Invoke the given callback when a pane item is about to be destroyed, + * before the user is prompted to save it. + */ + onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; + + /** Invoke the given callback when a text editor is added to the workspace. */ + onDidAddTextEditor(callback: (event: Events.TextEditorObserved) => void): + EventKit.Disposable; + + // Opening + /** Opens the given URI in Atom asynchronously. If the URI is already open, + * the existing item for that URI will be activated. If no URI is given, or + * no registered opener can open the URI, a new empty TextEditor will be created. + */ + open(uri: string, options?: { + initialLine?: number, + initialColumn?: number, + split?: "left"|"right"|"up"|"down", + activatePane?: boolean, + activateItem?: boolean, + pending?: boolean, + searchAllPanes?: boolean, + location?: "left"|"right"|"bottom"|"center", + }): Promise; + /** Opens the given URI in Atom asynchronously. If the URI is already open, + * the existing item for that URI will be activated. If no URI is given, or + * no registered opener can open the URI, a new empty TextEditor will be created. + */ + open(): Promise; + + /** Search the workspace for items matching the given URI and hide them. + * Returns a boolean indicating whether any items were found (and hidden). + */ + hide(itemOrURI: object|string): boolean; + + /** Search the workspace for items matching the given URI. If any are found, + * hide them. Otherwise, open the URL. + * Returns a Promise that resolves when the item is shown or hidden. + */ + toggle(itemOrURI: object|string): Promise; + + /** Creates a new item that corresponds to the provided URI. + * If no URI is given, or no registered opener can open the URI, a new empty TextEditor + * will be created. + */ + createItemForURI(uri: string): Promise; + + /** Returns a boolean that is true if object is a TextEditor. */ + isTextEditor(object: object): boolean; + + /** Asynchronously reopens the last-closed item's URI if it hasn't already + * been reopened. + */ + reopenItem(): Promise; + + /** Register an opener for a URI. */ + addOpener(opener: (uri: string) => HTMLElement|{ getTitle(): string }|undefined): + EventKit.Disposable; + + /** Create a new text editor. */ + buildTextEditor(params: object): TextEditor; + + // Pane Items + /** Get all pane items in the workspace. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object; + + /** Get all text editors in the workspace. */ + getTextEditors(): TextEditor[]; + + /** Get the workspace center's active item if it is a TextEditor. */ + getActiveTextEditor(): TextEditor|undefined; + + // Panes + /** Get the most recently focused pane container. */ + getActivePaneContainer(): Dock|WorkspaceCenter; + + /** Get all panes in the workspace. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): boolean; + + /** Make the previous pane active. */ + activatePreviousPane(): boolean; + + /** Get the first pane container that contains an item with the given URI. */ + paneContainerForURI(uri: string): Dock|WorkspaceCenter|undefined; + + /** Get the first pane container that contains the given item. */ + paneContainerForItem(item: object): Dock|WorkspaceCenter|undefined; + + /** Get the first Pane with an item for the given URI. */ + paneForURI(uri: string): Pane|undefined; + + /** Get the Pane containing the given item. */ + paneForItem(item: object): Pane|undefined; + + // Pane Locations + /** Get the WorkspaceCenter at the center of the editor window. */ + getCenter(): WorkspaceCenter; + + /** Get the Dock to the left of the editor window. */ + getLeftDock(): Dock; + + /** Get the Dock to the right of the editor window. */ + getRightDock(): Dock; + + /** Get the Dock below the editor window. */ + getBottomDock(): Dock; + + /** Returns all Pane containers. */ + getPaneContainers(): [WorkspaceCenter, Dock, Dock, Dock]; + + // Panels + /** Get an Array of all the panel items at the bottom of the editor window. */ + getBottomPanels(): Panel[]; + + /** Adds a panel item to the bottom of the editor window. */ + addBottomPanel(options: { + item: object, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items to the left of the editor window. */ + getLeftPanels(): Panel[]; + + /** Adds a panel item to the left of the editor window. */ + addLeftPanel(options: { + item: object, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items to the right of the editor window. */ + getRightPanels(): Panel[]; + + /** Adds a panel item to the right of the editor window. */ + addRightPanel(options: { + item: object, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items at the top of the editor window. */ + getTopPanels(): Panel[]; + + /** Adds a panel item to the top of the editor window above the tabs. */ + addTopPanel(options: { + item: object, + visible?: boolean, + priority?: number + }): Panel; + + /** Get an Array of all the panel items in the header. */ + getHeaderPanels(): Panel[]; + + /** Adds a panel item to the header. */ + addHeaderPanel(options: { + item: object, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items in the footer. */ + getFooterPanels(): Panel[]; + + /** Adds a panel item to the footer. */ + addFooterPanel(options: { + item: object, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the modal panel items. */ + getModalPanels(): Panel[]; + + /** Adds a panel item as a modal dialog. */ + addModalPanel(options: { + item: object, + visible?: boolean, + priority?: number, + autoFocus?: boolean, + }): Panel; + + /** Returns the Panel associated with the given item or null when the item + * has no panel. + */ + panelForItem(item: object): Panel|null; + + // Searching and Replacing + /** Performs a search across all files in the workspace. */ + scan(regex: RegExp, iterator: (result: Structures.ScandalResult) => void): + Structures.CancellablePromise; + /** Performs a search across all files in the workspace. */ + scan(regex: RegExp, options: Options.WorkspaceScan, iterator: + (result: Structures.ScandalResult) => void): Structures.CancellablePromise; + + /** Performs a replace across all the specified files in the project. */ + replace(regex: RegExp, replacementText: string, filePaths: ReadonlyArray, + iterator: (result: { filePath: string|undefined, replacements: number }) => void): + Promise; + } + + // https://github.com/atom/atom/blob/master/src/workspace-center.js + /** The central container for the editor window capable of holding items. */ + interface WorkspaceCenter { + // Event Subscription + /** Invoke the given callback with all current and future text editors in the + * workspace center. + */ + observeTextEditors(callback: (editor: TextEditor) => void): EventKit.Disposable; + + /** Invoke the given callback with all current and future panes items in the + * workspace center. + */ + observePaneItems(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane item changes. */ + onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback with the current active pane item and with all future + * active pane items in the workspace center. + */ + observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; + + /** Invoke the given callback when a pane is added to the workspace center. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; + + /** Invoke the given callback before a pane is destroyed in the workspace center. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; + + /** Invoke the given callback when a pane is destroyed in the workspace center. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; + + /** Invoke the given callback with all current and future panes in the workspace center. */ + observePanes(callback: (pane: Pane) => void): EventKit.Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; + + /** Invoke the given callback with the current active pane and when the active pane changes. */ + observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; + + /** Invoke the given callback when a pane item is added to the workspace center. */ + onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; + + /** Invoke the given callback when a pane item is about to be destroyed, before the user + * is prompted to save it. + */ + onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): + EventKit.Disposable; + + /** Invoke the given callback when a text editor is added to the workspace center. */ + onDidAddTextEditor(callback: (event: Events.TextEditorObserved) => void): + EventKit.Disposable; + + // Pane Items + /** Get all pane items in the workspace center. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object|undefined; + + /** Get all text editors in the workspace center. */ + getTextEditors(): TextEditor[]; + + /** Get the active item if it is an TextEditor. */ + getActiveTextEditor(): TextEditor|undefined; + + /** Save all pane items. */ + saveAll(): void; + + // Panes + /** Get all panes in the workspace center. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): void; + + /** Make the previous pane active. */ + activatePreviousPane(): void; + + /** Retrieve the Pane associated with the given URI. */ + paneForURI(uri: string): Pane|undefined; + + /** Retrieve the Pane associated with the given item. */ + paneForItem(item: object): Pane|undefined; + + /** Destroy (close) the active pane. */ + destroyActivePane(): void; + } + } + + /** An amalgamation of all types used within the public Atom API. */ + namespace Atom { + /** Objects that appear as parameters to callbacks. */ + namespace Events { + // Atom Keymap ========================================================== + type FullKeybindingMatch = AtomKeymap.Events.FullKeybindingMatch; + type PartialKeybindingMatch = AtomKeymap.Events.PartialKeybindingMatch; + type FailedKeybindingMatch = AtomKeymap.Events.FailedKeybindingMatch; + type FailedKeymapFileRead = AtomKeymap.Events.FailedKeymapFileRead; + type KeymapLoaded = AtomKeymap.Events.KeymapLoaded; + type AddedKeystrokeResolver = AtomKeymap.Events.AddedKeystrokeResolver; + + // Path Watcher ========================================================= + type PathWatchErrorThrown = PathWatcher.Events.PathWatchErrorThrown; + type WatchedFilePathChanged = PathWatcher.Events.WatchedFilePathChanged; + + // Text Buffer ========================================================== + type BufferWatchError = TextBuffer.Events.BufferWatchError; + type FileSaved = TextBuffer.Events.FileSaved; + type MarkerChanged = TextBuffer.Events.MarkerChanged; + type BufferChanging = TextBuffer.Events.BufferChanging; + type BufferChanged = TextBuffer.Events.BufferChanged; + type BufferStoppedChanging = TextBuffer.Events.BufferStoppedChanging; + type DisplayMarkerChanged = TextBuffer.Events.DisplayMarkerChanged; + + // Core ================================================================= + type ExceptionThrown = AtomCore.Events.ExceptionThrown; + type PreventableExceptionThrown = AtomCore.Events.PreventableExceptionThrown; + type SelectionChanged = AtomCore.Events.SelectionChanged; + type PaneItemObserved = AtomCore.Events.PaneItemObserved; + type PaneItemOpened = AtomCore.Events.PaneItemOpened; + type EditorChanged = AtomCore.Events.EditorChanged; + type StyleElementObserved = AtomCore.Events.StyleElementObserved; + type TextEditorObserved = AtomCore.Events.TextEditorObserved; + type RepoStatusChanged = AtomCore.Events.RepoStatusChanged; + type PaneListItemShifted = AtomCore.Events.PaneListItemShifted; + type PaneItemMoved = AtomCore.Events.PaneItemMoved; + type CursorPositionChanged = AtomCore.Events.CursorPositionChanged; + type DecorationPropsChanged = AtomCore.Events.DecorationPropsChanged; + type FilesystemChange = AtomCore.Events.FilesystemChange; + } + + /** Objects that appear as parameters to functions. */ + namespace Options { + // Atom Keymap ========================================================== + type BuildKeyEvent = AtomKeymap.Options.BuildKeyEvent; + + // First Mate =========================================================== + type Grammar = FirstMate.Options.Grammar; + + // Text Buffer ========================================================== + type BufferLoad = TextBuffer.Options.BufferLoad; + type CopyMarker = TextBuffer.Options.CopyMarker; + type FindMarker = TextBuffer.Options.FindMarker; + type FindDisplayMarker = TextBuffer.Options.FindDisplayMarker; + type ScanContext = TextBuffer.Options.ScanContext; + + // Core ================================================================= + type TextInsertion = AtomCore.Options.TextInsertion; + type Menu = AtomCore.Options.Menu; + type ContextMenu = AtomCore.Options.ContextMenu; + type SpawnProcess = AtomCore.Options.SpawnProcess; + type Process = AtomCore.Options.Process; + type NodeProcess = AtomCore.Options.NodeProcess; + type Notification = AtomCore.Options.Notification; + type ErrorNotification = AtomCore.Options.ErrorNotification; + type Tooltip = AtomCore.Options.Tooltip; + type WorkspaceScan = AtomCore.Options.WorkspaceScan; + type BuildEnvironment = AtomCore.Options.BuildEnvironment; + } + + /** Data structures that are used within classes. */ + namespace Structures { + // First Mate =========================================================== + type GrammarToken = FirstMate.Structures.GrammarToken; + type TokenizeLineResult = FirstMate.Structures.TokenizeLineResult; + type GrammarRule = FirstMate.Structures.GrammarRule; + + // Text Buffer ========================================================== + type TextChange = TextBuffer.Structures.TextChange; + type BufferScanResult = TextBuffer.Structures.BufferScanResult; + type ContextualBufferScanResult = TextBuffer.Structures.ContextualBufferScanResult; + + // Core ================================================================= + type SharedDecorationProps = AtomCore.Structures.SharedDecorationProps; + type DecorationProps = AtomCore.Structures.DecorationProps; + type DecorationLayerProps = AtomCore.Structures.DecorationLayerProps; + type Invisibles = AtomCore.Structures.Invisibles; + type CancellablePromise = AtomCore.Structures.CancellablePromise; + type ScandalResult = AtomCore.Structures.ScandalResult; + type WindowLoadSettings = AtomCore.Structures.WindowLoadSettings; + type TestRunnerArgs = AtomCore.Structures.TestRunnerArgs; + } + + // Atom Keymap ============================================================ + /** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding + * method, as well as versions of the ::stopPropagation methods that record the + * intent to stop propagation so event bubbling can be properly simulated for + * detached elements. + */ + type CommandEvent = AtomKeymap.CommandEvent; + + type KeyBinding = AtomKeymap.KeyBinding; + + /** Allows commands to be associated with keystrokes in a context-sensitive way. + * In Atom, you can access a global instance of this object via `atom.keymaps`. + */ + type KeymapManager = AtomKeymap.KeymapManager; + + // Event Kit ============================================================== + /** An object that aggregates multiple Disposable instances together into a + * single disposable, so they can all be disposed as a group. + */ + type CompositeDisposable = EventKit.CompositeDisposable; + + type DisposableLike = EventKit.DisposableLike; + + /** A handle to a resource that can be disposed. */ + type Disposable = EventKit.Disposable; + + /** Utility class to be used when implementing event-based APIs that allows + * for handlers registered via ::on to be invoked with calls to ::emit. + */ + type Emitter = EventKit.Emitter; + + // First Mate ============================================================= + /** Grammar that tokenizes lines of text. */ + type Grammar = FirstMate.Grammar; + + /** Instance side of GrammarRegistry class. */ + type GrammarRegistry = FirstMate.GrammarRegistry; + + type ScopeSelector = FirstMate.ScopeSelector; + + // Path Watcher =========================================================== + /** Represents a directory on disk that can be watched for changes. */ + type Directory = PathWatcher.Directory; + + /** Represents an individual file that can be watched, read from, and written to. */ + type File = PathWatcher.File; + + // Text Buffer ============================================================ + /** The interface that should be implemented for all "point-compatible" objects. */ + /** Represents a buffer annotation that remains logically stationary even as the + * buffer changes. This is used to represent cursors, folds, snippet targets, + * misspelled words, and anything else that needs to track a logical location + * in the buffer over time. + */ + type DisplayMarker = TextBuffer.DisplayMarker; + + /** Experimental: A container for a related set of markers at the DisplayLayer level. + * Wraps an underlying MarkerLayer on the TextBuffer. + * + * This API is experimental and subject to change on any release. + */ + type DisplayMarkerLayer = TextBuffer.DisplayMarkerLayer; + + /** Represents a buffer annotation that remains logically stationary even as + * the buffer changes. + */ + type Marker = TextBuffer.Marker; + + /** Experimental: A container for a related set of markers. */ + type MarkerLayer = TextBuffer.MarkerLayer; + + /** The interface that should be implemented for all "point-compatible" objects. */ + type PointLike = TextBuffer.PointLike; + + /** Represents a point in a buffer in row/column coordinates. */ + type Point = TextBuffer.Point; + + /** The interface that should be implemented for all "range-compatible" objects. */ + type RangeLike = TextBuffer.RangeLike; + + /** Represents a region in a buffer in row/column coordinates. */ + type Range = TextBuffer.Range; + + /** A mutable text container with undo/redo support and the ability to + * annotate logical regions in the text. + */ + type TextBuffer = TextBuffer.TextBuffer; + + // Atom =================================================================== + /** Atom global for dealing with packages, themes, menus, and the window. + * An instance of this class is always available as the atom global. + */ + type AtomEnvironment = AtomCore.AtomEnvironment; + + /** A wrapper which provides standard error/output line buffering for + * Node's ChildProcess. + */ + type BufferedProcess = AtomCore.BufferedProcess; + + /** Like BufferedProcess, but accepts a Node script as the command to run. + * This is necessary on Windows since it doesn't support shebang #! lines. + */ + type BufferedNodeProcess = AtomCore.BufferedNodeProcess; + + /** Represents the clipboard used for copying and pasting in Atom. */ + type Clipboard = AtomCore.Clipboard; + + /** A simple color class returned from Config::get when the value at the key path is + * of type 'color'. + */ + type Color = AtomCore.Color; + + /** Used to access all of Atom's configuration details. */ + type Config = AtomCore.Config; + + /** Provides a registry for commands that you'd like to appear in the context menu. */ + type ContextMenuManager = AtomCore.ContextMenuManager; + + /** Associates listener functions with commands in a context-sensitive way + * using CSS selectors. + */ + type CommandRegistry = AtomCore.CommandRegistry; + + /** The Cursor class represents the little blinking line identifying where text + * can be inserted. + */ + type Cursor = AtomCore.Cursor; + + /** Represents a decoration that follows a DisplayMarker. A decoration is basically + * a visual representation of a marker. It allows you to add CSS classes to line + * numbers in the gutter, lines, and add selection-line regions around marked ranges + * of text. + */ + type Decoration = AtomCore.Decoration; + + type Deserializer = AtomCore.Deserializer; + + /** Manages the deserializers used for serialized state. */ + type DeserializerManager = AtomCore.DeserializerManager; + + /** A container at the edges of the editor window capable of holding items. */ + type Dock = AtomCore.Dock; + + /** Represents the underlying git operations performed by Atom. */ + type GitRepository = AtomCore.GitRepository; + + /** Represents a gutter within a TextEditor. */ + type Gutter = AtomCore.Gutter; + + /** History manager for remembering which projects have been opened. + * An instance of this class is always available as the atom.history global. + * The project history is used to enable the 'Reopen Project' menu. + */ + type HistoryManager = AtomCore.HistoryManager; + + type HistoryProject = AtomCore.HistoryProject; + + /** Represents a decoration that applies to every marker on a given layer. Created via + * TextEditor::decorateMarkerLayer. + */ + type LayerDecoration = AtomCore.LayerDecoration; + + /** Provides a registry for menu items that you'd like to appear in the application menu. */ + type MenuManager = AtomCore.MenuManager; + + /** A notification to the user containing a message and type. */ + type Notification = AtomCore.Notification; + + /** A notification manager used to create Notifications to be shown to the user. */ + type NotificationManager = AtomCore.NotificationManager; + + /** Loads and activates a package's main module and resources such as stylesheets, + * keymaps, grammar, editor properties, and menus. + */ + type Package = AtomCore.Package; + + /** Package manager for coordinating the lifecycle of Atom packages. */ + type PackageManager = AtomCore.PackageManager; + + /** A container for presenting content in the center of the workspace. */ + type Pane = AtomCore.Pane; + + /** A container representing a panel on the edges of the editor window. You + * should not create a Panel directly, instead use Workspace::addTopPanel and + * friends to add panels. + */ + type Panel = AtomCore.Panel; + + /** Manage a subscription to filesystem events that occur beneath a root directory. */ + type PathWatcher = AtomCore.PathWatcher; + + /** Represents a project that's opened in Atom. */ + type Project = AtomCore.Project; + + /** Wraps an Array of Strings. The Array describes a path from the root of the + * syntax tree to a token including all scope names for the entire path. + */ + type ScopeDescriptor = AtomCore.ScopeDescriptor; + + /** Represents a selection in the TextEditor. */ + type Selection = AtomCore.Selection; + + /** A singleton instance of this class available via atom.styles, which you can + * use to globally query and observe the set of active style sheets. + */ + type StyleManager = AtomCore.StyleManager; + + /** Run a node script in a separate process. */ + type Task = AtomCore.Task; + + /** An interface which all custom test runners should implement. */ + type TestRunner = AtomCore.TestRunner; + + /** This class represents all essential editing state for a single TextBuffer, + * including cursor and selection positions, folds, and soft wraps. + */ + type TextEditor = AtomCore.TextEditor; + + /** Experimental: This global registry tracks registered TextEditors. */ + type TextEditorRegistry = AtomCore.TextEditorRegistry; + + /** Handles loading and activating available themes. */ + type ThemeManager = AtomCore.ThemeManager; + + type Tooltip = AtomCore.Tooltip; + + /** Associates tooltips with HTML elements or selectors. */ + type TooltipManager = AtomCore.TooltipManager; + + /** ViewRegistry handles the association between model and view types in Atom. + * We call this association a View Provider. As in, for a given model, this class + * can provide a view via ::getView, as long as the model/view association was + * registered via ::addViewProvider. + */ + type ViewRegistry = AtomCore.ViewRegistry; + + /** Represents the state of the user interface for the entire window. */ + type Workspace = AtomCore.Workspace; + + // https://github.com/atom/atom/blob/master/src/workspace-center.js + /** The central container for the editor window capable of holding items. */ + type WorkspaceCenter = AtomCore.WorkspaceCenter; } + + var atom: AtomCore.AtomEnvironment; } -declare var atom:AtomCore.IAtom; - -declare module "atom" { - import spacePen = require("space-pen"); - import Q = require("q"); - - var $:typeof spacePen.$; - var $$:typeof spacePen.$$; - var $$$:typeof spacePen.$$$; - - var BufferedNodeProcess:AtomCore.IBufferedNodeProcessStatic; - var BufferedProcess:AtomCore.IBufferedProcessStatic; - var Git:AtomCore.IGitStatic; - var Point:TextBuffer.IPointStatic; - var Range:TextBuffer.IRangeStatic; - - class View extends spacePen.View implements Emissary.ISubscriber { - // Subscriber.includeInto(spacePen.View); - - // inherit from Subscriber - subscribeWith(eventEmitter:any, methodName:string, args:any):any; - - addSubscription(subscription:any):any; - - subscribe(eventEmitterOrSubscription:any, ...args:any[]):any; - - subscribeToCommand(eventEmitter:any, ...args:any[]):any; - - unsubscribe(object?:any):any; - } - - class EditorView extends View { - static characterWidthCache:any; - static configDefaults:any; - static nextEditorId:number; - - static content(params:any):void; - - static classes(_arg?:{mini?:any}):string; - - vScrollMargin:number; - hScrollMargin:number; - lineHeight:any; - charWidth:any; - charHeight:any; - cursorViews:any[]; - selectionViews:any[]; - lineCache:any[]; - isFocused:any; - editor:AtomCore.IEditor; - attached:any; - lineOverdraw:number; - pendingChanges:any[]; - newCursors:any[]; - newSelections:any[]; - redrawOnReattach:any; - bottomPaddingInLines:number; - active:boolean; - - id:number; - - gutter:AtomCore.IGutterView; - overlayer:JQuery; - scrollView:JQuery; - renderedLines:JQuery; - underlayer:JQuery; - hiddenInput:JQuery; - verticalScrollbar:JQuery; - verticalScrollbarContent:JQuery; - - constructor(editor:AtomCore.IEditor); - - initialize(editorOrOptions:AtomCore.IEditor):void; // return type are same as editor method. - initialize(editorOrOptions?:{editor: AtomCore.IEditor; mini:any; placeholderText:any}):void; - - initialize(editorOrOptions:{}):void; // compatible for spacePen.View - - bindKeys():void; - - getEditor():AtomCore.IEditor; - - getText():string; - - setText(text:string):void; - - insertText(text:string, options?:any):TextBuffer.IRange[]; - - setHeightInLines(heightInLines:number):number; - - setWidthInChars(widthInChars:number):number; - - pageDown():void; - - pageUp():void; - - getPageRows():number; - - setShowInvisibles(showInvisibles:boolean):void; - - setInvisibles(invisibles:{ eol:string; space: string; tab: string; cr: string; }):void; - - setShowIndentGuide(showIndentGuide:boolean):void; - - setPlaceholderText(placeholderText:string):void; - - getPlaceholderText():string; - - checkoutHead():boolean; - - configure():Emissary.ISubscription; - - handleEvents():void; - - handleInputEvents():void; - - bringHiddenInputIntoView():JQuery; - - selectOnMousemoveUntilMouseup():any; - - afterAttach(onDom:any):any; - - edit(editor:AtomCore.IEditor):any; - - getModel():AtomCore.IEditor; - - setModel(editor:AtomCore.IEditor):any; - - showBufferConflictAlert(editor:AtomCore.IEditor):any; - - scrollTop(scrollTop:number, options?:any):any; - - scrollBottom(scrollBottom?:number):any; - - scrollLeft(scrollLeft?:number):number; - - scrollRight(scrollRight?:number):any; - - scrollToBottom():any; - - scrollToCursorPosition():any; - - scrollToBufferPosition(bufferPosition:any, options:any):any; - - scrollToScreenPosition(screenPosition:any, options:any):any; - - scrollToPixelPosition(pixelPosition:any, options:any):any; - - highlightFoldsContainingBufferRange(bufferRange:any):any; - - saveScrollPositionForEditor():any; - - toggleSoftTabs():any; - - toggleSoftWrap():any; - - calculateWidthInChars():number; - - calculateHeightInLines():number; - - getScrollbarWidth():number; - - setSoftWrap(softWrap:boolean):any; - - setFontSize(fontSize:number):any; - - getFontSize():number; - - setFontFamily(fontFamily?:string):any; - - getFontFamily():string; - - setLineHeight(lineHeight:number):any; - - redraw():any; - - splitLeft():any; - - splitRight():any; - - splitUp():any; - - splitDown():any; - - getPane():any; // return type are PaneView - - remove(selector:any, keepData:any):any; - - beforeRemove():any; - - getCursorView(index?:number):any; // return type are CursorView - - getCursorViews():any[]; // return type are CursorView[] - - addCursorView(cursor:any, options:any):any; // return type are CursorView - - removeCursorView(cursorView:any):any; - - getSelectionView(index?:number):any; // return type are SelectionView - - getSelectionViews():any[]; // return type are SelectionView[] - - addSelectionView(selection:any):any; - - removeSelectionView(selectionView:any):any; - - removeAllCursorAndSelectionViews():any[]; - - appendToLinesView(view:any):any; - - scrollVertically(pixelPosition:any, _arg:any):any; - - scrollHorizontally(pixelPosition:any):any; - - calculateDimensions():number; - - recalculateDimensions():any; - - updateLayerDimensions():any; - - isHidden():boolean; - - clearRenderedLines():void; - - resetDisplay():any; - - requestDisplayUpdate():any; - - updateDisplay(options?:any):any; - - updateCursorViews():any; - - shouldUpdateCursor(cursorView:any):any; - - updateSelectionViews():any[]; - - shouldUpdateSelection(selectionView:any):any; - - syncCursorAnimations():any[]; - - autoscroll(suppressAutoscroll?:any):any[]; - - updatePlaceholderText():any; - - updateRenderedLines(scrollViewWidth:any):any; - - computeSurroundingEmptyLineChanges(change:any):any; - - computeIntactRanges(renderFrom:any, renderTo:any):any; - - truncateIntactRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - clearDirtyRanges(intactRanges:any):any; - - clearLine(lineElement:any):any; - - fillDirtyRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - updatePaddingOfRenderedLines():any; - - getFirstVisibleScreenRow():number; - - getLastVisibleScreenRow():number; - - isScreenRowVisible():boolean; - - handleScreenLinesChange(change:any):any; - - buildLineElementForScreenRow(screenRow:any):any; - - buildLineElementsForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenLine(screenLine:any, screenRow:any):any; - - buildIndentation(screenRow:any, editor:any):any; - - buildHtmlEndOfLineInvisibles(screenLine:any):any; - - getEndOfLineInvisibles(screenLine:any):any; - - lineElementForScreenRow(screenRow:any):any; - - toggleLineCommentsInSelection():any; - - pixelPositionForBufferPosition(position:any):any; - - pixelPositionForScreenPosition(position:any):any; - - positionLeftForLineAndColumn(lineElement:any, screenRow:any, screenColumn:any):any; - - measureToColumn(lineElement:any, tokenizedLine:any, screenColumn:any):any; - - getCharacterWidthCache(scopes:any, char:any):any; - - setCharacterWidthCache(scopes:any, char:any, val:any):any; - - clearCharacterWidthCache():any; - - pixelOffsetForScreenPosition(position:any):any; - - screenPositionFromMouseEvent(e:any):any; - - highlightCursorLine():any; - - copyPathToClipboard():any; - - buildLineHtml(_arg:any):any; - - updateScopeStack(line:any, scopeStack:any, desiredScopes:any):any; - - pushScope(line:any, scopeStack:any, scope:any):any; - - popScope(line:any, scopeStack:any):any; - - buildEmptyLineHtml(showIndentGuide:any, eolInvisibles:any, htmlEolInvisibles:any, indentation:any, editor:any, mini:any):any; - - replaceSelectedText(replaceFn:(str:string)=>string):any; - - consolidateSelections(e:any):any; - - logCursorScope():any; - - logScreenLines(start:any, end:any):any; - - logRenderedLines():any; - } - - class ScrollView extends View { - // TBD - } - - interface ISelectListItem { - /** e.g. application:about */ - eventName:string; - /** e.g. Application: About */ - eventDescription:string; - } - - class SelectListView extends View { - static content():any; - - maxItems:number; - scheduleTimeout:any; - inputThrottle:number; - cancelling:boolean; - items:any[]; - list:JQuery; - filterEditorView: JQuery; - - previouslyFocusedElement:JQuery; - - initialize():any; - - schedulePopulateList():number; - - setItems(items:any[]):any; - - setError(message?:string):any; - - setLoading(message?:string):any; - - getFilterQuery():string; - - populateList():any; - - getEmptyMessage(itemCount?:any, filteredItemCount?:any):string; - - setMaxItems(maxItems:number):void; - - selectPreviousItemView():any; - - selectNextItemView():any; - - selectItemView(view:any):any; - - scrollToItemView(view:any):any; - - getSelectedItemView():any; - - getSelectedItem():any; - - confirmSelection():any; - - viewForItem(item:any):JQuery|string|HTMLElement|View; // You must override this method! - confirmed(item:any):any; // You must override this method! - getFilterKey():any; - - focusFilterEditor():any; - - storeFocusedElement():any; - - restoreFocus():any; - - cancelled():any; - - cancel():any; - } - - class Disposable extends AtomCore.Disposable { } - class CompositeDisposable extends AtomCore.CompositeDisposable { } - - var WorkspaceView:AtomCore.IWorkspaceViewStatic; - - var Task:AtomCore.ITaskStatic; - var Workspace:AtomCore.IWorkspaceStatic; -} +export { CompositeDisposable, Disposable, Emitter } from "event-kit"; +export { File, Directory } from "pathwatcher"; + +/** A wrapper which provides standard error/output line buffering for + * Node's ChildProcess. + */ +export const BufferedProcess: AtomCore.Statics.BufferedProcess; + +/** Like BufferedProcess, but accepts a Node script as the command to run. + * This is necessary on Windows since it doesn't support shebang #! lines. + */ +export const BufferedNodeProcess: AtomCore.Statics.BufferedNodeProcess; + +/** Represents the underlying git operations performed by Atom. */ +export const GitRepository: AtomCore.Statics.GitRepository; + +/** A notification to the user containing a message and type. */ +export const Notification: AtomCore.Statics.Notification; + +/** Represents a point in a buffer in row/column coordinates. */ +export const Point: TextBuffer.Statics.Point; + +/** Represents a region in a buffer in row/column coordinates. */ +export const Range: TextBuffer.Statics.Range; + +/** Run a node script in a separate process. */ +export const Task: AtomCore.Statics.Task; + +/** A mutable text container with undo/redo support and the ability to annotate + * logical regions in the text. + */ +export const TextBuffer: TextBuffer.Statics.TextBuffer; + +/** This class represents all essential editing state for a single TextBuffer, + * including cursor and selection positions, folds, and soft wraps. + */ +export const TextEditor: AtomCore.Statics.TextEditor; + +/** Invoke a callback with each filesystem event that occurs beneath a specified path. + * If you only need to watch events within the project's root paths, use + * Project::onDidChangeFiles instead. + */ +export function watchPath(rootPath: string, options: {}, eventCallback: (events: + AtomCore.Events.FilesystemChange) => void): AtomCore.PathWatcher; diff --git a/types/atom/services/index.d.ts b/types/atom/services/index.d.ts new file mode 100644 index 0000000000..33b85ff511 --- /dev/null +++ b/types/atom/services/index.d.ts @@ -0,0 +1,190 @@ +/* tslint:disable:no-unnecessary-qualifier */ +declare namespace Atom { + namespace Services { + /** Type definitions for autocomplete+ 2 */ + namespace Autocomplete { + /** Objects that appear as parameters to callbacks. */ + namespace Events { + /** The parameters passed into getSuggestions by Autocomplete+. */ + interface SuggestionsRequested { + /** The current TextEditor. */ + editor: Atom.TextEditor; + + /** The position of the cursor. */ + bufferPosition: Atom.Point; + + /** The scope descriptor for the current cursor position. */ + scopeDescriptor: Atom.ScopeDescriptor; + + /** The prefix for the word immediately preceding the current cursor position. */ + prefix: string; + + /** Whether the autocomplete request was initiated by the user. */ + activatedManually: boolean; + } + + /** The parameters passed into onDidInsertSuggestion by Autocomplete+. */ + interface SuggestionInserted { + editor: Atom.TextEditor; + triggerPosition: Atom.Point; + suggestion: TextSuggestion|SnippetSuggestion; + } + } + + /** An autocompletion suggestion for the user. + * Primary data type for the Atom Autocomplete+ service. + */ + interface Suggestion { + /** A string that will show in the UI for this suggestion. + * When not set, snippet || text is displayed. + */ + displayText?: string; + + /** The text immediately preceding the cursor, which will be replaced by the text. + * If not provided, the prefix passed into getSuggestions will be used. + */ + replacementPrefix?: string; + + /** The suggestion type. It will be converted into an icon shown against the suggestion. */ + type?: string; + + /** This is shown before the suggestion. Useful for return values. */ + leftLabel?: string; + + /** Use this instead of leftLabel if you want to use html for the left label. */ + leftLabelHTML?: string; + + /** An indicator (e.g. function, variable) denoting the "kind" of suggestion this represents. */ + rightLabel?: string; + + /** Use this instead of rightLabel if you want to use html for the right label. */ + rightLabelHTML?: string; + + /** Class name for the suggestion in the suggestion list. Allows you to style your suggestion + * via CSS, if desired. + */ + className?: string; + + /** If you want complete control over the icon shown against the suggestion. e.g. iconHTML: + * + */ + iconHTML?: string; + + /** A doc-string summary or short description of the suggestion. When specified, it will be + * displayed at the bottom of the suggestions list. + */ + description?: string; + + /** A url to the documentation or more information about this suggestion. When specified, + * a More.. link will be displayed in the description area. + */ + descriptionMoreURL?: string; + } + + interface TextSuggestion extends Suggestion { + /** The text which will be inserted into the editor, in place of the prefix. */ + text: string; + } + + interface SnippetSuggestion extends Suggestion { + /** A snippet string. This will allow users to tab through function arguments or other + * options. + */ + snippet: string; + } + + type Suggestions = Array; + + interface Provider { + /** Defines the scope selector(s) (can be comma-separated) for which your provider + * should receive suggestion requests. + */ + selector: string; + + /** Is called when a suggestion request has been dispatched by autocomplete+ to your + * provider. Return an array of suggestions (if any) in the order you would like them + * displayed to the user. Returning a Promise of an array of suggestions is also + * supported. + */ + getSuggestions(params: Events.SuggestionsRequested): Suggestions|Promise; + + /** Defines the scope selector(s) (can be comma-separated) for which your provider + * should not be used. + */ + disableForSelector?: string; + + /** A number to indicate its priority to be included in a suggestions request. + * The default provider has an inclusion priority of 0. Higher priority providers + * can suppress lower priority providers with excludeLowerPriority. + */ + inclusionPriority?: number; + + /** Will not use lower priority providers when this provider is used. */ + excludeLowerPriority?: boolean; + + /** A number to determine the sort order of suggestions. The default provider has + * an suggestion priority of 1. + */ + suggestionPriority?: number; + + /** Function that is called when a suggestion from your provider was inserted + * into the buffer. + */ + onDidInsertSuggestion?(params: Events.SuggestionInserted): void; + + /** Will be called if your provider is being destroyed by autocomplete+ */ + dispose?(): void; + } + } + + /** Type definitions for status-bar 1.8 */ + namespace StatusBar { + /** Objects that appear as parameters to functions. */ + namespace Options { + interface AddTile { + /** A DOM element, a jQuery object, or a model object for which a view provider + * has been registered in the the view registry. + */ + item: object; + + /** Determines the placement of the tile within the status bar. Lower priority + * will result in closer placement to the anchor. + */ + priority: number; + } + } + + interface Tile { + /** Retrieve the priority that was assigned to the Tile when it was created. */ + getPriority(): number; + + /** Retrieve the Tile's item. */ + getItem(): object; + + /** Remove the Tile from the status bar. */ + destroy(): void; + } + + interface StatusBar { + /** Add a tile to the left side of the status bar. Lower priority tiles are placed + * further to the left. + */ + addLeftTile(options: Options.AddTile): Tile; + + /** Add a tile to the right side of the status bar. Lower priority tiles are placed + * further to the right. + */ + addRightTile(options: Options.AddTile): Tile; + + /** Retrieve all of the tiles on the left side of the status bar. */ + getLeftTiles(): Tile[]; + + /** Retrieve all of the tiles on the right side of the status bar. */ + getRightTiles(): Tile[]; + } + + type Consumer = (statusBar: StatusBar) => void; + } + } +} +/* tslint:enable:no-unnecessary-qualifier */ diff --git a/types/atom/tsconfig.json b/types/atom/tsconfig.json index 6c1bb13aef..794b99eadc 100644 --- a/types/atom/tsconfig.json +++ b/types/atom/tsconfig.json @@ -7,21 +7,19 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" ], - "paths": { - "q": [ "q/v0" ] - }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "api-docs.d.ts", - "atom-tests.ts" + "atom-tests.ts", + "services/index.d.ts" ] } \ No newline at end of file diff --git a/types/atom/tslint.json b/types/atom/tslint.json new file mode 100644 index 0000000000..adbd6dcf49 --- /dev/null +++ b/types/atom/tslint.json @@ -0,0 +1,38 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Custom rules. + "await-promise": [true, "CancellablePromise"], + "class-name": true, + "indent": [true, "tabs"], + "jsdoc-format": true, + "max-line-length": [true, 100], + "quotemark": [true, "double", "avoid-escape"], + "trailing-comma": [true, { + "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, + "singleline": { "objects": "never", "arrays": "never", "functions": "never" } + }], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type", + "check-typecast", + "check-rest-spread", + "check-preblock" + ], + // Soon to be defaults. + "arrow-return-shorthand": [true, "multiline"], + "no-any": true, + "no-floating-promises": true, + "no-unbound-method": true, + "no-unsafe-any": true, + "number-literal-format": true, + "restrict-plus-operands": true, + "return-undefined": true, + "switch-final-break": true + } +} diff --git a/types/atom/api-docs.d.ts b/types/atom/v0/api-docs.d.ts similarity index 100% rename from types/atom/api-docs.d.ts rename to types/atom/v0/api-docs.d.ts diff --git a/types/atom/v0/atom-tests.ts b/types/atom/v0/atom-tests.ts new file mode 100644 index 0000000000..5987f4901d --- /dev/null +++ b/types/atom/v0/atom-tests.ts @@ -0,0 +1,70 @@ +import path = require("path"); +import _atom = require("atom"); + +import PathWatcher = require("pathwatcher"); +var File = PathWatcher.File; + +const jq: JQuery = $("selector"); + +class SampleView extends _atom.ScrollView { + + editorId:string; + file:PathWatcher.IFile; + editor:AtomCore.IEditor; + + static deserialize(state:any):SampleView { + return new SampleView(state); + } + + static content():any { + return this.div({class: 'sample native-key-bindings', tabindex: -1}); + } + + constructor(params:{editorId?:string; filePath?:string;} = {}) { + super(); + + this.editorId = params.editorId; + + if (this.editorId) { + this.resolveEditor(this.editorId); + } else { + this.file = new File(params.filePath); + } + } + + serialize() { + return { + deserializer: 'SampleView', + editorId: this.editorId + }; + } + + destroy() { + this.unsubscribe(); + } + + resolveEditor(editorId:string) { + var resolve = ()=> { + if (this.editor) { + jq.trigger("title-changed"); + } else { + var view = jq.parents('.pane').view(); + if (view) { + view.destroyItem(this); + } + } + }; + + if (atom.workspace) { + resolve(); + } else { + atom.packages.once("activated", ()=> { + resolve(); + }); + } + } +} + +atom.deserializers.add(SampleView); + +export = SampleView; diff --git a/types/atom/v0/index.d.ts b/types/atom/v0/index.d.ts new file mode 100644 index 0000000000..7dba05663c --- /dev/null +++ b/types/atom/v0/index.d.ts @@ -0,0 +1,1977 @@ +// Type definitions for Atom +// Project: https://atom.io/ +// Definitions by: vvakame , smhxx +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// +/// +/// +/// +/// + +// Policy: this definition file only declare element related to `atom`. +// if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). +// you should create a separate file. + +// API documentation : https://atom.io/docs/api/v1.20.1 + +interface Window { + atom: AtomCore.IAtom; + measure(description:string, fn:Function):any; // return fn result + profile(description:string, fn:Function):any; // return fn result +} + +declare namespace AtomCore { + + // https://atom.io/docs/v0.84.0/advanced/view-system + interface IWorkspaceViewStatic { + new ():IWorkspaceView; + version: number; + configDefaults:any; + content():any; + } + + interface Decoration { + destroy(): void; + } + + /** + * Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used + * to represent cursors, folds, snippet targets, misspelled words, any anything else that needs to track a + * logical location in the buffer over time. + */ + interface Marker { + /** + * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, a marker cannot be + * restored by undo/redo operations. + */ + destroy(): void; + + /** + * Gets the screen range of the display marker. + */ + getScreenRange(): Range; + } + + interface IWorkspaceView extends View { + // Delegator.includeInto(WorkspaceView); + + // delegate to model property's property + fullScreen:boolean; + + // delegate to model property's method + open(uri:string, options:any):Q.Promise; + openSync(uri:string, options?:any):any; + saveActivePaneItem():any; + saveActivePaneItemAs():any; + saveAll():void; + destroyActivePaneItem():any; + destroyActivePane():any; + increaseFontSize():void; + decreaseFontSize():void; + + // own property & methods + initialize(model:IWorkspace):any; + initialize(view:View, args:any):void; // do not use + model:IWorkspace; + panes: IPaneContainerView; + getModel():IWorkspace; + installShellCommands():any; + handleFocus():any; + afterAttach(onDom?:any):any; + confirmClose():boolean; + updateTitle():any; + setTitle(title:string):any; + getEditorViews():any[]; // atom.EditorView + prependToTop(element:any):any; + appendToTop(element:any):any; + prependToBottom(element:any):any; + appendToBottom(element:any):any; + prependToLeft(element:any):any; + appendToLeft(element:any):any; + prependToRight(element:any):any; + appendToRight(element:any):any; + getActivePaneView():IPaneView; + getActiveView():View; + focusPreviousPaneView():any; + focusNextPaneView():any; + focusPaneViewAbove():any; + focusPaneViewBelow():any; + focusPaneViewOnLeft():any; + focusPaneViewOnRight():any; + eachPaneView(callback:(paneView:IPaneView)=>any):{ off():any; }; + getPaneViews():IPaneView[]; + eachEditorView(callback:(editorView:any /* EditorView */)=>any):{ off():any; }; + beforeRemove():any; + + command(eventName:string, handler:Function):any; + command(eventName:string, selector:Function, handler:Function):any; + command(eventName:string, options:any, handler:Function):any; + command(eventName:string, selector:Function, options:any, handler:Function):any; + + statusBar:StatusBar.IStatusBarView; + } + + interface IPanes { + // TBD + } + + interface IPaneView { + // TBD + } + + interface IPaneContainerView { + // TBD + } + + interface ITreeView { + // TBD + } + + interface IGutterViewStatic { + new(): IGutterView; + content():any; + } + + interface IGutterView extends View { + firstScreenRow:any; + lastScreenRow:any; + initialize():void; + initialize(view:View, args:any):void; // do not use + afterAttach(onDom?:any):any; + beforeRemove():any; + handleMouseEvents(e:JQueryMouseEventObject):any; + getEditorView():any; /* EditorView */ + getEditor():IEditor; + getLineNumberElements():HTMLCollection; + getLineNumberElementsForClass(klass:string):NodeList; + getLineNumberElement(bufferRow:number):NodeList; + addClassToAllLines(klass:string):boolean; + removeClassFromAllLines(klass:string):boolean; + addClassToLine(bufferRow:number, klass:string):boolean; + removeClassFromLine(bufferRow:number, klass:string):boolean; + updateLineNumbers(changes:any[], startScreenRow?:number, endScreenRow?:number):any; + prependLineElements(lineElements:any):void; + appendLineElements(lineElements:any):void; + removeLineElements(numberOfElements:number):void; + buildLineElements(startScreenRow:any, endScreenRow:any):any; + buildLineElementsHtml(startScreenRow:any, endScreenRow:any):any; + updateFoldableClasses(changes:any[]):any; + removeLineHighlights():void; + addLineHighlight(row:number, emptySelection?:boolean):any; + highlightLines():boolean; + } + + interface ICommandRegistry { + add(target: string, commandName: Object, callback?: (event: any) => void): any; // selector:'atom-editor'|'atom-workspace' + findCommands(params: Object): Object[]; + dispatch(selector: any, name:string): void; + } + + interface ICommandPanel { + // TBD + } + + interface IDisplayBufferStatic { + new(_arg?:any):IDisplayBuffer; + } + + interface IDisplayBuffer /* extends Theorist.Model */ { + // Serializable.includeInto(Editor); + + constructor:IDisplayBufferStatic; + + verticalScrollMargin:number; + horizontalScrollMargin:number; + + declaredPropertyValues:any; + tokenizedBuffer: ITokenizedBuffer; + buffer: TextBuffer.ITextBuffer; + charWidthsByScope:any; + markers:{ [index:number]:IDisplayBufferMarker; }; + foldsByMarkerId:any; + maxLineLength:number; + screenLines:ITokenizedLine[]; + rowMap:any; // return type are RowMap + longestScreenRow:number; + subscriptions:Emissary.ISubscription[]; + subscriptionsByObject:any; // return type are WeakMap + behaviors:any; + subscriptionCounts:any; + eventHandlersByEventName:any; + pendingChangeEvent:any; + + softWrap:boolean; + + serializeParams():{id:number; softWrap:boolean; editorWidthInChars: number; scrollTop: number; scrollLeft: number; tokenizedBuffer: any; }; + deserializeParams(params:any):any; + copy():IDisplayBuffer; + updateAllScreenLines():any; + emitChanged(eventProperties:any, refreshMarkers?:boolean):any; + updateWrappedScreenLines():any; + setVisible(visible:any):any; + getVerticalScrollMargin():number; + setVerticalScrollMargin(verticalScrollMargin:number):number; + getHorizontalScrollMargin():number; + setHorizontalScrollMargin(horizontalScrollMargin:number):number; + getHeight():any; + setHeight(height:any):any; + getWidth():any; + setWidth(newWidth:any):any; + getScrollTop():number; + setScrollTop(scrollTop:number):number; + getScrollBottom():number; + setScrollBottom(scrollBottom:number):number; + getScrollLeft():number; + setScrollLeft(scrollLeft:number):number; + getScrollRight():number; + setScrollRight(scrollRight:number):number; + getLineHeight():any; + setLineHeight(lineHeight:any):any; + getDefaultCharWidth():any; + setDefaultCharWidth(defaultCharWidth:any):any; + getScopedCharWidth(scopeNames:any, char:any):any; + getScopedCharWidths(scopeNames:any):any; + setScopedCharWidth(scopeNames:any, char:any, width:any):any; + setScopedCharWidths(scopeNames:any, charWidths:any):any; + clearScopedCharWidths():any; + getScrollHeight():number; + getScrollWidth():number; + getVisibleRowRange():number[]; + intersectsVisibleRowRange(startRow:any, endRow:any):any; + selectionIntersectsVisibleRowRange(selection:any):any; + scrollToScreenRange(screenRange:any):any; + scrollToScreenPosition(screenPosition:any):any; + scrollToBufferPosition(bufferPosition:any):any; + pixelRectForScreenRange(screenRange:TextBuffer.IRange):any; + getTabLength():number; + setTabLength(tabLength:number):any; + setSoftWrap(softWrap:boolean):boolean; + getSoftWrap():boolean; + setEditorWidthInChars(editorWidthInChars:number):any; + getEditorWidthInChars():number; + getSoftWrapColumn():number; + lineForRow(row:number):any; + linesForRows(startRow:number, endRow:number):any; + getLines():any[]; + indentLevelForLine(line:any):any; + bufferRowsForScreenRows(startScreenRow:any, endScreenRow:any):any; + createFold(startRow:number, endRow:number):IFold; + isFoldedAtBufferRow(bufferRow:number):boolean; + isFoldedAtScreenRow(screenRow:number):boolean; + destroyFoldWithId(id:number):any; + unfoldBufferRow(bufferRow:number):any[]; + largestFoldStartingAtBufferRow(bufferRow:number):any; + foldsStartingAtBufferRow(bufferRow:number):any; + largestFoldStartingAtScreenRow(screenRow:any):any; + largestFoldContainingBufferRow(bufferRow:any):any; + outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; + foldsContainingBufferRow(bufferRow:any):any[]; + screenRowForBufferRow(bufferRow:number):number; + lastScreenRowForBufferRow(bufferRow:number):number; + bufferRowForScreenRow(screenRow:number):number; + + screenRangeForBufferRange(bufferRange:TextBuffer.IPoint[]):TextBuffer.IRange; + + screenRangeForBufferRange(bufferRange:TextBuffer.IRange):TextBuffer.IRange; + + screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; + screenRangeForBufferRange(bufferRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; + screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; + + screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; + screenRangeForBufferRange(bufferRange:{start: number[]; end: number[]}):TextBuffer.IRange; + screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; + + screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; + screenRangeForBufferRange(bufferRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; + screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; + + bufferRangeForScreenRange(screenRange:TextBuffer.IPoint[]):TextBuffer.IRange; + + bufferRangeForScreenRange(screenRange:TextBuffer.IRange):TextBuffer.IRange; + + bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; + + bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:{start: number[]; end: number[]}):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; + + bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; + + pixelRangeForScreenRange(screenRange:TextBuffer.IPoint[], clip?:boolean):TextBuffer.IRange; + + pixelRangeForScreenRange(screenRange:TextBuffer.IRange, clip?:boolean):TextBuffer.IRange; + + pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; + pixelRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; + pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; + + pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}, clip?:boolean):TextBuffer.IRange; + pixelRangeForScreenRange(screenRange:{start: number[]; end: number[]}, clip?:boolean):TextBuffer.IRange; + pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}, clip?:boolean):TextBuffer.IRange; + + pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; + pixelRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; + pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; + + pixelPositionForScreenPosition(screenPosition:TextBuffer.IPoint, clip?:boolean):TextBuffer.IPoint; + pixelPositionForScreenPosition(screenPosition:number[], clip?:boolean):TextBuffer.IPoint; + pixelPositionForScreenPosition(screenPosition:{row:number; col:number;}, clip?:boolean):TextBuffer.IPoint; + + screenPositionForPixelPosition(pixelPosition:any):TextBuffer.IPoint; + + pixelPositionForBufferPosition(bufferPosition:any):any; + getLineCount():number; + getLastRow():number; + getMaxLineLength():number; + screenPositionForBufferPosition(bufferPosition:any, options:any):any; + bufferPositionForScreenPosition(bufferPosition:any, options:any):any; + scopesForBufferPosition(bufferPosition:any):any; + bufferRangeForScopeAtPosition(selector:any, position:any):any; + tokenForBufferPosition(bufferPosition:any):any; + getGrammar():IGrammar; + setGrammar(grammar:IGrammar):any; + reloadGrammar():any; + clipScreenPosition(screenPosition:any, options:any):any; + findWrapColumn(line:any, softWrapColumn:any):any; + rangeForAllLines():TextBuffer.IRange; + getMarker(id:number):IDisplayBufferMarker; + getMarkers():IDisplayBufferMarker[]; + getMarkerCount():number; + markScreenRange(range:TextBuffer.IRange, ...args:any[]):IDisplayBufferMarker; + markBufferRange(range:TextBuffer.IRange, options?:any):IDisplayBufferMarker; + markScreenPosition(screenPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; + markBufferPosition(bufferPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; + destroyMarker(id:number):any; + findMarker(params?:any):IDisplayBufferMarker; + findMarkers(params?:any):IDisplayBufferMarker[]; + translateToBufferMarkerParams(params?:any):any; + findFoldMarker(attributes:any):IMarker; + findFoldMarkers(attributes:any):IMarker[]; + getFoldMarkerAttributes(attributes?:any):any; + pauseMarkerObservers():any; + resumeMarkerObservers():any; + refreshMarkerScreenPositions():any; + destroy():any; + logLines(start:number, end:number):any[]; + handleTokenizedBufferChange(tokenizedBufferChange:any):any; + updateScreenLines(startBufferRow:any, endBufferRow:any, bufferDelta?:number, options?:any):any; + buildScreenLines(startBufferRow:any, endBufferRow:any):any; + findMaxLineLength(startScreenRow:any, endScreenRow:any, newScreenLines:any):any; + handleBufferMarkersUpdated():any; + handleBufferMarkerCreated(marker:any):any; + createFoldForMarker(maker:any):IFold; + foldForMarker(marker:any):any; + } + + interface IViewRegistry { + getView(selector:any):any; + } + + interface ICursorStatic { + new (arg:{editor:IEditor; marker:IDisplayBufferMarker; id: number;}):ICursor; + } + + interface ScopeDescriptor { + scopes: string[]; + } + + interface ICursor /* extends Theorist.Model */ { + getScopeDescriptor(): ScopeDescriptor; + screenPosition:any; + bufferPosition:any; + goalColumn:any; + visible:boolean; + needsAutoscroll:boolean; + + editor:IEditor; + marker:IDisplayBufferMarker; + id: number; + + destroy():any; + changePosition(options:any, fn:Function):any; + getPixelRect():any; + setScreenPosition(screenPosition:any, options?:any):any; + getScreenPosition():TextBuffer.IPoint; + getScreenRange():TextBuffer.IRange; + setBufferPosition(bufferPosition:any, options?:any):any; + getBufferPosition():TextBuffer.IPoint; + autoscroll():any; + updateVisibility():any; + setVisible(visible:boolean):any; + isVisible():boolean; + wordRegExp(arg?:any):any; + isLastCursor():boolean; + isSurroundedByWhitespace():boolean; + isBetweenWordAndNonWord():boolean; + isInsideWord():boolean; + clearAutoscroll():void; + clearSelection():void; + getScreenRow():number; + getScreenColumn():number; + getBufferRow():number; + getBufferColumn():number; + getCurrentBufferLine():string; + moveUp(rowCount:number, arg?:any):any; + moveDown(rowCount:number, arg?:any):any; + moveLeft(arg?:any):any; + moveRight(arg?:any):any; + moveToTop():any; + moveToBottom():void; + moveToBeginningOfScreenLine():void; + moveToBeginningOfLine():void; + moveToFirstCharacterOfLine():void; + moveToEndOfScreenLine():void; + moveToEndOfLine():void; + moveToBeginningOfWord():void; + moveToEndOfWord():void; + moveToBeginningOfNextWord():void; + moveToPreviousWordBoundary():void; + moveToNextWordBoundary():void; + getBeginningOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; + getPreviousWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; + getMoveNextWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; + getEndOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; + getBeginningOfNextWordBufferPosition(options?:any):TextBuffer.IPoint; + getCurrentWordBufferRange(options?:any):TextBuffer.IPoint; + getCurrentLineBufferRange(options?:any):TextBuffer.IPoint; + getCurrentParagraphBufferRange():any; + getCurrentWordPrefix():string; + isAtBeginningOfLine():boolean; + getIndentLevel():number; + isAtEndOfLine():boolean; + getScopes():string[]; + hasPrecedingCharactersOnLine():boolean; + getMarker(): Marker; + } + + interface ILanguageMode { + // TBD + } + + interface ISelection { + // https://atom.io/docs/api/v1.7.3/Selection + + // Event Subscription + onDidChangeRange(callback: (event: { + oldBufferRange: TextBuffer.IRange; + oldScreenRange: TextBuffer.IRange; + newBufferRange: TextBuffer.IRange; + newScreenRange: TextBuffer.IRange; + selection: ISelection; + }) => {}): Disposable; + onDidDestroy(callback: () => {}): Disposable; + + // Managing the selection range + getScreenRange(): TextBuffer.IRange; + setScreenRange(screenRange: TextBuffer.IRange, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + getBufferRange(): TextBuffer.IRange; + setBufferRange(bufferRange: TextBuffer.IRange, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + getBufferRowRange(): [number]; + + // Info about the selection + isEmpty(): boolean; + isReversed(): boolean; + isSingleScreenLine(): boolean; + getText(): string; + intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; + intersectsWith(otherSelection: ISelection): boolean; + + // Modifying the selected range + clear(options?: {autoscroll?: boolean}): void; + selectToScreenPosition(position: any): void; + selectToBufferPosition(position: any): void; + selectRight(columnCount?: number): void; + selectLeft(columnCount?: number): void; + selectUp(rowCount: number): void; + selectDown(rowCount: number): void; + selectToTop(): void; + selectToBottom(): void; + selectAll(): void; + selectToBeginningOfLine(): void; + selectToFirstCharacterOfLine(): void; + selectToEndOfLine(): void; + selectToEndOfBufferLine(): void; + selectToBeginningOfWord(): void; + selectToEndOfWord(): void; + selectToBeginningOfNextWord(): void; + selectToPreviousWordBoundary(): void; + selectToNextWordBoundary(): void; + selectToPreviousSubwordBoundary(): void; + selectToNextSubwordBoundary(): void; + selectToBeginningOfNextParagraph(): void; + selectToBeginningOfPreviousParagraph(): void; + selectWord(): TextBuffer.IRange; + expandOverWord(): void; + selectLine(row?: number): void; + expandOverLine(): void; + + // Modifying the selected text + insertText(text: string, options?: { + select: boolean; + autoIndent: boolean; + autoIndentNewline: boolean; + autoDecreaseIndent: boolean; + normalizeLineEndings?: boolean; + undo?: 'skip'; + }): void; + backspace(): void; + deleteToPreviousWordBoundary(): void; + deleteToNextWordBoundary(): void; + deleteToBeginningOfWord(): void; + deleteToBeginningOfLine(): void; + delete(): void; + deleteToEndOfLine(): void; + deleteToEndOfWord(): void; + deleteToBeginningOfSubword(): void; + deleteToEndOfSubword(): void; + deleteSelectedText(): void; + deleteLine(): void; + joinLines(): void; + outdentSelectedRows(): void; + autoIndentSelectedRows(): void; + toggleLineComments(): void; + cutToEndOfLine(): void; + cutToEndOfBufferLine(): void; + cut(maintainClipboard?: boolean, fullLine?: boolean): void; + copy(maintainClipboard?: boolean, fullLine?: boolean): void; + fold(): void; + indentSelectedRows(): void; + + // Managing multiple selections + addSelectionBelow(): void; + addSelectionAbove(): void; + merge(otherSelection: ISelection, options?: { + preserveFolds?: boolean; + autoscroll?: boolean; + }): void; + + // Comparing to other selections + compare(otherSelection: ISelection): any; + } + + interface IDecorationParams { + id?: number; + class: string; + type: any /* string or string[] */; + } + + interface IDecorationStatic { + isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean; + new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration; + } + + interface IDecoration extends Emissary.IEmitter { + marker: IDisplayBufferMarker; + displayBuffer: IDisplayBuffer; + params: IDecorationParams + id: number; + flashQueue: any[]; + isDestroyed: boolean; + + destroy():void; + update(newParams:IDecorationParams):void; + getMarker():IDisplayBufferMarker; + getParams():IDecorationParams; + isType(type:string):boolean; + matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean; + flash(klass:string, duration?:number):void; + consumeNextFlash():any; + } + + interface IEditor { + // Serializable.includeInto(Editor); + // Delegator.includeInto(Editor); + + deserializing:boolean; + callDisplayBufferCreatedHook:boolean; + registerEditor:boolean; + buffer:TextBuffer.ITextBuffer; + languageMode: ILanguageMode; + cursors:ICursor[]; + selections: ISelection[]; + suppressSelectionMerging:boolean; + updateBatchDepth: number; + selectionFlashDuration: number; + softTabs: boolean; + displayBuffer: IDisplayBuffer; + + id:number; + behaviors:any; + declaredPropertyValues: any; + eventHandlersByEventName: any; + eventHandlersByNamespace: any; + lastOpened: number; + subscriptionCounts: any; + subscriptionsByObject: any; /* WeakMap */ + subscriptions: Emissary.ISubscription[]; + destroy():void; + + mini: any; + + serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;}; + deserializeParams(params:any):any; + subscribeToBuffer():void; + subscribeToDisplayBuffer():void; + getViewClass():any; // return type are EditorView + destroyed():void; + isDestroyed():boolean; + copy():IEditor; + getTitle():string; + getLongTitle():string; + setVisible(visible:boolean):void; + setMini(mini:any):void; + setScrollTop(scrollTop:any):void; + getScrollTop():number; + setScrollLeft(scrollLeft:any):void; + getScrollLeft():number; + setEditorWidthInChars(editorWidthInChars:any):void; + getSoftWrapColumn():number; + getSoftTabs():boolean; + setSoftTabs(softTabs:boolean):void; + getSoftWrap():boolean; + setSoftWrap(softWrap:any):void; + getTabText():string; + getTabLength():number; + setTabLength(tabLength:any):void; + usesSoftTabs():boolean; + clipBufferPosition(bufferPosition:any):void; + clipBufferRange(range:any):void; + indentationForBufferRow(bufferRow:any):void; + setIndentationForBufferRow(bufferRow:any, newLevel:any, _arg:any):void; + indentLevelForLine(line:any):number; + buildIndentString(number:any):string; + save():void; + saveAs(filePath:any):void; + copyPathToClipboard():void; + getPath():string; + getText():string; + setText(text:any):void; + getTextInRange(range:any):any; + getLineCount():number; + getBuffer():TextBuffer.ITextBuffer; + getURI():string; + isBufferRowBlank(bufferRow:any):boolean; + isBufferRowCommented(bufferRow:any):void; + nextNonBlankBufferRow(bufferRow:any):void; + getEofBufferPosition():TextBuffer.IPoint; + getLastBufferRow():number; + bufferRangeForBufferRow(row:any, options:any):TextBuffer.IRange; + lineForBufferRow(row:number):string; + lineLengthForBufferRow(row:number):number; + scan():any; + scanInBufferRange():any; + backwardsScanInBufferRange():any; + isModified():boolean; + isEmpty():boolean; + shouldPromptToSave():boolean; + screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint; + bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint; + screenRangeForBufferRange(bufferRange:any):TextBuffer.IRange; + bufferRangeForScreenRange(screenRange:any):TextBuffer.IRange; + clipScreenPosition(screenPosition:any, options:any):TextBuffer.IRange; + lineForScreenRow(row:any):ITokenizedLine; + linesForScreenRows(start?:any, end?:any):ITokenizedLine[]; + getScreenLineCount():number; + getMaxScreenLineLength():number; + getLastScreenRow():number; + bufferRowsForScreenRows(startRow:any, endRow:any):any[]; + bufferRowForScreenRow(row:any):number; + scopesForBufferPosition(bufferPosition:any):string[]; + bufferRangeForScopeAtCursor(selector:string):any; + tokenForBufferPosition(bufferPosition:any):IToken; + getCursorScopes():string[]; + logCursorScope():void; + insertText(text:string, options?:any):TextBuffer.IRange[]; + insertNewline():TextBuffer.IRange[]; + insertNewlineBelow():TextBuffer.IRange[]; + insertNewlineAbove():any; + indent(options?:any):any; + backspace():any[]; + // deprecated backspaceToBeginningOfWord():any[]; + // deprecated backspaceToBeginningOfLine():any[]; + deleteToBeginningOfWord():any[]; + deleteToBeginningOfLine():any[]; + delete():any[]; + deleteToEndOfLine():any[]; + deleteToEndOfWord():any[]; + deleteLine():TextBuffer.IRange[]; + indentSelectedRows():TextBuffer.IRange[][]; + outdentSelectedRows():TextBuffer.IRange[][]; + toggleLineCommentsInSelection():TextBuffer.IRange[]; + autoIndentSelectedRows():TextBuffer.IRange[][]; + normalizeTabsInBufferRange(bufferRange:any):any; + cutToEndOfLine():boolean[]; + cutSelectedText():boolean[]; + copySelectedText():boolean[]; + pasteText(options?:any):TextBuffer.IRange[]; + undo():any[]; + redo():any[]; + foldCurrentRow():any; + unfoldCurrentRow():any[]; + foldSelectedLines():any[]; + foldAll():any[]; + unfoldAll():any[]; + foldAllAtIndentLevel(level:any):any; + foldBufferRow(bufferRow:any):any; + unfoldBufferRow(bufferRow:any):any; + isFoldableAtBufferRow(bufferRow:any):boolean; + isFoldableAtScreenRow(screenRow:any):boolean; + createFold(startRow:any, endRow:any):IFold; + destroyFoldWithId(id:any):any; + destroyFoldsIntersectingBufferRange(bufferRange:any):any; + toggleFoldAtBufferRow(bufferRow:any):any; + isFoldedAtCursorRow():boolean; + isFoldedAtBufferRow(bufferRow:any):boolean; + isFoldedAtScreenRow(screenRow:any):boolean; + largestFoldContainingBufferRow(bufferRow:any):boolean; + largestFoldStartingAtScreenRow(screenRow:any):any; + outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; + moveLineUp():ISelection[]; + moveLineDown():ISelection[]; + duplicateLines():any[][]; + // duprecated duplicateLine():any[][]; + mutateSelectedText(fn:(selection:ISelection)=>any):any; + replaceSelectedText(options:any, fn:(selection:string)=>any):any; + decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]}; + decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration; + decorationForId(id:number):IDecoration; + getMarker(id:number):IDisplayBufferMarker; + getMarkers():IDisplayBufferMarker[]; + findMarkers(...args:any[]):IDisplayBufferMarker[]; + markScreenRange(...args:any[]):IDisplayBufferMarker; + markBufferRange(...args:any[]):IDisplayBufferMarker; + markScreenPosition(...args:any[]):IDisplayBufferMarker; + markBufferPosition(...args:any[]):IDisplayBufferMarker; + destroyMarker(...args:any[]):boolean; + getMarkerCount():number; + hasMultipleCursors():boolean; + getCursors():ICursor[]; + getCursor():ICursor; + addCursorAtScreenPosition(screenPosition:any):ICursor; + addCursorAtBufferPosition(bufferPosition:any):ICursor; + addCursor(marker:any):ICursor; + removeCursor(cursor:any):ICursor[]; + addSelection(marker:any, options:any):ISelection; + addSelectionForBufferRange(bufferRange:any, options:any):ISelection; + setSelectedBufferRange(bufferRange:any, options:any):any; + setSelectedBufferRanges(bufferRanges:any, options:any):any; + removeSelection(selection:ISelection):any; + clearSelections():boolean; + consolidateSelections():boolean; + selectionScreenRangeChanged(selection:any):void; + getSelections():ISelection[]; + getSelection(index?:number):ISelection; + getLastSelection():ISelection; + getSelectionsOrderedByBufferPosition():ISelection[]; + getLastSelectionInBuffer():ISelection; + selectionIntersectsBufferRange(bufferRange:any):any; + setCursorScreenPosition(position:TextBuffer.IPoint, options?:any):any; + getCursorScreenPosition():TextBuffer.IPoint; + getCursorScreenRow():number; + setCursorBufferPosition(position:any, options?:any):any; + getCursorBufferPosition():TextBuffer.IPoint; + getSelectedScreenRange():TextBuffer.IRange; + getSelectedBufferRange():TextBuffer.IRange; + getSelectedBufferRanges():TextBuffer.IRange[]; + getSelectedText():string; + getTextInBufferRange(range:TextBuffer.IRange):string; + setTextInBufferRange(range:TextBuffer.IRange | any[], text:string):any; + getCurrentParagraphBufferRange():TextBuffer.IRange; + getWordUnderCursor(options?:any):string; + moveCursorUp(lineCount?:number):void; + moveCursorDown(lineCount?:number):void; + moveCursorLeft():void; + moveCursorRight():void; + moveCursorToTop():void; + moveCursorToBottom():void; + moveCursorToBeginningOfScreenLine():void; + moveCursorToBeginningOfLine():void; + moveCursorToFirstCharacterOfLine():void; + moveCursorToEndOfScreenLine():void; + moveCursorToEndOfLine():void; + moveCursorToBeginningOfWord():void; + moveCursorToEndOfWord():void; + moveCursorToBeginningOfNextWord():void; + moveCursorToPreviousWordBoundary():void; + moveCursorToNextWordBoundary():void; + moveCursorToBeginningOfNextParagraph():void; + moveCursorToBeginningOfPreviousParagraph():void; + moveToBottom():void; + scrollToCursorPosition(options:any):any; + pageUp():void; + pageDown():void; + selectPageUp():void; + selectPageDown():void; + getRowsPerPage():number; + moveCursors(fn:(cursor:ICursor)=>any):any; + cursorMoved(event:any):void; + selectToScreenPosition(position:TextBuffer.IPoint):any; + selectRight():ISelection[]; + selectLeft():ISelection[]; + selectUp(rowCount?:number):ISelection[]; + selectDown(rowCount?:number):ISelection[]; + selectToTop():ISelection[]; + selectAll():ISelection[]; + selectToBottom():ISelection[]; + selectToBeginningOfLine():ISelection[]; + selectToFirstCharacterOfLine():ISelection[]; + selectToEndOfLine():ISelection[]; + selectToPreviousWordBoundary():ISelection[]; + selectToNextWordBoundary():ISelection[]; + selectLine():ISelection[]; + selectLinesContainingCursors():ISelection[]; + addSelectionBelow():ISelection[]; + addSelectionAbove():ISelection[]; + splitSelectionsIntoLines():any[]; + transpose():TextBuffer.IRange[]; + upperCase():boolean[]; + lowerCase():boolean[]; + joinLines():any[]; + selectToBeginningOfWord():ISelection[]; + selectToEndOfWord():ISelection[]; + selectToBeginningOfNextWord():ISelection[]; + selectWord():ISelection[]; + selectToBeginningOfNextParagraph():ISelection[]; + selectToBeginningOfPreviousParagraph():ISelection[]; + selectMarker(marker:any):any; + mergeCursors():number[]; + expandSelectionsForward():any; + expandSelectionsBackward(fn:(selection:ISelection)=>any):ISelection[]; + finalizeSelections():boolean[]; + mergeIntersectingSelections():any; + preserveCursorPositionOnBufferReload():Emissary.ISubscription; + getGrammar(): IGrammar; + setGrammar(grammer:IGrammar):void; + reloadGrammar():any; + shouldAutoIndent():boolean; + shouldShowInvisibles():boolean; + updateInvisibles():void; + transact(fn:Function):any; + beginTransaction():ITransaction; + commitTransaction():any; + abortTransaction():any[]; + inspect():string; + logScreenLines(start:number, end:number):any[]; + handleTokenization():void; + handleGrammarChange():void; + handleMarkerCreated(marker:any):any; + getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; }; + getVerticalScrollMargin():number; + setVerticalScrollMargin(verticalScrollMargin:number):void; + getHorizontalScrollMargin():number; + setHorizontalScrollMargin(horizontalScrollMargin:number):void; + getLineHeightInPixels():number; + setLineHeightInPixels(lineHeightInPixels:number):void; + batchCharacterMeasurement(fn:Function):void; + getScopedCharWidth(scopeNames:any, char:any):any; + setScopedCharWidth(scopeNames:any, char:any, width:any):any; + getScopedCharWidths(scopeNames:any):any; + clearScopedCharWidths():any; + getDefaultCharWidth():number; + setDefaultCharWidth(defaultCharWidth:number):void; + setHeight(height:number):void; + getHeight():number; + getClientHeight():number; + setWidth(width:number):void; + getWidth():number; + getScrollTop():number; + setScrollTop(scrollTop:number):void; + getScrollBottom():number; + setScrollBottom(scrollBottom:number):void; + getScrollLeft():number; + setScrollLeft(scrollLeft:number):void; + getScrollRight():number; + setScrollRight(scrollRight:number):void; + getScrollHeight():number; + getScrollWidth():number; + getVisibleRowRange():number; + intersectsVisibleRowRange(startRow:any, endRow:any):any; + selectionIntersectsVisibleRowRange(selection:any):any; + pixelPositionForScreenPosition(screenPosition:any):any; + pixelPositionForBufferPosition(bufferPosition:any):any; + screenPositionForPixelPosition(pixelPosition:any):any; + pixelRectForScreenRange(screenRange:any):any; + scrollToScreenRange(screenRange:any, options:any):any; + scrollToScreenPosition(screenPosition:any, options:any):any; + scrollToBufferPosition(bufferPosition:any, options:any):any; + horizontallyScrollable():any; + verticallyScrollable():any; + getHorizontalScrollbarHeight():any; + setHorizontalScrollbarHeight(height:any):any; + getVerticalScrollbarWidth():any; + setVerticalScrollbarWidth(width:any):any; + // deprecated joinLine():any; + + onDidChange(callback: Function): Disposable; + onDidDestroy(callback: Function): Disposable; + onDidStopChanging(callback: Function): Disposable; + onDidChangeCursorPosition(callback: Function): Disposable; + onDidSave(callback: (event: { path: string }) => void): Disposable; + + decorateMarker(marker: Marker, options: any): Decoration; + getLastCursor(): ICursor; + } + + interface IGrammar { + bundledPackage: boolean; + emitter: any; + fileTypes: [string]; + firstLineRegex: any; + foldingStopMarker: any; + includedGrammarScopes: [any]; + initialRule: any; + injectionSelector: any; + injections: any; + maxTokensPerLine: Number; + name: string; + packageName: string; + path: string; + rawPatterns: [any]; + rawRepository: any; + registration: Disposable; + registry: any; + repository: Object; + scopeName: string; + tokenizeLines: (text: string) => any; + // TBD + + } + + interface IGrammars { + grammarForScopeName(scope: string): IGrammar; + } + + interface IPane /* extends Theorist.Model */ { + itemForURI: (uri:string)=>IEditor; + items:any[]; + activeItem:any; + + serializeParams():any; + deserializeParams(params:any):any; + getViewClass():any; // return type are PaneView + isActive():boolean; + isDestroyed():boolean; + focus():void; + blur():void; + activate():void; + getPanes():IPane[]; + getItems():any[]; + getActiveItem():any; + getActiveEditor():any; + itemAtIndex(index:number):any; + activateNextItem():any; + activatePreviousItem():any; + getActiveItemIndex():number; + activateItemAtIndex(index:number):any; + activateItem(item:any):any; + addItem(item:any, index:number):any; + addItems(items:any[], index:number):any[]; + removeItem(item:any, destroying:any):void; + moveItem(item:any, newIndex:number):void; + moveItemToPane(item:any, pane:IPane, index:number):void; + destroyActiveItem():boolean; // always return false + destroyItem(item:any):boolean; + destroyItems():any[]; + destroyInactiveItems():any[]; + destroy():void; + destroyed():any[]; + promptToSaveItem(item:any):boolean; + saveActiveItem():void; + saveActiveItemAs():void; + saveItem(item:any, nextAction:Function):void; + saveItemAs(item:any, nextAction:Function):void; + saveItems():any[]; + activateItemForURI(uri:any):any; + copyActiveItem():void; + splitLeft(params:any):IPane; + splitRight(params:any):IPane; + splitUp(params:any):IPane; + splitDown(params:any):IPane; + split(orientation:string, side:string, params:any):IPane; + findLeftmostSibling():IPane; + findOrCreateRightmostSibling():IPane; + } + + // https://atom.io/docs/v0.84.0/advanced/serialization + interface ISerializationStatic { + deserialize(data:ISerializationInfo):T; + new (data:T): ISerialization; + } + + interface ISerialization { + serialize():ISerializationInfo; + } + + interface ISerializationInfo { + deserializer: string; + } + + interface IBrowserWindow { + getPosition():number[]; + getSize():number[]; + } + + interface IAtomWindowDimentions { + x:number; + y:number; + width:number; + height:number; + } + + interface IProjectStatic { + pathForRepositoryUrl(repoUrl:string):string; + + new (arg?:{path:any; buffers:any[];}):IProject; + } + + interface IProject /* extends Theorist.Model */ { + // Serializable.includeInto(Project); + + path:string; + /** deprecated */ + rootDirectory?:PathWatcher.IDirectory; + rootDirectories:PathWatcher.IDirectory[]; + + serializeParams():any; + deserializeParams(params:any):any; + destroyed():any; + destroyRepo():any; + destroyUnretainedBuffers():any; + getRepo():IGit; + getPath():string; + setPath(projectPath:string):any; + getRootDirectory():PathWatcher.IDirectory; + resolve(uri:string):string; + relativize(fullPath:string):string; + contains(pathToCheck:string):boolean; + open(filePath:string, options?:any):Q.Promise; + openSync(filePath:string, options?:any):IEditor; + getBuffers():TextBuffer.ITextBuffer; + isPathModified(filePath:string):boolean; + findBufferForPath(filePath:string):TextBuffer.ITextBuffer; + bufferForPathSync(filePath:string):TextBuffer.ITextBuffer; + bufferForPath(filePath:string):Q.Promise; + bufferForId(id:any):TextBuffer.ITextBuffer; + buildBufferSync(absoluteFilePath:string):TextBuffer.ITextBuffer; + buildBuffer(absoluteFilePath:string):Q.Promise; + addBuffer(buffer:TextBuffer.ITextBuffer, options?:any):any; + addBufferAtIndex(buffer:TextBuffer.ITextBuffer, index:number, options?:any):any; + scan(regex:any, options:any, iterator:any):Q.Promise; + replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise; + buildEditorForBuffer(buffer:any, editorOptions:any):IEditor; + eachBuffer(...args:any[]):any; + + onDidChangePaths(callback: Function): Disposable; + } + + interface IWorkspaceStatic { + new():IWorkspace; + } + + interface IWorkspacePanelOptions{ + item:any; + visible?:boolean; + priority?:number; + } + + interface Panel{ + getItem():any; + getPriority():any; + isVisible():boolean; + show():void; + hide():void; + } + + interface IWorkspace { + addBottomPanel(options:IWorkspacePanelOptions):Panel; + addLeftPanel(options:IWorkspacePanelOptions):Panel; + addRightPanel(options:IWorkspacePanelOptions):Panel; + addTopPanel(options:IWorkspacePanelOptions):Panel; + addModalPanel(options:IWorkspacePanelOptions):Panel; + addOpener(opener: Function): any; + + deserializeParams(params:any):any; + serializeParams():{paneContainer:any;fullScreen:boolean;}; + eachEditor(callback: Function): void; + getTextEditors():IEditor[]; + open(uri:string, options:any):Q.Promise; + openLicense():void; + openSync(uri:string, options:any):any; + openUriInPane(uri: string, pane: any, options: any): Q.Promise; + observeTextEditors(callback: Function): Disposable; + reopenItemSync():any; + registerOpener(opener:(urlToOpen:string)=>any):void; + unregisterOpener(opener:Function):void; + getOpeners():any; + getActivePane(): IPane; + getActivePaneItem(): IPane; + getActiveTextEditor(): IEditor; + getPanes():any; + saveAll():void; + activateNextPane():any; + activatePreviousPane():any; + paneForURI: (uri:string) => IPane; + saveActivePaneItem():any; + saveActivePaneItemAs():any; + destroyActivePaneItem():any; + destroyActivePane():any; + getActiveEditor():IEditor; + increaseFontSize():void; + decreaseFontSize():void; + resetFontSize():void; + itemOpened(item:any):void; + onPaneItemDestroyed(item:any):void; + destroyed():void; + isTextEditor(object: any): boolean; + + onDidChangeActivePaneItem(item:any):Disposable; + } + + interface IAtomSettings { + appVersion: string; + bootstrapScript: string; + devMode: boolean; + initialPath: string; + pathToOpen: string; + resourcePath: string; + shellLoadTime: number; + windowState:string; + } + + interface IAtomState { + mode:string; + packageStates:any; + project:any; + syntax:any; + version:number; + windowDimensions:any; + workspace:any; + } + + interface IDeserializerManager { + deserializers:Function; + add:Function; + remove:Function; + deserialize:Function; + get:Function; + } + + interface IColorlike { + red: number; + green: number; + blue: number; + alpha: number; + } + + class Color { + public static parse(value:string): Color + public static parse(value:IColorlike): Color + public toHexString(): string + public toRGBAString(): string + } + + interface IConfigGetOptions { + sources?:Array; + excludeSources?:Array; + scope?:ScopeDescriptor; + } + + interface IConfigSetOptions { + scopeSelector?:string; + source?:string; + } + + interface IConfigObserveOptions { + scope?:ScopeDescriptor; + } + + interface IConfigChangeEvent { + newValue:T; + oldValue:T; + } + + type ConfigSetting = string | number | boolean | Color | IConfigArray | IConfigObject + + interface IConfigArray extends Array { } + + interface IConfigObject { [key: string]: ConfigSetting } + + interface IConfig { + get(keyPath:string, options?:IConfigGetOptions):ConfigSetting; + set(keyPath:string, value:ConfigSetting, options?:IConfigSetOptions):boolean; + unset(keyPath:string, options?:IConfigSetOptions):void; + observe(keyPath:string, options?:IConfigObserveOptions, callback?:(value:ConfigSetting) => void):Disposable; + onDidChange(keyPath?:string, options?:IConfigObserveOptions, callback?:(event:IConfigChangeEvent) => void):Disposable; + } + + interface IKeymapManager { + defaultTarget:HTMLElement; + // TBD + } + + interface IPackage { + mainModulePath: string; + mainModule: any; + enable(): void; + disable(): void; + isTheme(): boolean; + getType(): string; + getStylesheetType(): string; + load(): IPackage; + reset(): void; + activate(): Q.Promise; + activateNow(): void; + // TBD + } + + interface IPackageManager extends Emissary.IEmitter { + packageDirPaths:string[]; + loadedPackages:any; + activePackages:any; + packageStates:any; + packageActivators:any[]; + + getApmPath():string; + getPackageDirPaths():string; + getPackageState(name:string):any; + setPackageState(name:string, state:any):void; + enablePackage(name:string):any; + disablePackage(name:string):any; + activate():void; + registerPackageActivator(activator:any, types:any):void; + activatePackages(packages:any):void; + activatePackage(name:string):Q.Promise; + deactivatePackages():void; + deactivatePackage(name:string):void; + getActivePackages():any; + getActivePackage(name:string):any; + isPackageActive(name:string):boolean; + unobserveDisabledPackages():void; + observeDisabledPackages():void; + loadPackages():void; + loadPackage(nameOrPath:string):void; + unloadPackages():void; + unloadPackage(name:string):void; + getLoadedPackage(name:string):any; + isPackageLoaded(name:string):boolean; + getLoadedPackages():any; + getLoadedPackagesForTypes(types:any):any[]; + resolvePackagePath(name:string):string; + isPackageDisabled(name:string):boolean; + hasAtomEngine(packagePath:string):boolean; + isBundledPackage(name:string):boolean; + getPackageDependencies():any; + getAvailablePackagePaths():any[]; + getAvailablePackageNames():any[]; + getAvailablePackageMetadata():any[]; + } + + interface INotifications { + addInfo: Function; + addError: Function; + addSuccess: Function; + addWarning: Function; + } + + interface IThemeManager { + // TBD + } + + interface IContextMenuManager { + // TBD + } + + interface IMenuManager { + // TBD + } + + interface IClipboard { + write(text:string, metadata?:any):any; + read():string; + } + + interface ISyntax { + // TBD + } + + interface IWindowEventHandler { + // TBD + } + + interface IAtomStatic extends ISerializationStatic { + version: number; + loadSettings: IAtomSettings; + + /* Load or create the Atom environment in the given mode */ + loadOrCreate(mode:'editor'):IAtom; + /* Load or create the Atom environment in the given mode */ + loadOrCreate(mode:'spec'):IAtom; + /* Load or create the Atom environment in the given mode */ + loadOrCreate(mode:string):IAtom; + + loadState(mode:any):void; + getStatePath(mode:any):string; + getConfigDirPath():string; + getStorageDirPath():string; + getLoadSettings():IAtomSettings; + getCurrentWindow():IBrowserWindow; + getVersion():string; + isReleasedVersion():boolean; + + new(state:IAtomState):IAtom; + } + + class Disposable { + constructor(disposalAction:any) + static isDisposable(object: any): boolean + dispose():void + } + + class CompositeDisposable { + constructor(... disposables: Array) + clear():void + dispose():void + add(... disposables: Array): void + remove(disposable: Disposable): void + delete(disposable: Disposable): void + } + + // https://atom.io/docs/api/v0.106.0/api/classes/Atom.html + /* Global Atom class : instance members */ + interface IAtom { + constructor:IAtomStatic; + + state:IAtomState; + mode:string; + deserializers:IDeserializerManager; + config: IConfig; + commands: ICommandRegistry; + grammars: IGrammars; + keymaps: IKeymapManager; + keymap: IKeymapManager; + packages: IPackageManager; + themes: IThemeManager; + contextManu: IContextMenuManager; + menu: IMenuManager; + notifications: INotifications; // https://github.com/atom/notifications + clipboard:IClipboard; + syntax:ISyntax; + views: IViewRegistry; + windowEventHandler: IWindowEventHandler; + + // really exists? start + subscribe:Function; + unsubscribe:Function; + loadTime:number; + workspaceViewParentSelector:string; + + project: IProject; + workspaceView: IWorkspaceView; + workspace: IWorkspace; + // really exists? end + + initialize:Function; + // registerRepresentationClass:Function; + // registerRepresentationClasses:Function; + setBodyPlatformClass:Function; + getCurrentWindow():IBrowserWindow; + getWindowDimensions:Function; + setWindowDimensions:Function; + restoreWindowDimensions:Function; + storeWindowDimensions:Function; + getLoadSettings:Function; + deserializeProject: Function; + deserializeWorkspaceView:Function; + deserializePackageStates:Function; + deserializeEditorWindow:Function; + startEditorWindow:Function; + unloadEditorWindow:Function; + loadThemes:Function; + watchThemes:Function; + open:Function; + confirm:Function; + showSaveDialog:Function; + showSaveDialogSync:Function; + openDevTools:Function; + toggleDevTools:Function; + executeJavaScriptInDevTools:Function; + reload:Function; + focus:Function; + show:Function; + hide:Function; + setSize:Function; + setPosition:Function; + center:Function; + displayWindow:Function; + close:Function; + exit:Function; + inDevMode:Function; + inSpecMode:Function; + toggleFullScreen:Function; + setFullScreen:Function; + isFullScreen:Function; + getVersion:Function; + isReleasedVersion:Function; + getGitHubAuthTokenName:Function; + setGitHubAuthToken:Function; + getGitHubAuthToken:Function; + getConfigDirPath:Function; + saveSync:Function; + getWindowLoadTime():number; + crashMainProcess:Function; + crashRenderProcess:Function; + beep:Function; + getUserInitScriptPath:Function; + requireUserInitScript:Function; + requireWithGlobals:Function; + + services: any; // TODO: New services api + } + + interface IBufferedNodeProcessStatic { + new (arg:any):IBufferedNodeProcess; + } + + interface IBufferedNodeProcess extends IBufferedProcess { + } + + interface IBufferedProcessStatic { + new (arg:any):IBufferedProcess; + } + + interface IBufferedProcess { + process:Function; + killed:boolean; + + bufferStream:Function; + kill:Function; + } + + interface IGitStatic { + new(path:any, options:any):IGit; + } + + interface IGit { + } + + interface ITokenizedBuffer { + // TBD + } + + interface ITokenizedLine { + // TBD + } + + interface IToken { + // TBD + } + + interface IFoldStatic { + new (displayBuffer:IDisplayBuffer, marker:IMarker):IFold; + // TBD + } + + interface IFold { + id:number; + displayBuffer:IDisplayBuffer; + marker:IMarker; + + // TBD + } + + interface IDisplayBufferMarkerStatic { + new (_arg:{bufferMarker:IMarker; displayBuffer: IDisplayBuffer}):IDisplayBufferMarker; + } + + interface IDisplayBufferMarker extends Emissary.IEmitter, Emissary.ISubscriber { + constructor:IDisplayBufferMarkerStatic; + + id: number; + + bufferMarkerSubscription:any; + oldHeadBufferPosition:TextBuffer.IPoint; + oldHeadScreenPosition:TextBuffer.IPoint; + oldTailBufferPosition:TextBuffer.IPoint; + oldTailScreenPosition:TextBuffer.IPoint; + wasValid:boolean; + + bufferMarker: IMarker; + displayBuffer: IDisplayBuffer; + globalPauseCount:number; + globalQueuedEvents:any; + + subscriptions:Emissary.ISubscription[]; + subscriptionsByObject:any; // WeakMap + + copy(attributes?:any /* maybe IMarker */):IDisplayBufferMarker; + getScreenRange():TextBuffer.IRange; + setScreenRange(screenRange:any, options:any):any; + getBufferRange():TextBuffer.IRange; + setBufferRange(bufferRange:any, options:any):any; + getPixelRange():any; + getHeadScreenPosition():TextBuffer.IPoint; + setHeadScreenPosition(screenPosition:any, options:any):any; + getHeadBufferPosition():TextBuffer.IPoint; + setHeadBufferPosition(bufferPosition:any):any; + getTailScreenPosition():TextBuffer.IPoint; + setTailScreenPosition(screenPosition:any, options:any):any; + getTailBufferPosition():TextBuffer.IPoint; + setTailBufferPosition(bufferPosition:any):any; + plantTail():boolean; + clearTail():boolean; + hasTail():boolean; + isReversed():boolean; + isValid():boolean; + isDestroyed():boolean; + getAttributes():any; + setAttributes(attributes:any):any; + matchesAttributes(attributes:any):any; + destroy():any; + isEqual(other:IDisplayBufferMarker):boolean; + compare(other:IDisplayBufferMarker):boolean; + inspect():string; + destroyed():any; + notifyObservers(_arg:any):any; + } + + interface ITransaction { + // TBD + } + + interface IMarker extends Emissary.IEmitter { + // Serializable.includeInto(Editor); + // Delegator.includeInto(Editor); + + // TBD + } + + interface ITaskStatic { + new(taskPath:any):ITask; + } + + interface ITask { + // TBD + } +} + +declare var atom:AtomCore.IAtom; + +declare module "atom" { + import spacePen = require("space-pen"); + import Q = require("q"); + + var $:typeof spacePen.$; + var $$:typeof spacePen.$$; + var $$$:typeof spacePen.$$$; + + var BufferedNodeProcess:AtomCore.IBufferedNodeProcessStatic; + var BufferedProcess:AtomCore.IBufferedProcessStatic; + var Git:AtomCore.IGitStatic; + var Point:TextBuffer.IPointStatic; + var Range:TextBuffer.IRangeStatic; + + class View extends spacePen.View implements Emissary.ISubscriber { + // Subscriber.includeInto(spacePen.View); + + // inherit from Subscriber + subscribeWith(eventEmitter:any, methodName:string, args:any):any; + + addSubscription(subscription:any):any; + + subscribe(eventEmitterOrSubscription:any, ...args:any[]):any; + + subscribeToCommand(eventEmitter:any, ...args:any[]):any; + + unsubscribe(object?:any):any; + } + + class EditorView extends View { + static characterWidthCache:any; + static configDefaults:any; + static nextEditorId:number; + + static content(params:any):void; + + static classes(_arg?:{mini?:any}):string; + + vScrollMargin:number; + hScrollMargin:number; + lineHeight:any; + charWidth:any; + charHeight:any; + cursorViews:any[]; + selectionViews:any[]; + lineCache:any[]; + isFocused:any; + editor:AtomCore.IEditor; + attached:any; + lineOverdraw:number; + pendingChanges:any[]; + newCursors:any[]; + newSelections:any[]; + redrawOnReattach:any; + bottomPaddingInLines:number; + active:boolean; + + id:number; + + gutter:AtomCore.IGutterView; + overlayer:JQuery; + scrollView:JQuery; + renderedLines:JQuery; + underlayer:JQuery; + hiddenInput:JQuery; + verticalScrollbar:JQuery; + verticalScrollbarContent:JQuery; + + constructor(editor:AtomCore.IEditor); + + initialize(editorOrOptions:AtomCore.IEditor):void; // return type are same as editor method. + initialize(editorOrOptions?:{editor: AtomCore.IEditor; mini:any; placeholderText:any}):void; + + initialize(editorOrOptions:{}):void; // compatible for spacePen.View + + bindKeys():void; + + getEditor():AtomCore.IEditor; + + getText():string; + + setText(text:string):void; + + insertText(text:string, options?:any):TextBuffer.IRange[]; + + setHeightInLines(heightInLines:number):number; + + setWidthInChars(widthInChars:number):number; + + pageDown():void; + + pageUp():void; + + getPageRows():number; + + setShowInvisibles(showInvisibles:boolean):void; + + setInvisibles(invisibles:{ eol:string; space: string; tab: string; cr: string; }):void; + + setShowIndentGuide(showIndentGuide:boolean):void; + + setPlaceholderText(placeholderText:string):void; + + getPlaceholderText():string; + + checkoutHead():boolean; + + configure():Emissary.ISubscription; + + handleEvents():void; + + handleInputEvents():void; + + bringHiddenInputIntoView():JQuery; + + selectOnMousemoveUntilMouseup():any; + + afterAttach(onDom:any):any; + + edit(editor:AtomCore.IEditor):any; + + getModel():AtomCore.IEditor; + + setModel(editor:AtomCore.IEditor):any; + + showBufferConflictAlert(editor:AtomCore.IEditor):any; + + scrollTop(scrollTop:number, options?:any):any; + + scrollBottom(scrollBottom?:number):any; + + scrollLeft(scrollLeft?:number):number; + + scrollRight(scrollRight?:number):any; + + scrollToBottom():any; + + scrollToCursorPosition():any; + + scrollToBufferPosition(bufferPosition:any, options:any):any; + + scrollToScreenPosition(screenPosition:any, options:any):any; + + scrollToPixelPosition(pixelPosition:any, options:any):any; + + highlightFoldsContainingBufferRange(bufferRange:any):any; + + saveScrollPositionForEditor():any; + + toggleSoftTabs():any; + + toggleSoftWrap():any; + + calculateWidthInChars():number; + + calculateHeightInLines():number; + + getScrollbarWidth():number; + + setSoftWrap(softWrap:boolean):any; + + setFontSize(fontSize:number):any; + + getFontSize():number; + + setFontFamily(fontFamily?:string):any; + + getFontFamily():string; + + setLineHeight(lineHeight:number):any; + + redraw():any; + + splitLeft():any; + + splitRight():any; + + splitUp():any; + + splitDown():any; + + getPane():any; // return type are PaneView + + remove(selector:any, keepData:any):any; + + beforeRemove():any; + + getCursorView(index?:number):any; // return type are CursorView + + getCursorViews():any[]; // return type are CursorView[] + + addCursorView(cursor:any, options:any):any; // return type are CursorView + + removeCursorView(cursorView:any):any; + + getSelectionView(index?:number):any; // return type are SelectionView + + getSelectionViews():any[]; // return type are SelectionView[] + + addSelectionView(selection:any):any; + + removeSelectionView(selectionView:any):any; + + removeAllCursorAndSelectionViews():any[]; + + appendToLinesView(view:any):any; + + scrollVertically(pixelPosition:any, _arg:any):any; + + scrollHorizontally(pixelPosition:any):any; + + calculateDimensions():number; + + recalculateDimensions():any; + + updateLayerDimensions():any; + + isHidden():boolean; + + clearRenderedLines():void; + + resetDisplay():any; + + requestDisplayUpdate():any; + + updateDisplay(options?:any):any; + + updateCursorViews():any; + + shouldUpdateCursor(cursorView:any):any; + + updateSelectionViews():any[]; + + shouldUpdateSelection(selectionView:any):any; + + syncCursorAnimations():any[]; + + autoscroll(suppressAutoscroll?:any):any[]; + + updatePlaceholderText():any; + + updateRenderedLines(scrollViewWidth:any):any; + + computeSurroundingEmptyLineChanges(change:any):any; + + computeIntactRanges(renderFrom:any, renderTo:any):any; + + truncateIntactRanges(intactRanges:any, renderFrom:any, renderTo:any):any; + + clearDirtyRanges(intactRanges:any):any; + + clearLine(lineElement:any):any; + + fillDirtyRanges(intactRanges:any, renderFrom:any, renderTo:any):any; + + updatePaddingOfRenderedLines():any; + + getFirstVisibleScreenRow():number; + + getLastVisibleScreenRow():number; + + isScreenRowVisible():boolean; + + handleScreenLinesChange(change:any):any; + + buildLineElementForScreenRow(screenRow:any):any; + + buildLineElementsForScreenRows(startRow:any, endRow:any):any; + + htmlForScreenRows(startRow:any, endRow:any):any; + + htmlForScreenLine(screenLine:any, screenRow:any):any; + + buildIndentation(screenRow:any, editor:any):any; + + buildHtmlEndOfLineInvisibles(screenLine:any):any; + + getEndOfLineInvisibles(screenLine:any):any; + + lineElementForScreenRow(screenRow:any):any; + + toggleLineCommentsInSelection():any; + + pixelPositionForBufferPosition(position:any):any; + + pixelPositionForScreenPosition(position:any):any; + + positionLeftForLineAndColumn(lineElement:any, screenRow:any, screenColumn:any):any; + + measureToColumn(lineElement:any, tokenizedLine:any, screenColumn:any):any; + + getCharacterWidthCache(scopes:any, char:any):any; + + setCharacterWidthCache(scopes:any, char:any, val:any):any; + + clearCharacterWidthCache():any; + + pixelOffsetForScreenPosition(position:any):any; + + screenPositionFromMouseEvent(e:any):any; + + highlightCursorLine():any; + + copyPathToClipboard():any; + + buildLineHtml(_arg:any):any; + + updateScopeStack(line:any, scopeStack:any, desiredScopes:any):any; + + pushScope(line:any, scopeStack:any, scope:any):any; + + popScope(line:any, scopeStack:any):any; + + buildEmptyLineHtml(showIndentGuide:any, eolInvisibles:any, htmlEolInvisibles:any, indentation:any, editor:any, mini:any):any; + + replaceSelectedText(replaceFn:(str:string)=>string):any; + + consolidateSelections(e:any):any; + + logCursorScope():any; + + logScreenLines(start:any, end:any):any; + + logRenderedLines():any; + } + + class ScrollView extends View { + // TBD + } + + interface ISelectListItem { + /** e.g. application:about */ + eventName:string; + /** e.g. Application: About */ + eventDescription:string; + } + + class SelectListView extends View { + static content():any; + + maxItems:number; + scheduleTimeout:any; + inputThrottle:number; + cancelling:boolean; + items:any[]; + list:JQuery; + filterEditorView: JQuery; + + previouslyFocusedElement:JQuery; + + initialize():any; + + schedulePopulateList():number; + + setItems(items:any[]):any; + + setError(message?:string):any; + + setLoading(message?:string):any; + + getFilterQuery():string; + + populateList():any; + + getEmptyMessage(itemCount?:any, filteredItemCount?:any):string; + + setMaxItems(maxItems:number):void; + + selectPreviousItemView():any; + + selectNextItemView():any; + + selectItemView(view:any):any; + + scrollToItemView(view:any):any; + + getSelectedItemView():any; + + getSelectedItem():any; + + confirmSelection():any; + + viewForItem(item:any):JQuery|string|HTMLElement|View; // You must override this method! + confirmed(item:any):any; // You must override this method! + getFilterKey():any; + + focusFilterEditor():any; + + storeFocusedElement():any; + + restoreFocus():any; + + cancelled():any; + + cancel():any; + } + + class Disposable extends AtomCore.Disposable { } + class CompositeDisposable extends AtomCore.CompositeDisposable { } + + var WorkspaceView:AtomCore.IWorkspaceViewStatic; + + var Task:AtomCore.ITaskStatic; + var Workspace:AtomCore.IWorkspaceStatic; +} diff --git a/types/atom/v0/tsconfig.json b/types/atom/v0/tsconfig.json new file mode 100644 index 0000000000..1330ba894b --- /dev/null +++ b/types/atom/v0/tsconfig.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "atom": [ + "atom/v0" + ], + "pathwatcher": [ + "pathwatcher/v0" + ], + "q": [ + "q/v0" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "api-docs.d.ts", + "atom-tests.ts" + ] +} \ No newline at end of file diff --git a/types/atpl/tsconfig.json b/types/atpl/tsconfig.json index b35da8523c..24f7da314f 100644 --- a/types/atpl/tsconfig.json +++ b/types/atpl/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/audiosprite/tsconfig.json b/types/audiosprite/tsconfig.json index 7348d046e8..b761c9572e 100644 --- a/types/audiosprite/tsconfig.json +++ b/types/audiosprite/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "audiosprite-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/aurelia-knockout/tsconfig.json b/types/aurelia-knockout/tsconfig.json index aa45dc1157..ceb4710331 100644 --- a/types/aurelia-knockout/tsconfig.json +++ b/types/aurelia-knockout/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "aurelia-knockout-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/auth0-angular/tsconfig.json b/types/auth0-angular/tsconfig.json index da1f149dc0..42ee707301 100644 --- a/types/auth0-angular/tsconfig.json +++ b/types/auth0-angular/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 73426dbd37..b70ff8d688 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -1,6 +1,6 @@ import * as auth0 from 'auth0-js'; -let webAuth = new auth0.WebAuth({ +const webAuth = new auth0.WebAuth({ domain: 'mine.auth0.com', clientID: 'dsa7d77dsa7d7' }); @@ -14,7 +14,7 @@ webAuth.authorize({ webAuth.parseHash((err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -30,7 +30,7 @@ webAuth.parseHash((err, authResult) => { webAuth.parseHash((err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -47,11 +47,18 @@ webAuth.parseHash((err, authResult) => { webAuth.parseHash( { nonce: 'asfd', - hash: '#access_token=VjubIMBmpgQ2W2&id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlF6RTROMFpCTTBWRFF6RTJSVVUwTnpJMVF6WTFNelE0UVRrMU16QXdNRUk0UkRneE56RTRSZyJ9.eyJpc3MiOiJodHRwczovL3dwdGVzdC5hdXRoMC5jb20vIiwic3ViIjoiYXV0aDB8NTVkNDhjNTdkNWIwYWQwMjIzYzQwOGQ3IiwiYXVkIjoiZ1lTTmxVNFlDNFYxWVBkcXE4elBRY3VwNnJKdzFNYnQiLCJleHAiOjE0ODI5NjkwMzEsImlhdCI6MTQ4MjkzMzAzMSwibm9uY2UiOiJhc2ZkIn0.PPoh-pITcZ8qbF5l5rMZwXiwk5efbESuqZ0IfMUcamB6jdgLwTxq-HpOT_x5q6-sO1PBHchpSo1WHeDYMlRrOFd9bh741sUuBuXdPQZ3Zb0i2sNOAC2RFB1E11mZn7uNvVPGdPTg-Y5xppz30GSXoOJLbeBszfrVDCmPhpHKGGMPL1N6HV-3EEF77L34YNAi2JQ-b70nFK_dnYmmv0cYTGUxtGTHkl64UEDLi3u7bV-kbGky3iOOCzXKzDDY6BBKpCRTc2KlbrkO2A2PuDn27WVv1QCNEFHvJN7HxiDDzXOsaUmjrQ3sfrHhzD7S9BcCRkekRfD9g95SKD5J0Fj8NA&token_type=Bearer&state=theState&refresh_token=kajshdgfkasdjhgfas&scope=foo' + hash: "#access_token=VjubIMBmpgQ2W2& \ + id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlF6RTROMFpCTTBWRFF6RTJSVVUwTnpJMVF6WTFNelE0UVRrMU16QXdNRUk0UkRneE56RTRSZyJ9. \ + eyJpc3MiOiJodHRwczovL3dwdGVzdC5hdXRoMC5jb20vIiwic3ViIjoiYXV0aDB8NTVkNDhjNTdkNWIwYWQwMjIzYzQwOGQ3IiwiYXVkIjoiZ1lTTmxVNFlDNFYxWVBkcXE \ + 4elBRY3VwNnJKdzFNYnQiLCJleHAiOjE0ODI5NjkwMzEsImlhdCI6MTQ4MjkzMzAzMSwibm9uY2UiOiJhc2ZkIn0. \ + PPoh-pITcZ8qbF5l5rMZwXiwk5efbESuqZ0IfMUcamB6jdgLwTxq-HpOT_x5q6-sO1PBHchpSo1WHeDYMlRrOFd9bh741sUuBuXdPQZ3Zb0i2sNOAC2RFB \ + 1E11mZn7uNvVPGdPTg-Y5xppz30GSXoOJLbeBszfrVDCmPhpHKGGMPL1N6HV-3EEF77L34YNAi2JQ-b70nFK_dnYmmv0cYTGUxtGTHkl64UEDLi3u7bV- \ + kbGky3iOOCzXKzDDY6BBKpCRTc2KlbrkO2A2PuDn27WVv1QCNEFHvJN7HxiDDzXOsaUmjrQ3sfrHhzD7S9BcCRkekRfD9g95SKD5J0Fj8NA& \ + token_type=Bearer&state=theState&refresh_token=kajshdgfkasdjhgfas&scope=foo" }, (err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -71,7 +78,7 @@ webAuth.parseHash( }, (err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -86,14 +93,14 @@ webAuth.parseHash( }); webAuth.renewAuth({ -}, function (err, authResult) { +}, (err, authResult) => { // Renewed tokens or error }); webAuth.renewAuth({ nonce: '123', state: '456' -}, function (err, authResult) { +}, (err, authResult) => { // Renewed tokens or error }); @@ -103,7 +110,7 @@ webAuth.renewAuth({ nonce: '123', state: '456', postMessageDataType: 'auth0:silent-authentication' -}, function (err, authResult) { +}, (err, authResult) => { // Renewed tokens or error }); @@ -111,9 +118,7 @@ webAuth.renewAuth({ audience: 'urn:site:demo:blog', redirectUri: 'http://page.com/callback', usePostMessage: true -}, (err, authResult) => { - -}); +}, (err, authResult) => {}); webAuth.changePassword({connection: 'the_connection', email: 'me@example.com', @@ -134,19 +139,15 @@ webAuth.signupAndAuthorize({ user_metadata: { foo: 'bar' } -}, function (err, data) { - -}); +}, (err, data) => {}); webAuth.client.login({ - realm: 'Username-Password-Authentication', //connection name or HRD domain + realm: 'Username-Password-Authentication', // connection name or HRD domain username: 'info@auth0.com', password: 'areallystrongpassword', audience: 'https://mystore.com/api/v2', scope: 'read:order write:order', -}, function(err, authResult) { - // Auth tokens in the result or an error -}); +}, (err, authResult) => {/*Auth tokens in the result or an error*/}); webAuth.popup.buildPopupHandler(); webAuth.popup.preload({}); @@ -171,7 +172,7 @@ webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {}); webAuth.crossOriginAuthenticationCallback(); -let authentication = new auth0.Authentication({ +const authentication = new auth0.Authentication({ domain: 'me.auth0.com', clientID: '...', redirectUri: 'http://page.com/callback', @@ -179,7 +180,7 @@ let authentication = new auth0.Authentication({ _sendTelemetry: false }); -authentication.buildAuthorizeUrl({state:'1234'}); +authentication.buildAuthorizeUrl({state: '1234'}); authentication.buildAuthorizeUrl({ responseType: 'token', redirectUri: 'http://anotherpage.com/callback2', @@ -191,7 +192,7 @@ authentication.buildAuthorizeUrl({ authentication.buildLogoutUrl({ clientID: 'asdfasdfds' }); authentication.buildLogoutUrl(); authentication.userInfo('abcd1234', (err, data) => { - //user info retrieved + // user info retrieved }); authentication.delegation({ @@ -200,28 +201,22 @@ authentication.delegation({ api_type: 'app' }, (err, data) => { if (!err) { - localStorage.setItem('token', data.idToken) + localStorage.setItem('token', data.idToken); } }); authentication.loginWithDefaultDirectory({ username: 'someUsername', password: '123456' -}, (err, data) => { - -}); +}, (err, data) => {}); authentication.oauthToken({ username: 'someUsername', password: '123456', grantType: 'password' -}, (err, data) => { +}, (err, data) => {}); -}); - -authentication.getUserCountry((err, data) => { - -}); +authentication.getUserCountry((err, data) => {}); authentication.getSSOData(); authentication.getSSOData(true, (err, data) => {}); @@ -239,7 +234,7 @@ authentication.loginWithResourceOwner({ scope: 'openid' }, (err, data) => {}); -let management = new auth0.Management({ +const management = new auth0.Management({ domain: 'me.auth0.com', token: 'token' }); diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 37914e887f..980ba162b5 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js 8.6 +// Type definitions for Auth0.js 8.10 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Matt Durrant @@ -6,7 +6,6 @@ export as namespace auth0; - export class Authentication { constructor(options: AuthOptions); @@ -145,6 +144,10 @@ export class DBConnection { } export class Management { + /** + * Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant. + * @param {ManagementOptions} options + */ constructor(options: ManagementOptions); /** @@ -187,7 +190,7 @@ export class WebAuth { * * @param {AuthorizeOptions} options: https://auth0.com/docs/api/authentication#!#get--authorize_db */ - authorize(options: AuthorizeOptions): void; + authorize(options?: AuthorizeOptions): void; /** * Parse the url hash and extract the returned tokens depending on the transaction. @@ -225,7 +228,8 @@ export class WebAuth { /** * Executes a silent authentication transaction under the hood in order to fetch a new tokens for the current session. * This method requires that all Auth is performed with {@link authorize} - * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method. + * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). + * If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method. * * @param {RenewAuthOptions} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint * @param {Function} callback @@ -258,11 +262,15 @@ export class WebAuth { signupAndAuthorize(options: DbSignUpOptions, callback: Auth0Callback): void; /** - * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. - * This only works when 3rd party cookies are enabled in the browser. After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. + * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. + * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. + * + * This only works when 3rd party cookies are enabled in the browser. + * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. * * @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired - * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. For other types of errors, there will be a redirect to the `redirectUri`. + * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. + * For other types of errors, there will be a redirect to the `redirectUri`. */ login(options: CrossOriginLoginOptions, callback: Auth0Callback): void; @@ -361,7 +369,8 @@ export class Popup { * @param {String} options.hash the url hash. If not provided it will extract from window.location.hash * @param {String} [options.state] value originally sent in `state` parameter to {@link authorize} to mitigate XSRF * @param {String} [options.nonce] value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks - * @param {String} [options._idTokenVerification] makes parseHash perform or skip `id_token` verification. We **strongly** recommend validating the `id_token` yourself if you disable the verification. + * @param {String} [options._idTokenVerification] makes parseHash perform or skip `id_token` verification. + * We **strongly** recommend validating the `id_token` yourself if you disable the verification. * @see {@link parseHash} */ callback(options: any): void; @@ -374,8 +383,10 @@ export class Popup { * @param {String} [options.domain] your Auth0 domain * @param {String} [options.clientID] your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard * @param {String} options.redirectUri url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} options.responseType type of the response used by OAuth 2.0 flow. It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} - * @param {String} [options.responseMode] how the Auth response is encoded and redirected back to the client. Supported values are `query`, `fragment` and `form_post`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} + * @param {String} options.responseType type of the response used by OAuth 2.0 flow. + * It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} + * @param {String} [options.responseMode] how the Auth response is encoded and redirected back to the client. + * Supported values are `query`, `fragment` and `form_post`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} * @param {String} [options.state] value used to mitigate XSRF attacks. {@link https://auth0.com/docs/protocols/oauth2/oauth-state} * @param {String} [options.nonce] value used to mitigate replay attacks when using Implicit Grant. {@link https://auth0.com/docs/api-auth/tutorials/nonce} * @param {String} [options.scope] scopes to be requested during Auth. e.g. `openid email` @@ -436,11 +447,14 @@ export class CrossOriginAuthentication { constructor(webAuth: any, options: any); /** - * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. - * This only works when 3rd party cookies are enabled in the browser. After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. + * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. + * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. + * This only works when 3rd party cookies are enabled in the browser. + * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. * * @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired - * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. For other types of errors, there will be a redirect to the `redirectUri`. + * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. + * For other types of errors, there will be a redirect to the `redirectUri`. */ login(options: CrossOriginLoginOptions, callback: Auth0Callback): void; @@ -451,16 +465,25 @@ export class CrossOriginAuthentication { callback(): void; } -type Auth0Callback = (error: null | Auth0Error, result: T) => void; +export type Auth0Callback = (error: null | Auth0Error, result: T) => void; -interface ManagementOptions { - domain: string; - token: string; - _sendTelemetry?: boolean; - _telemetryInfo?: any; +export interface TokenProvider { + enableCache?: boolean; + cacheTTLInSeconds?: number; } -interface AuthOptions { +export interface ManagementOptions { + domain: string; + token?: string; + clientId?: string; + clientSecret?: string; + audience?: string; + scope?: string; + tokenProvider?: TokenProvider; + telemetry?: boolean; +} + +export interface AuthOptions { domain: string; clientID: string; responseType?: string; @@ -475,14 +498,14 @@ interface AuthOptions { _telemetryInfo?: any; } -interface PasswordlessAuthOptions { +export interface PasswordlessAuthOptions { connection: string; verificationCode: string; phoneNumber: string; email: string; } -interface Auth0Error { +export interface Auth0Error { error?: any; errorDescription?: string; code?: string; @@ -494,7 +517,7 @@ interface Auth0Error { statusText?: string; } -interface Auth0DecodedHash { +export interface Auth0DecodedHash { accessToken?: string; idToken?: string; idTokenPayload?: any; @@ -505,7 +528,7 @@ interface Auth0DecodedHash { } /** Represents the response from an API Token Delegation request. */ -interface Auth0DelegationToken { +export interface Auth0DelegationToken { /** The length of time in seconds the token is valid for. */ expiresIn: number; /** The JWT for delegated access. */ @@ -514,13 +537,13 @@ interface Auth0DelegationToken { tokenType: string; } -interface ChangePasswordOptions { +export interface ChangePasswordOptions { connection: string; email: string; password?: string; } -interface PasswordlessStartOptions { +export interface PasswordlessStartOptions { connection: string; send: string; phoneNumber?: string; @@ -528,7 +551,7 @@ interface PasswordlessStartOptions { authParams?: any; } -interface PasswordlessVerifyOptions { +export interface PasswordlessVerifyOptions { connection: string; verificationCode: string; phoneNumber?: string; @@ -536,7 +559,7 @@ interface PasswordlessVerifyOptions { send?: string; } -interface Auth0UserProfile { +export interface Auth0UserProfile { name: string; nickname: string; picture: string; @@ -557,60 +580,60 @@ interface Auth0UserProfile { app_metadata?: any; } -interface MicrosoftUserProfile extends Auth0UserProfile { - emails?: string[]; //optional depending on whether email addresses permission is granted +export interface MicrosoftUserProfile extends Auth0UserProfile { + emails?: string[]; // optional depending on whether email addresses permission is granted } -interface Office365UserProfile extends Auth0UserProfile { +export interface Office365UserProfile extends Auth0UserProfile { tenantid: string; upn: string; } -interface AdfsUserProfile extends Auth0UserProfile { +export interface AdfsUserProfile extends Auth0UserProfile { issuer?: string; } -interface Auth0Identity { +export interface Auth0Identity { connection: string; isSocial: boolean; provider: string; user_id: string; } -interface LoginOptions { +export interface LoginOptions { username: string; password: string; scope?: string; } -interface DefaultLoginOptions extends LoginOptions { +export interface DefaultLoginOptions extends LoginOptions { audience?: string; realm: string; } -interface DefaultDirectoryLoginOptions extends LoginOptions { +export interface DefaultDirectoryLoginOptions extends LoginOptions { audience?: string; } -interface ResourceOwnerLoginOptions extends LoginOptions { +export interface ResourceOwnerLoginOptions extends LoginOptions { connection: string; device?: string; } -interface CrossOriginLoginOptions { +export interface CrossOriginLoginOptions { username?: string; email?: string; password: string; realm?: string; } -interface LogoutOptions { +export interface LogoutOptions { clientID?: string; returnTo?: string; federated?: boolean; } -interface DelegationOptions { +export interface DelegationOptions { client_id?: string; grant_type: string; id_token?: string; @@ -620,7 +643,7 @@ interface DelegationOptions { api_type?: string; } -interface DbSignUpOptions { +export interface DbSignUpOptions { email: string; password: string; connection: string; @@ -628,14 +651,14 @@ interface DbSignUpOptions { user_metadata?: any; } -interface ParseHashOptions { +export interface ParseHashOptions { hash?: string; state?: string; nonce?: string; _idTokenVerification?: boolean; } -interface RenewAuthOptions { +export interface RenewAuthOptions { domain?: string; clientID?: string; redirectUri?: string; @@ -649,10 +672,10 @@ interface RenewAuthOptions { postMessageDataType?: string; } -interface AuthorizeOptions { +export interface AuthorizeOptions { domain?: string; clientID?: string; - connection?:string; + connection?: string; redirectUri?: string; responseType?: string; responseMode?: string; diff --git a/types/auth0-js/tsconfig.json b/types/auth0-js/tsconfig.json index 62bab1e208..a813aae68d 100644 --- a/types/auth0-js/tsconfig.json +++ b/types/auth0-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "auth0-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/auth0-js/tslint.json b/types/auth0-js/tslint.json new file mode 100644 index 0000000000..5eb4948245 --- /dev/null +++ b/types/auth0-js/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json" +} + \ No newline at end of file diff --git a/types/auth0-js/v7/tsconfig.json b/types/auth0-js/v7/tsconfig.json index bdabf7ef7f..e76b7d7dd8 100644 --- a/types/auth0-js/v7/tsconfig.json +++ b/types/auth0-js/v7/tsconfig.json @@ -8,14 +8,19 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "types": [], "paths": { - "auth0-js": ["auth0-js/v7"], - "auth0-js/*": ["auth0-js/v7/*"] + "auth0-js": [ + "auth0-js/v7" + ], + "auth0-js/*": [ + "auth0-js/v7/*" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true @@ -24,4 +29,4 @@ "index.d.ts", "auth0-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/auth0-lock/tsconfig.json b/types/auth0-lock/tsconfig.json index 09c9f8233c..2e008d7c0d 100644 --- a/types/auth0-lock/tsconfig.json +++ b/types/auth0-lock/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "auth0-lock-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/auth0.widget/tsconfig.json b/types/auth0.widget/tsconfig.json index 8ceb7b3d73..d18a18213b 100644 --- a/types/auth0.widget/tsconfig.json +++ b/types/auth0.widget/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "auth0.widget-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index cb84c7a6bd..353fa38559 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -7,8 +7,18 @@ import * as Promise from 'bluebird'; export interface ManagementClientOptions { - token: string; - domain?: string; + token?: string; + domain: string; + clientId?: string; + clientSecret?: string; + audience?: string; + scope?: string; + tokenProvider?: TokenProvider; +} + +export interface TokenProvider { + enableCache: boolean; + cacheTTLInSeconds?: number; } export interface UserMetadata { } diff --git a/types/auth0/tsconfig.json b/types/auth0/tsconfig.json index 855b69aa4d..dd7c60796c 100644 --- a/types/auth0/tsconfig.json +++ b/types/auth0/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/auto-launch/tsconfig.json b/types/auto-launch/tsconfig.json index ba69bba12b..952d3c0c5d 100644 --- a/types/auto-launch/tsconfig.json +++ b/types/auto-launch/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "auto-launch-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/auto-sni/tsconfig.json b/types/auto-sni/tsconfig.json index 715f315867..9c03900b72 100644 --- a/types/auto-sni/tsconfig.json +++ b/types/auto-sni/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "auto-sni-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auto-sni-tests.ts" + ] +} \ No newline at end of file diff --git a/types/autobahn/tsconfig.json b/types/autobahn/tsconfig.json index 0efaca40c5..35ca105b25 100644 --- a/types/autobahn/tsconfig.json +++ b/types/autobahn/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/autobind-decorator/tsconfig.json b/types/autobind-decorator/tsconfig.json index 43d5817978..0b05ea04fb 100644 --- a/types/autobind-decorator/tsconfig.json +++ b/types/autobind-decorator/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "experimentalDecorators": true, "typeRoots": [ diff --git a/types/autolinker/tsconfig.json b/types/autolinker/tsconfig.json index b746881615..7d8068c47c 100644 --- a/types/autolinker/tsconfig.json +++ b/types/autolinker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/autoprefixer-core/tsconfig.json b/types/autoprefixer-core/tsconfig.json index b9a86fbe1b..91b4bc2e7c 100644 --- a/types/autoprefixer-core/tsconfig.json +++ b/types/autoprefixer-core/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/autoprefixer/tsconfig.json b/types/autoprefixer/tsconfig.json index 244c865adf..92adece604 100644 --- a/types/autoprefixer/tsconfig.json +++ b/types/autoprefixer/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "autoprefixer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/autosize/tsconfig.json b/types/autosize/tsconfig.json index c5202a2b52..d74b3d9c37 100644 --- a/types/autosize/tsconfig.json +++ b/types/autosize/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/avoscloud-sdk/tsconfig.json b/types/avoscloud-sdk/tsconfig.json index 1da2d1d67d..2d3d9589f4 100644 --- a/types/avoscloud-sdk/tsconfig.json +++ b/types/avoscloud-sdk/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/awesomplete/tsconfig.json b/types/awesomplete/tsconfig.json index 270615e926..74f690ea77 100644 --- a/types/awesomplete/tsconfig.json +++ b/types/awesomplete/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts index 10eeed099d..66655f8dd3 100644 --- a/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts +++ b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts @@ -13,7 +13,6 @@ const device = new awsIot.device({ clientId: "", region: "", baseReconnectTimeMs: 1000, - keepalive: 10, protocol: "wss", port: 443, host: "", @@ -39,7 +38,7 @@ device console.log("offline"); }); device - .on("error", function(error) { + .on("error", function(error: Error | string) { console.log("error", error); }); device @@ -55,7 +54,6 @@ const thingShadows = new awsIot.thingShadow({ clientId: "", region: "", baseReconnectTimeMs: 1000, - keepalive: 10, protocol: "mqtts", port: 0, host: "", @@ -65,9 +63,11 @@ const thingShadows = new awsIot.thingShadow({ thingShadows.register( "thingName", { ignoreDeltas: false }, - (err: Error, failedTopics: mqtt.Granted[]) => { } + (err: Error, failedTopics: mqtt.ISubscriptionGrant[]) => { } ); + thingShadows.subscribe("topic", { qos: 1 }, (error: any, granted: mqtt.ISubscriptionGrant[]) => {}); + thingShadows.on("connect", function() { console.log("connected to AWS IoT"); }); @@ -85,7 +85,7 @@ const thingShadows = new awsIot.thingShadow({ console.log("offline"); }); - thingShadows.on("error", function(error) { + thingShadows.on("error", function(error: Error) { console.log("error", error); }); @@ -96,8 +96,8 @@ const thingShadows = new awsIot.thingShadow({ thingShadows.on("status", function(thingName: string, stat: "accepted" | "rejected", clientToken: string, stateObject: any) { }); - thingShadows.on("delta", function(thingName, stateObject) { + thingShadows.on("delta", function(thingName: string, stateObject: any) { }); - thingShadows.on("timeout", function(thingName, clientToken) { + thingShadows.on("timeout", function(thingName: string, clientToken: string) { }); diff --git a/types/aws-iot-device-sdk/index.d.ts b/types/aws-iot-device-sdk/index.d.ts index b165089f82..38cf00840d 100644 --- a/types/aws-iot-device-sdk/index.d.ts +++ b/types/aws-iot-device-sdk/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for aws-iot-device-sdk 1.0.13 +// Type definitions for aws-iot-device-sdk 2.1.0 // Project: https://github.com/aws/aws-iot-device-sdk-js // Definitions by: Markus Olsson +// Margus Lamp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -8,7 +9,7 @@ import * as mqtt from "mqtt"; import * as WebSocket from "ws"; -export interface DeviceOptions extends mqtt.ClientOptions { +export interface DeviceOptions extends mqtt.IClientOptions { /** the AWS IoT region you will operate in (default "us-east-1") */ region?: string; @@ -100,7 +101,7 @@ export interface DeviceOptions extends mqtt.ClientOptions { * additional options to the underlying WebSocket object; * these options are documented here. */ - websocketOptions?: WebSocket.IClientOptions; + websocketOptions?: WebSocket.ClientOptions; /** * used to specify the Access Key ID when protocol is set to "wss". @@ -178,7 +179,7 @@ export class device extends NodeJS.EventEmitter { * @param publish options * @param called when publish succeeds or fails */ - publish(topic: string, message: Buffer | string, options?: mqtt.ClientPublishOptions, callback?: (error?: Error) => void): mqtt.Client; + publish(topic: string, message: Buffer | string, options?: mqtt.IClientPublishOptions, callback?: (error?: Error) => void): mqtt.Client; /** * Subscribe to a topic or topics @@ -186,7 +187,7 @@ export class device extends NodeJS.EventEmitter { * @param the options to subscribe with * @param callback fired on suback */ - subscribe(topic: string | string[] | mqtt.Topic, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + subscribe(topic: string | string[], options?: mqtt.IClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * Unsubscribe from a topic or topics @@ -195,7 +196,7 @@ export class device extends NodeJS.EventEmitter { * @param options * @param callback fired on unsuback */ - unsubscribe(topic: string | string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + unsubscribe(topic: string | string[], options?: mqtt.IClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * end - close connection @@ -256,7 +257,7 @@ export class thingShadow extends NodeJS.EventEmitter { * for all shadow topics). Applications should wait until shadow * registration is complete before performing update/get/delete operations. */ - register(thingName: string, options?: RegisterOptions, callback?: (error: Error, failedTopics: mqtt.Granted[]) => void): void + register(thingName: string, options?: RegisterOptions, callback?: (error: Error, failedTopics: mqtt.ISubscriptionGrant[]) => void): void /** * Unregister interest in the Thing Shadow named thingName. @@ -333,8 +334,7 @@ export class thingShadow extends NodeJS.EventEmitter { * @param options * @param callback */ - publish(topic: string, message: Buffer, options?: mqtt.ClientPublishOptions, callback?: Function): mqtt.Client; - publish(topic: string, message: string, options?: mqtt.ClientPublishOptions, callback?: Function): mqtt.Client; + publish(topic: string, message: Buffer | string, options?: mqtt.IClientPublishOptions, callback?: Function): mqtt.Client; /** * Subscribe to a topic or topics @@ -342,9 +342,7 @@ export class thingShadow extends NodeJS.EventEmitter { * @param the options to subscribe with * @param callback fired on suback */ - subscribe(topic: string, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; - subscribe(topic: string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; - subscribe(topic: mqtt.Topic, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + subscribe(topic: string | string[], options?: { qos: 0 | 1 }, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * Unsubscribe from a topic or topics @@ -353,8 +351,7 @@ export class thingShadow extends NodeJS.EventEmitter { * @param options * @param callback fired on unsuback */ - unsubscribe(topic: string, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; - unsubscribe(topic: string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + unsubscribe(topic: string | string[], options?: mqtt.IClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * end - close connection diff --git a/types/aws-iot-device-sdk/package.json b/types/aws-iot-device-sdk/package.json new file mode 100644 index 0000000000..9aceff7832 --- /dev/null +++ b/types/aws-iot-device-sdk/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "mqtt": "^2.13.0" + } +} diff --git a/types/aws-iot-device-sdk/tsconfig.json b/types/aws-iot-device-sdk/tsconfig.json index 657e3a25f2..3fdd4b0f28 100644 --- a/types/aws-iot-device-sdk/tsconfig.json +++ b/types/aws-iot-device-sdk/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aws-lambda-mock-context/tsconfig.json b/types/aws-lambda-mock-context/tsconfig.json index bdfad87be5..5d1dfe3f1f 100644 --- a/types/aws-lambda-mock-context/tsconfig.json +++ b/types/aws-lambda-mock-context/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 0c8f0fc26d..ee8790705e 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -1,6 +1,13 @@ // Type definitions for AWS Lambda // Project: http://docs.aws.amazon.com/lambda -// Definitions by: James Darbyshire , Michael Skarum , Stef Heyenrath , Toby Hede , Rich Buggy , Yoriki Yamaguchi , wwwy3y3 +// Definitions by: James Darbyshire +// Michael Skarum +// Stef Heyenrath +// Toby Hede +// Rich Buggy +// Yoriki Yamaguchi +// wwwy3y3 +// Ishaan Malhi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // API Gateway "event" @@ -347,8 +354,8 @@ export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Co * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. * @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. */ -export type Callback = (error?: Error, result?: any) => void; -export type ProxyCallback = (error?: Error, result?: ProxyResult) => void; -export type CustomAuthorizerCallback = (error?: Error, result?: AuthResponse) => void; +export type Callback = (error?: Error | null, result?: object) => void; +export type ProxyCallback = (error?: Error | null, result?: ProxyResult) => void; +export type CustomAuthorizerCallback = (error?: Error | null, result?: AuthResponse) => void; export as namespace AWSLambda; diff --git a/types/aws-lambda/tsconfig.json b/types/aws-lambda/tsconfig.json index e204a8ac6a..f4f2cc28f6 100644 --- a/types/aws-lambda/tsconfig.json +++ b/types/aws-lambda/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/aws-serverless-express/tsconfig.json b/types/aws-serverless-express/tsconfig.json index 62885fcda3..be920785f5 100644 --- a/types/aws-serverless-express/tsconfig.json +++ b/types/aws-serverless-express/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "middleware.d.ts", "aws-serverless-express-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/aws4/tsconfig.json b/types/aws4/tsconfig.json index 597f05b7e7..a0bcbfa73e 100644 --- a/types/aws4/tsconfig.json +++ b/types/aws4/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/axel/tsconfig.json b/types/axel/tsconfig.json index 0ac3689676..a3e2b5e015 100644 --- a/types/axel/tsconfig.json +++ b/types/axel/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "axel-tests.ts", - "index.d.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "axel-tests.ts", + "index.d.ts" + ] } \ No newline at end of file diff --git a/types/axios-mock-adapter/tsconfig.json b/types/axios-mock-adapter/tsconfig.json index d03b805201..0de216c230 100644 --- a/types/axios-mock-adapter/tsconfig.json +++ b/types/axios-mock-adapter/tsconfig.json @@ -13,10 +13,11 @@ "forceConsistentCasingInFileNames": true, "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true + "strictNullChecks": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", "axios-mock-adapter-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/azure-mobile-services-client/tsconfig.json b/types/azure-mobile-services-client/tsconfig.json index 2094561f71..1d424df8c4 100644 --- a/types/azure-mobile-services-client/tsconfig.json +++ b/types/azure-mobile-services-client/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json index 9e2dba3353..525d24577e 100644 --- a/types/azure-sb/tsconfig.json +++ b/types/azure-sb/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/azure/tsconfig.json b/types/azure/tsconfig.json index 15e71337b2..0c4b536df2 100644 --- a/types/azure/tsconfig.json +++ b/types/azure/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/b_/tsconfig.json b/types/b_/tsconfig.json index 5271d3aeeb..9227b30bf1 100644 --- a/types/b_/tsconfig.json +++ b/types/b_/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "b_-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/babel-code-frame/tsconfig.json b/types/babel-code-frame/tsconfig.json index c2ee402de8..48e33ae829 100644 --- a/types/babel-code-frame/tsconfig.json +++ b/types/babel-code-frame/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babel-core/tsconfig.json b/types/babel-core/tsconfig.json index eb34de358f..41aee71205 100644 --- a/types/babel-core/tsconfig.json +++ b/types/babel-core/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babel-generator/tsconfig.json b/types/babel-generator/tsconfig.json index 76af52a798..76d138f54d 100644 --- a/types/babel-generator/tsconfig.json +++ b/types/babel-generator/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babel-plugin-react-pug/tsconfig.json b/types/babel-plugin-react-pug/tsconfig.json index 9e1bdd2e0c..6cb3ae3ee1 100644 --- a/types/babel-plugin-react-pug/tsconfig.json +++ b/types/babel-plugin-react-pug/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react" + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" }, - "files": [ - "index.d.ts", - "babel-plugin-react-pug-tests.tsx" - ] -} + "files": [ + "index.d.ts", + "babel-plugin-react-pug-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/babel-plugin-syntax-jsx/tsconfig.json b/types/babel-plugin-syntax-jsx/tsconfig.json index bb19fbf329..6b52644488 100644 --- a/types/babel-plugin-syntax-jsx/tsconfig.json +++ b/types/babel-plugin-syntax-jsx/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "babel-plugin-syntax-jsx-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/babel-template/tsconfig.json b/types/babel-template/tsconfig.json index 3c87fafd00..96de23cec7 100644 --- a/types/babel-template/tsconfig.json +++ b/types/babel-template/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babel-traverse/tsconfig.json b/types/babel-traverse/tsconfig.json index 01fab311ab..03dfa6ea51 100644 --- a/types/babel-traverse/tsconfig.json +++ b/types/babel-traverse/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babel-types/tsconfig.json b/types/babel-types/tsconfig.json index b5bf7f62ee..92d7d6442e 100644 --- a/types/babel-types/tsconfig.json +++ b/types/babel-types/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babelify/tsconfig.json b/types/babelify/tsconfig.json index defb24a946..9e07702ef2 100644 --- a/types/babelify/tsconfig.json +++ b/types/babelify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babylon-walk/babylon-walk-tests.ts b/types/babylon-walk/babylon-walk-tests.ts new file mode 100644 index 0000000000..f9489941df --- /dev/null +++ b/types/babylon-walk/babylon-walk-tests.ts @@ -0,0 +1,37 @@ +import * as babelTypes from "babel-types"; +import * as walk from "babylon-walk"; +declare function assert(expr: boolean): void; + +const simpleVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any) => { + state.out = 1; + }, +}; + +const ancestorVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any, ancestors: babelTypes.Node[]) => { + state.out = 2; + }, +}; + +const recursiveVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any, next: (node: babelTypes.Node) => void) => { + state.out = 3; + }, +}; + +const node: any = { + type: "File", +}; + +const state: any = { + out: 0, +}; +walk.simple(node, simpleVisitors, state); +assert(state.out === 1); + +walk.ancestor(node, ancestorVisitors, state); +assert(state.out === 2); + +walk.recursive(node, recursiveVisitors, state); +assert(state.out === 3); diff --git a/types/babylon-walk/index.d.ts b/types/babylon-walk/index.d.ts new file mode 100644 index 0000000000..02c3f39d10 --- /dev/null +++ b/types/babylon-walk/index.d.ts @@ -0,0 +1,118 @@ +// Type definitions for babylon-walk 3.10 +// Project: https://github.com/pugjs/babylon-walk +// Definitions by: Marek Buchar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as babelTypes from 'babel-types'; + +export type coreTypes = babelTypes.ArrayExpression | babelTypes.AssignmentExpression | babelTypes.BinaryExpression | + babelTypes.Directive | babelTypes.DirectiveLiteral | babelTypes.BlockStatement | babelTypes.BreakStatement | + babelTypes.CallExpression | babelTypes.CatchClause | babelTypes.ConditionalExpression | + babelTypes.ContinueStatement | babelTypes.DebuggerStatement | babelTypes.DoWhileStatement | + babelTypes.EmptyStatement | babelTypes.ExpressionStatement | babelTypes.File | babelTypes.ForInStatement | + babelTypes.ForStatement | babelTypes.FunctionDeclaration | babelTypes.FunctionExpression | babelTypes.Identifier | + babelTypes.IfStatement | babelTypes.LabeledStatement | babelTypes.StringLiteral | babelTypes.NumericLiteral | + babelTypes.NullLiteral | babelTypes.BooleanLiteral | babelTypes.RegExpLiteral | babelTypes.LogicalExpression | + babelTypes.MemberExpression | babelTypes.NewExpression | babelTypes.Program | babelTypes.ObjectExpression | + babelTypes.ObjectMethod | babelTypes.ObjectProperty | babelTypes.RestElement | babelTypes.ReturnStatement | + babelTypes.SequenceExpression | babelTypes.SwitchCase | babelTypes.SwitchStatement | babelTypes.ThisExpression | + babelTypes.ThrowStatement | babelTypes.TryStatement | babelTypes.UnaryExpression | babelTypes.UpdateExpression | + babelTypes.VariableDeclaration | babelTypes.VariableDeclarator | babelTypes.WhileStatement | + babelTypes.WithStatement; + +export type es2015Types = babelTypes.AssignmentPattern | babelTypes.ArrayPattern | babelTypes.ArrowFunctionExpression | + babelTypes.ClassBody | babelTypes.ClassDeclaration | babelTypes.ClassExpression | + babelTypes.ExportAllDeclaration | babelTypes.ExportDefaultDeclaration | babelTypes.ExportNamedDeclaration | + babelTypes.ExportSpecifier | babelTypes.ForOfStatement | babelTypes.ImportDeclaration | + babelTypes.ImportDefaultSpecifier | babelTypes.ImportNamespaceSpecifier | babelTypes.ImportSpecifier | + babelTypes.MetaProperty | babelTypes.ClassMethod | babelTypes.ObjectPattern | babelTypes.SpreadElement | + babelTypes.Super | babelTypes.TaggedTemplateExpression | babelTypes.TemplateElement | babelTypes.TemplateLiteral | + babelTypes.YieldExpression | babelTypes.AwaitExpression | babelTypes.BindExpression | babelTypes.ClassProperty | + babelTypes.Decorator | babelTypes.DoExpression | babelTypes.ExportDefaultSpecifier | + babelTypes.ExportNamespaceSpecifier; + +export type flowTypes = babelTypes.AnyTypeAnnotation | babelTypes.ArrayTypeAnnotation | babelTypes.BooleanTypeAnnotation | + babelTypes.BooleanLiteralTypeAnnotation | babelTypes.NullLiteralTypeAnnotation | babelTypes.ClassImplements | + babelTypes.DeclareClass | babelTypes.DeclareFunction | babelTypes.DeclareInterface | babelTypes.DeclareModule | + babelTypes.DeclareTypeAlias | babelTypes.DeclareVariable | babelTypes.FunctionTypeAnnotation | + babelTypes.FunctionTypeParam | babelTypes.GenericTypeAnnotation | babelTypes.InterfaceExtends | + babelTypes.InterfaceDeclaration | babelTypes.IntersectionTypeAnnotation | babelTypes.MixedTypeAnnotation | + babelTypes.NullableTypeAnnotation | babelTypes.NumberTypeAnnotation | babelTypes.ObjectTypeAnnotation | + babelTypes.ObjectTypeCallProperty | babelTypes.ObjectTypeIndexer | babelTypes.ObjectTypeProperty | + babelTypes.QualifiedTypeIdentifier | babelTypes.StringLiteralTypeAnnotation | babelTypes.StringTypeAnnotation | + babelTypes.ThisTypeAnnotation | babelTypes.TupleTypeAnnotation | babelTypes.TypeofTypeAnnotation | + babelTypes.TypeAlias | babelTypes.TypeAnnotation | babelTypes.TypeCastExpression | + babelTypes.TypeParameterDeclaration | babelTypes.TypeParameterInstantiation | babelTypes.UnionTypeAnnotation | + babelTypes.VoidTypeAnnotation; + +export type jsxTypes = babelTypes.JSXAttribute | babelTypes.JSXClosingElement | babelTypes.JSXElement | + babelTypes.JSXEmptyExpression | babelTypes.JSXExpressionContainer | babelTypes.JSXIdentifier | + babelTypes.JSXMemberExpression | babelTypes.JSXNamespacedName | babelTypes.JSXOpeningElement | + babelTypes.JSXSpreadAttribute | babelTypes.JSXText; + +export type miscTypes = babelTypes.Noop | babelTypes.ParenthesizedExpression; + +export type NodeTypes = coreTypes | es2015Types | flowTypes | jsxTypes | miscTypes; + +export interface coreVisitors { + ArrayExpression?: V; AssignmentExpression?: V; BinaryExpression?: V; Directive?: V; DirectiveLiteral?: V; + BlockStatement?: V; BreakStatement?: V; CallExpression?: V; CatchClause?: V; ConditionalExpression?: V; + ContinueStatement?: V; DebuggerStatement?: V; DoWhileStatement?: V; EmptyStatement?: V; ExpressionStatement?: V; + File?: V; ForInStatement?: V; ForStatement?: V; FunctionDeclaration?: V; FunctionExpression?: V; Identifier?: V; + IfStatement?: V; LabeledStatement?: V; StringLiteral?: V; NumericLiteral?: V; NullLiteral?: V; BooleanLiteral?: V; + RegExpLiteral?: V; LogicalExpression?: V; MemberExpression?: V; NewExpression?: V; Program?: V; + ObjectExpression?: V; ObjectMethod?: V; ObjectProperty?: V; RestElement?: V; ReturnStatement?: V; + SequenceExpression?: V; SwitchCase?: V; SwitchStatement?: V; ThisExpression?: V; ThrowStatement?: V; + TryStatement?: V; UnaryExpression?: V; UpdateExpression?: V; VariableDeclaration?: V; VariableDeclarator?: V; + WhileStatement?: V; WithStatement?: V; +} + +export interface es2015Visitors { + AssignmentPattern?: V; ArrayPattern?: V; ArrowFunctionExpression?: V; ClassBody?: V; ClassDeclaration?: V; + ClassExpression?: V; ExportAllDeclaration?: V; ExportDefaultDeclaration?: V; ExportNamedDeclaration?: V; + ExportSpecifier?: V; ForOfStatement?: V; ImportDeclaration?: V; ImportDefaultSpecifier?: V; + ImportNamespaceSpecifier?: V; ImportSpecifier?: V; MetaProperty?: V; ClassMethod?: V; ObjectPattern?: V; + SpreadElement?: V; Super?: V; TaggedTemplateExpression?: V; TemplateElement?: V; TemplateLiteral?: V; + YieldExpression?: V; AwaitExpression?: V; BindExpression?: V; ClassProperty?: V; Decorator?: V; DoExpression?: V; + ExportDefaultSpecifier?: V; ExportNamespaceSpecifier?: V; +} + +export interface flowVisitors { + AnyTypeAnnotation?: V; ArrayTypeAnnotation?: V; BooleanTypeAnnotation?: V; BooleanLiteralTypeAnnotation?: V; + NullLiteralTypeAnnotation?: V; ClassImplements?: V; DeclareClass?: V; DeclareFunction?: V; DeclareInterface?: V; + DeclareModule?: V; DeclareTypeAlias?: V; DeclareVariable?: V; FunctionTypeAnnotation?: V; FunctionTypeParam?: V; + GenericTypeAnnotation?: V; InterfaceExtends?: V; InterfaceDeclaration?: V; IntersectionTypeAnnotation?: V; + MixedTypeAnnotation?: V; NullableTypeAnnotation?: V; NumberTypeAnnotation?: V; ObjectTypeAnnotation?: V; + ObjectTypeCallProperty?: V; ObjectTypeIndexer?: V; ObjectTypeProperty?: V; QualifiedTypeIdentifier?: V; + StringLiteralTypeAnnotation?: V; StringTypeAnnotation?: V; ThisTypeAnnotation?: V; TupleTypeAnnotation?: V; + TypeofTypeAnnotation?: V; TypeAlias?: V; TypeAnnotation?: V; TypeCastExpression?: V; TypeParameterDeclaration?: V; + TypeParameterInstantiation?: V; UnionTypeAnnotation?: V; VoidTypeAnnotation?: V; +} + +export interface jsxVisitors { + JSXAttribute?: V; JSXClosingElement?: V; JSXElement?: V; JSXEmptyExpression?: V; JSXExpressionContainer?: V; + JSXIdentifier?: V; JSXMemberExpression?: V; JSXNamespacedName?: V; JSXOpeningElement?: V; JSXSpreadAttribute?: V; + JSXText?: V; +} + +export interface miscVisitors { + Noop?: V; ParenthesizedExpression?: V; +} + +export interface visitors extends coreVisitors, es2015Visitors, flowVisitors, jsxVisitors, miscVisitors { +} + +export type Visitor = (commentBlock: NodeTypes, state: any) => void; + +export type SimpleVisitor = (node: NodeTypes, state: any) => void; + +export type AncestorVisitor = (node: NodeTypes, state: any, ancestors: babelTypes.Node[]) => void; + +export type AncestorStatelessVisitor = (node: NodeTypes, state: any, ancestors: babelTypes.Node[]) => void; + +export type RecursiveVisitor = (node: NodeTypes, state: any, next: (node: babelTypes.Node) => void) => void; + +export function simple(node: NodeTypes, visitors: visitors, state: any): void; +export function ancestor(node: NodeTypes, visitors: visitors, state: any): void; +export function recursive(node: NodeTypes, visitors: visitors, state: any): void; diff --git a/types/babylon-walk/tsconfig.json b/types/babylon-walk/tsconfig.json new file mode 100644 index 0000000000..9e1d7c33b7 --- /dev/null +++ b/types/babylon-walk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "babylon-walk-tests.ts" + ] +} \ No newline at end of file diff --git a/types/babylon-walk/tslint.json b/types/babylon-walk/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/babylon-walk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/babylon/tsconfig.json b/types/babylon/tsconfig.json index cd72fd759f..94d5c0bd59 100644 --- a/types/babylon/tsconfig.json +++ b/types/babylon/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/babyparse/tsconfig.json b/types/babyparse/tsconfig.json index 062572c4ef..da28a97d29 100644 --- a/types/babyparse/tsconfig.json +++ b/types/babyparse/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone-associations/tsconfig.json b/types/backbone-associations/tsconfig.json index cb81dcd498..7f905ff541 100644 --- a/types/backbone-associations/tsconfig.json +++ b/types/backbone-associations/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone-fetch-cache/tsconfig.json b/types/backbone-fetch-cache/tsconfig.json index 2625930e32..28c3240abc 100644 --- a/types/backbone-fetch-cache/tsconfig.json +++ b/types/backbone-fetch-cache/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone-relational/tsconfig.json b/types/backbone-relational/tsconfig.json index 5d127f3c0d..961582a08f 100644 --- a/types/backbone-relational/tsconfig.json +++ b/types/backbone-relational/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone.layoutmanager/tsconfig.json b/types/backbone.layoutmanager/tsconfig.json index 69b4f4d064..85b5e97b31 100644 --- a/types/backbone.layoutmanager/tsconfig.json +++ b/types/backbone.layoutmanager/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone.localstorage/tsconfig.json b/types/backbone.localstorage/tsconfig.json index 60a7e9a9b7..65302c1d16 100644 --- a/types/backbone.localstorage/tsconfig.json +++ b/types/backbone.localstorage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone.marionette/tsconfig.json b/types/backbone.marionette/tsconfig.json index ab08adc897..b31d3cbfa4 100644 --- a/types/backbone.marionette/tsconfig.json +++ b/types/backbone.marionette/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone.paginator/tsconfig.json b/types/backbone.paginator/tsconfig.json index eae23a6868..453c5e2861 100644 --- a/types/backbone.paginator/tsconfig.json +++ b/types/backbone.paginator/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone.radio/tsconfig.json b/types/backbone.radio/tsconfig.json index 87431e3006..024840f373 100644 --- a/types/backbone.radio/tsconfig.json +++ b/types/backbone.radio/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 806086943e..42a322e4c2 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -219,7 +219,7 @@ declare namespace Backbone { /** * Specify a model attribute name (string) or function that will be used to sort the collection. */ - comparator: string | ((element: TModel) => number | string) | ((compare: TModel, to?: TModel) => number); + comparator: string | { bivarianceHack(element: TModel): number | string }["bivarianceHack"] | { bivarianceHack(compare: TModel, to?: TModel): number }["bivarianceHack"]; add(model: {}|TModel, options?: AddOptions): TModel; add(models: ({}|TModel)[], options?: AddOptions): TModel[]; diff --git a/types/backbone/tsconfig.json b/types/backbone/tsconfig.json index efe348dbd6..c1185d6adf 100644 --- a/types/backbone/tsconfig.json +++ b/types/backbone/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backgrid/tsconfig.json b/types/backgrid/tsconfig.json index 9a32a5ab8c..f2db8efd4c 100644 --- a/types/backgrid/tsconfig.json +++ b/types/backgrid/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backlog-js/tsconfig.json b/types/backlog-js/tsconfig.json index 3e426132ba..360392d4ca 100644 --- a/types/backlog-js/tsconfig.json +++ b/types/backlog-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/backoff/index.d.ts b/types/backoff/index.d.ts index 1c2f1ea605..404b01c4b2 100644 --- a/types/backoff/index.d.ts +++ b/types/backoff/index.d.ts @@ -101,7 +101,7 @@ export function call(wrappedFunction: (t1: T1, t2: T2, t3: T3 export function call(wrappedFunction: (t1: T1, t2: T2, t3: T3, cb: (err: E) => void) => void, t1: T1, t2: T2, t3: T3, callback: (err: E) => void): TypedFunctionCall<[T1, T2, T3], E>; -export function call(wrappedFunction: (...args: any[]) => void, ...args: any[]): FunctionCallAny; +export function call(wrappedFunction: (...args: any[]) => void, ...args: any[]): FunctionCallAny; export class Backoff extends EventEmitter { /** diff --git a/types/backoff/tsconfig.json b/types/backoff/tsconfig.json index ed5117f056..1946d82f81 100644 --- a/types/backoff/tsconfig.json +++ b/types/backoff/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "backoff-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/baconjs/tsconfig.json b/types/baconjs/tsconfig.json index e1cdb7a71c..c9d82e16f7 100644 --- a/types/baconjs/tsconfig.json +++ b/types/baconjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bagpipes/tsconfig.json b/types/bagpipes/tsconfig.json index 6097fdb56d..56d9d43a52 100755 --- a/types/bagpipes/tsconfig.json +++ b/types/bagpipes/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bagpipes-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index 6af444e434..6504c4665a 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -8,6 +8,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -15,4 +21,4 @@ "index.d.ts", "baidumap-web-sdk-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/barcode/tsconfig.json b/types/barcode/tsconfig.json index 31a5f27c67..a66d2ab178 100644 --- a/types/barcode/tsconfig.json +++ b/types/barcode/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bardjs/tsconfig.json b/types/bardjs/tsconfig.json index c4c59ddd37..bd5226a586 100644 --- a/types/bardjs/tsconfig.json +++ b/types/bardjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/base-64/tsconfig.json b/types/base-64/tsconfig.json index 279b296c5e..49de73c3ef 100644 --- a/types/base-64/tsconfig.json +++ b/types/base-64/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/base-x/tsconfig.json b/types/base-x/tsconfig.json index 2ece07fe8e..d69790c7d6 100644 --- a/types/base-x/tsconfig.json +++ b/types/base-x/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/base16/tsconfig.json b/types/base16/tsconfig.json index c4c07afcfb..d354b0ba01 100644 --- a/types/base16/tsconfig.json +++ b/types/base16/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/base64-js/tsconfig.json b/types/base64-js/tsconfig.json index a202fdd2e8..3a65d8af45 100644 --- a/types/base64-js/tsconfig.json +++ b/types/base64-js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bases/tsconfig.json b/types/bases/tsconfig.json index aad84d2782..4b8912ac99 100644 --- a/types/bases/tsconfig.json +++ b/types/bases/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/basic-auth/tsconfig.json b/types/basic-auth/tsconfig.json index 8d9222de2c..7c49ef4d01 100644 --- a/types/basic-auth/tsconfig.json +++ b/types/basic-auth/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/batch-stream/tsconfig.json b/types/batch-stream/tsconfig.json index 51de2a9b7e..e99f40b376 100644 --- a/types/batch-stream/tsconfig.json +++ b/types/batch-stream/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bazinga-translator/tsconfig.json b/types/bazinga-translator/tsconfig.json index c2d466d99c..1ca08ada9b 100644 --- a/types/bazinga-translator/tsconfig.json +++ b/types/bazinga-translator/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bcrypt-nodejs/tsconfig.json b/types/bcrypt-nodejs/tsconfig.json index 06067a179a..1d7991ff5f 100644 --- a/types/bcrypt-nodejs/tsconfig.json +++ b/types/bcrypt-nodejs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bcrypt/tsconfig.json b/types/bcrypt/tsconfig.json index 75c9449444..97c8808944 100644 --- a/types/bcrypt/tsconfig.json +++ b/types/bcrypt/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bcryptjs/tsconfig.json b/types/bcryptjs/tsconfig.json index b0e90ac993..094f87744c 100644 --- a/types/bcryptjs/tsconfig.json +++ b/types/bcryptjs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bem-cn/tsconfig.json b/types/bem-cn/tsconfig.json index a4c2cd86cb..e9212d8d91 100644 --- a/types/bem-cn/tsconfig.json +++ b/types/bem-cn/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bem-cn-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/benchmark/tsconfig.json b/types/benchmark/tsconfig.json index ed72dc5a3f..ba1b6a3e55 100644 --- a/types/benchmark/tsconfig.json +++ b/types/benchmark/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/better-curry/tsconfig.json b/types/better-curry/tsconfig.json index 83627e6874..e5ceee43fc 100644 --- a/types/better-curry/tsconfig.json +++ b/types/better-curry/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/better-sqlite3/tsconfig.json b/types/better-sqlite3/tsconfig.json index fa406408e4..30a480355b 100644 --- a/types/better-sqlite3/tsconfig.json +++ b/types/better-sqlite3/tsconfig.json @@ -7,11 +7,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], - "types": [], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -19,4 +20,4 @@ "index.d.ts", "better-sqlite3-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bezier-easing/tsconfig.json b/types/bezier-easing/tsconfig.json index 9b3d620719..2603e9bae8 100644 --- a/types/bezier-easing/tsconfig.json +++ b/types/bezier-easing/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bezier-js/tsconfig.json b/types/bezier-js/tsconfig.json index 8c5c4a2044..02796cc09c 100644 --- a/types/bezier-js/tsconfig.json +++ b/types/bezier-js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bgiframe/tsconfig.json b/types/bgiframe/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/bgiframe/tsconfig.json +++ b/types/bgiframe/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/big.js/tsconfig.json b/types/big.js/tsconfig.json index ed3368dd05..950e8b410f 100644 --- a/types/big.js/tsconfig.json +++ b/types/big.js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "test/big.js-module-tests.ts", "test/big.js-global-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bigi/tsconfig.json b/types/bigi/tsconfig.json index f8424bbea7..de6aa90a97 100644 --- a/types/bigi/tsconfig.json +++ b/types/bigi/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bigint/tsconfig.json b/types/bigint/tsconfig.json index 48165aac98..37005189a4 100644 --- a/types/bigint/tsconfig.json +++ b/types/bigint/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bignum/tsconfig.json b/types/bignum/tsconfig.json index c875979dba..15cb8a7b4f 100644 --- a/types/bignum/tsconfig.json +++ b/types/bignum/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bignumber.js/tsconfig.json b/types/bignumber.js/tsconfig.json index 485dace353..6355540e00 100644 --- a/types/bignumber.js/tsconfig.json +++ b/types/bignumber.js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bigscreen/tsconfig.json b/types/bigscreen/tsconfig.json index cdf467e715..71230cc8e1 100644 --- a/types/bigscreen/tsconfig.json +++ b/types/bigscreen/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bind-ponyfill/tsconfig.json b/types/bind-ponyfill/tsconfig.json index 3fcedeaa10..29d2a7cac2 100644 --- a/types/bind-ponyfill/tsconfig.json +++ b/types/bind-ponyfill/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bingmaps/tsconfig.json b/types/bingmaps/tsconfig.json index b552120da3..ecb179959d 100644 --- a/types/bingmaps/tsconfig.json +++ b/types/bingmaps/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "bingmaps-tests.ts" ] -} \ No newline at end of file +} \ No newline at end of file diff --git a/types/bintrees/tsconfig.json b/types/bintrees/tsconfig.json index 15bdb88c5b..d21ec38c1e 100644 --- a/types/bintrees/tsconfig.json +++ b/types/bintrees/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bip21/tsconfig.json b/types/bip21/tsconfig.json index 338634335b..be0b017722 100644 --- a/types/bip21/tsconfig.json +++ b/types/bip21/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bit-array/tsconfig.json b/types/bit-array/tsconfig.json index e8ccde051f..ba2e9e32a2 100644 --- a/types/bit-array/tsconfig.json +++ b/types/bit-array/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 549de76507..868659e6b6 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -53,7 +53,7 @@ describe('bitcoinjs-lib (basic)', () => { const tx = new bitcoin.TransactionBuilder(); tx.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); - tx.addOutput(Buffer.from('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK'), 15000); + tx.addOutput(Buffer.from('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 'utf8'), 15000); tx.sign(0, keyPair); // tslint:disable-next-line:max-line-length diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 986bb75e0b..796758715d 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -132,7 +132,7 @@ export class HDNode { toBase58(): string; - verify(hash: Buffer, signature: ECSignature): Buffer; + verify(hash: Buffer, signature: ECSignature): boolean; static HIGHEST_BIT: number; @@ -204,6 +204,15 @@ export class Transaction { } export class TransactionBuilder { + tx: Transaction; + inputs: Array<{ pubKeys: Buffer[], + signatures: Buffer[], + prevOutScript: Buffer, + prevOutType: string, + signType: string, + signScript: Buffer, + witness: boolean} >; + constructor(network?: Network, maximumFeeRate?: number); addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number; diff --git a/types/bitcoinjs-lib/tsconfig.json b/types/bitcoinjs-lib/tsconfig.json index d1f5ec75b6..f874ae9858 100644 --- a/types/bitcoinjs-lib/tsconfig.json +++ b/types/bitcoinjs-lib/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bitcoinjs-lib-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bittorrent-protocol/tsconfig.json b/types/bittorrent-protocol/tsconfig.json index 1bc778df1b..f128669698 100644 --- a/types/bittorrent-protocol/tsconfig.json +++ b/types/bittorrent-protocol/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bittorrent-protocol-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bitwise-xor/tsconfig.json b/types/bitwise-xor/tsconfig.json index 91381b1d2e..a6b66cda37 100644 --- a/types/bitwise-xor/tsconfig.json +++ b/types/bitwise-xor/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bl/tsconfig.json b/types/bl/tsconfig.json index 375fd905e2..0f7c861ce8 100644 --- a/types/bl/tsconfig.json +++ b/types/bl/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/blacklist/tsconfig.json b/types/blacklist/tsconfig.json index 6fa73f1772..76cb49e40f 100644 --- a/types/blacklist/tsconfig.json +++ b/types/blacklist/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/blazy/tsconfig.json b/types/blazy/tsconfig.json index 633c77ad25..e452d910ec 100644 --- a/types/blazy/tsconfig.json +++ b/types/blazy/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bleno/tsconfig.json b/types/bleno/tsconfig.json index 44fa6c893f..338f3e3d24 100644 --- a/types/bleno/tsconfig.json +++ b/types/bleno/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bleno-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index abbc31d295..553942af2f 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for blessed 0.1.5 +// Type definitions for blessed 0.1.6 // Project: https://github.com/chjj/blessed // Definitions by: bryn austin bellomy // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -74,7 +74,7 @@ declare namespace Blessed { /** * Shape of the cursor. Can be: block, underline, or line. */ - shape: boolean; + shape: 'block'|'underline'|'line'; /** * Whether the cursor blinks. */ @@ -2821,6 +2821,7 @@ declare namespace Blessed { export function question(options?: Widgets.QuestionOptions): Widgets.QuestionElement; export function message(options?: Widgets.MessageOptions): Widgets.MessageElement; export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; + export function log(options?: Widgets.LogOptions): Widgets.Log; export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; diff --git a/types/blessed/tsconfig.json b/types/blessed/tsconfig.json index 2744f7039b..e57d4b78d6 100644 --- a/types/blessed/tsconfig.json +++ b/types/blessed/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/blissfuljs/tsconfig.json b/types/blissfuljs/tsconfig.json index 9d04254081..42087d76ef 100644 --- a/types/blissfuljs/tsconfig.json +++ b/types/blissfuljs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/blob-stream/tsconfig.json b/types/blob-stream/tsconfig.json index f29a772ddd..2ebe6cacb9 100644 --- a/types/blob-stream/tsconfig.json +++ b/types/blob-stream/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/blob-to-buffer/blob-to-buffer-tests.ts b/types/blob-to-buffer/blob-to-buffer-tests.ts new file mode 100644 index 0000000000..21d9508469 --- /dev/null +++ b/types/blob-to-buffer/blob-to-buffer-tests.ts @@ -0,0 +1,6 @@ +import blobToBuffer = require("blob-to-buffer"); + +blobToBuffer(new Blob(), (error, buffer) => { + console.log(error); + console.log(buffer); +}); diff --git a/types/blob-to-buffer/index.d.ts b/types/blob-to-buffer/index.d.ts new file mode 100644 index 0000000000..8c8156963e --- /dev/null +++ b/types/blob-to-buffer/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for blob-to-buffer 1.2 +// Project: https://github.com/feross/blob-to-buffer +// Definitions by: nrlquaker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare function blobToBuffer(blob: Blob, callback: (error: any, buffer: Buffer) => void): void; +declare namespace blobToBuffer {} +export = blobToBuffer; diff --git a/types/blob-to-buffer/tsconfig.json b/types/blob-to-buffer/tsconfig.json new file mode 100644 index 0000000000..2421ce2493 --- /dev/null +++ b/types/blob-to-buffer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "blob-to-buffer-tests.ts" + ] +} diff --git a/types/blob-to-buffer/tslint.json b/types/blob-to-buffer/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/blob-to-buffer/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/blob-util/index.d.ts b/types/blob-util/index.d.ts index 3e900f0ecb..9ab6cb4b5f 100644 --- a/types/blob-util/index.d.ts +++ b/types/blob-util/index.d.ts @@ -4,14 +4,70 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +/** + * Shim for new Blob() to support older browsers that use the deprecated BlobBuilder API. + * + * @param parts content of the Blob + * @param options usually just `{ type: mimeType }` + */ export function createBlob(parts: any[], options?: { type: string }): Blob; + +/** + * Shim for URL.createObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). + * + * @param blob + */ export function createObjectURL(blob: Blob): string; + +/** + * Shim for URL.revokeObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). + * + * @param url + */ export function revokeObjectURL(url: string): void; + +/** + * Convert a Blob to a binary string. + * + * @param blob + */ export function blobToBinaryString(blob: Blob): Promise; + +/** + * Convert a binary string to a Blob. + * + * @param binary + * @param type the content type + */ export function binaryStringToBlob(binary: string, type?: string): Promise; + +/** + * Convert a Blob to a base-64 string. + * + * @param blob + */ export function blobToBase64String(blob: Blob): Promise; + +/** + * Convert a base-64 string to a Blob. + * + * @param base64 + * @param type the content type + */ export function base64StringToBlob(base64: string, type?: string): Promise; + +/** + * Convert a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`) to a Blob. + * + * @param dataURL + */ export function dataURLToBlob(dataURL: string): Promise; + +/** + * Convert a Blob to a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`). + * + * @param blob + */ export function blobToDataURL(blob: Blob): Promise; /** @@ -47,5 +103,17 @@ export function canvasToBlob(canvas: HTMLCanvasElement, type?: string, quality?: */ export function imgSrcToBlob(src: string, type?: string, crossOrigin?: string, quality?: number): Promise; +/** + * Convert an ArrayBuffer to a Blob. + * + * @param arrayBuff + * @param type the content type + */ export function arrayBufferToBlob(arrayBuff: ArrayBuffer, type?: string): Promise; + +/** + * Convert a Blob to an ArrayBuffer. + * + * @param blob + */ export function blobToArrayBuffer(blob: Blob): Promise; diff --git a/types/blob-util/tsconfig.json b/types/blob-util/tsconfig.json index f34519775d..7f7970ab0b 100644 --- a/types/blob-util/tsconfig.json +++ b/types/blob-util/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "blob-util-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/blocks/tsconfig.json b/types/blocks/tsconfig.json index 40215f80a6..85da699a13 100644 --- a/types/blocks/tsconfig.json +++ b/types/blocks/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bloomfilter/tsconfig.json b/types/bloomfilter/tsconfig.json index b8bae54b77..76ea34c251 100644 --- a/types/bloomfilter/tsconfig.json +++ b/types/bloomfilter/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bloomfilter-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bloomfilter-tests.ts" + ] +} \ No newline at end of file diff --git a/types/blue-tape/tsconfig.json b/types/blue-tape/tsconfig.json index 4740d06fa7..a4fc12b9e1 100644 --- a/types/blue-tape/tsconfig.json +++ b/types/blue-tape/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json index 642b097309..d037429e0d 100644 --- a/types/bluebird-global/tsconfig.json +++ b/types/bluebird-global/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bluebird-retry/tsconfig.json b/types/bluebird-retry/tsconfig.json index 9d40873998..5ae2b487db 100644 --- a/types/bluebird-retry/tsconfig.json +++ b/types/bluebird-retry/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index 27749122a3..4a5ce00e15 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -7,26 +7,26 @@ import Promise = require("bluebird"); -var obj: Object; -var bool: boolean; -var num: number; -var str: string; -var err: Error; -var x: any; -var f: (...args: any[]) => any; -var asyncfunc: (...args: any[]) => Promise; -var arr: any[]; -var exp: RegExp; -var anyArr: any[]; -var strArr: string[]; -var numArr: number[]; -var voidVar: void; +let obj: object; +let bool: boolean; +let num: number; +let str: string; +let err: Error; +let x: any; +let f: (...args: any[]) => any; +let asyncfunc: (...args: any[]) => Promise; +let arr: any[]; +let exp: RegExp; +let anyArr: any[]; +let strArr: string[]; +let numArr: number[]; +let voidVar: void; // - - - - - - - - - - - - - - - - - -var value: any; -var reason: any; -var insanity: any; +let value: any; +let reason: any; +let insanity: any; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -43,120 +43,120 @@ interface Baz { // - - - - - - - - - - - - - - - - - interface StrFooMap { - [key:string]:Foo; + [key: string]: Foo; } interface StrBarMap { - [key:string]:Bar; + [key: string]: Bar; } // - - - - - - - - - - - - - - - - - interface StrFooArrMap { - [key:string]:Foo[]; + [key: string]: Foo[]; } interface StrBarArrMap { - [key:string]:Bar[]; + [key: string]: Bar[]; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var foo: Foo; -var bar: Bar; -var baz: Baz; +let foo: Foo; +let bar: Bar; +let baz: Baz; -var fooArr: Foo[]; -var barArr: Bar[]; +let fooArr: Foo[]; +let barArr: Bar[]; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var numProm: Promise; -var strProm: Promise; -var anyProm: Promise; -var boolProm: Promise; -var objProm: Promise; -var voidProm: Promise; +let numProm: Promise; +let strProm: Promise; +let anyProm: Promise; +let boolProm: Promise; +let objProm: Promise; +let voidProm: Promise; -var fooProm: Promise; -var barProm: Promise; -var barOrVoidProm: Promise; -var fooOrBarProm: Promise; -var bazProm: Promise; +let fooProm: Promise; +let barProm: Promise; +let barOrVoidProm: Promise; +let fooOrBarProm: Promise; +let bazProm: Promise; // - - - - - - - - - - - - - - - - - -var numThen: PromiseLike; -var strThen: PromiseLike; -var anyThen: PromiseLike; -var boolThen: PromiseLike; -var objThen: PromiseLike; -var voidThen: PromiseLike; +let numThen: PromiseLike; +let strThen: PromiseLike; +let anyThen: PromiseLike; +let boolThen: PromiseLike; +let objThen: PromiseLike; +let voidThen: PromiseLike; -var fooThen: PromiseLike; -var barThen: PromiseLike; +let fooThen: PromiseLike; +let barThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var numArrProm: Promise; -var strArrProm: Promise; -var anyArrProm: Promise; +let numArrProm: Promise; +let strArrProm: Promise; +let anyArrProm: Promise; -var fooArrProm: Promise; -var barArrProm: Promise; +let fooArrProm: Promise; +let barArrProm: Promise; // - - - - - - - - - - - - - - - - - -var numArrThen: PromiseLike; -var strArrThen: PromiseLike; -var anyArrThen: PromiseLike; +let numArrThen: PromiseLike; +let strArrThen: PromiseLike; +let anyArrThen: PromiseLike; -var fooArrThen: PromiseLike; -var barArrThen: PromiseLike; +let fooArrThen: PromiseLike; +let barArrThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var numPromArr: Promise[]; -var strPromArr: Promise[]; -var anyPromArr: Promise[]; +let numPromArr: Array>; +let strPromArr: Array>; +let anyPromArr: Array>; -var fooPromArr: Promise[]; -var barPromArr: Promise[]; +let fooPromArr: Array>; +let barPromArr: Array>; // - - - - - - - - - - - - - - - - - -var numThenArr: PromiseLike[]; -var strThenArr: PromiseLike[]; -var anyThenArr: PromiseLike[]; +let numThenArr: Array>; +let strThenArr: Array>; +let anyThenArr: Array>; -var fooThenArr: PromiseLike[]; -var barThenArr: PromiseLike[]; +let fooThenArr: Array>; +let barThenArr: Array>; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // booya! -var fooThenArrThen: PromiseLike[]>; -var barThenArrThen: PromiseLike[]>; +let fooThenArrThen: PromiseLike>>; +let barThenArrThen: PromiseLike>>; -var fooResolver: Promise.Resolver; -var barResolver: Promise.Resolver; +let fooResolver: Promise.Resolver; +let barResolver: Promise.Resolver; -var fooInspection: Promise.Inspection; -var fooInspectionPromise: Promise>; +let fooInspection: Promise.Inspection; +let fooInspectionPromise: Promise>; -var fooInspectionArrProm: Promise[]>; -var barInspectionArrProm: Promise[]>; +let fooInspectionArrProm: Promise>>; +let barInspectionArrProm: Promise>>; -var BlueBird: typeof Promise; +let BlueBird: typeof Promise; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var version: string = Promise.version; +let version: string = Promise.version; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {} -var nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {} +let nodeCallbackFunc = (callback: (err: any, result: string) => void) => {}; +let nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {}; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -168,8 +168,7 @@ barThen = barProm; fooProm = new Promise((resolve: (value: Foo) => void, reject: (reason: any) => void) => { if (bool) { resolve(foo); - } - else { + } else { reject(new Error(str)); } }); @@ -185,8 +184,7 @@ fooProm = new Promise((resolve: (value: Foo) => void) => { fooProm = new Promise((resolve, reject) => { if (bool) { resolve(fooThen); - } - else { + } else { reject(new Error(str)); } }); @@ -200,9 +198,7 @@ fooResolver.resolve(foo); fooResolver.reject(err); -fooResolver.callback = (err: any, value: Foo) => { - -}; +fooResolver.callback = (err: any, value: Foo) => {}; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -239,7 +235,7 @@ barProm = fooProm.then((value: Foo) => { }); barProm = barProm.then((value: Bar) => { if (value) return value; - var b:Bar; + let b: Bar; return Promise.resolve(b); }); @@ -282,7 +278,7 @@ fooProm = fooProm.caught((error: any) => { }); fooProm = fooProm.catch((reason: any) => { - //handle multiple valid return types simultaneously + // handle multiple valid return types simultaneously if (foo === null) { return; } else if (!reason) { @@ -341,22 +337,22 @@ fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class CustomError extends Error { - public customField: number; + customField: number; } fooProm = fooProm.catch(CustomError, reason => { - let a: number = reason.customField -}) + let a: number = reason.customField; +}); { class CustomErrorWithConstructor extends Error { constructor(public arg1: boolean, public arg2: number) { super(); - }; + } } fooProm = fooProm.catch(CustomErrorWithConstructor, reason => { let a: boolean = reason.arg1; let b: number = reason.arg2; - }) + }); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -377,7 +373,7 @@ fooProm = fooProm.catch(CustomError, reason => { const booPredicate1 = (error: CustomError1) => true; const booPredicate2 = (error: [number]) => true; const booPredicate3 = (error: string) => true; - const booPredicate4 = (error: Object) => true; + const booPredicate4 = (error: object) => true; const booPredicate5 = (error: any) => true; fooProm = fooProm.catch(booPredicate1, error => {}); @@ -527,7 +523,7 @@ bool = fooProm.isResolved(); anyProm = fooProm.call(str); anyProm = fooProm.call(str, 1, 2, 3); -//TODO enable get() test when implemented +// TODO enable get() test when implemented // barProm = fooProm.get(str); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -573,7 +569,7 @@ barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO fix collection inference +// TODO fix collection inference barArrProm = fooProm.all(); fooInspectionPromise = fooProm.reflect(); @@ -583,16 +579,16 @@ barProm = fooProm.race(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var propsValue: { num: number, str: string }; -Promise.resolve({ num: 1, str: Promise.resolve('a') }).props().then(val => { propsValue = val }); -Promise.props({ num: 1, str: Promise.resolve('a') }).then(val => { propsValue = val }); -Promise.props(Promise.props({ num: 1, str: Promise.resolve('a') })).then(val => { propsValue = val }); +let propsValue: { num: number, str: string }; +Promise.resolve({ num: 1, str: Promise.resolve('a') }).props().then(val => { propsValue = val; }); +Promise.props({ num: 1, str: Promise.resolve('a') }).then(val => { propsValue = val; }); +Promise.props(Promise.props({ num: 1, str: Promise.resolve('a') })).then(val => { propsValue = val; }); -var propsMapValue: Map; -Promise.resolve(new Map()).props().then(val => { propsMapValue = val }); -Promise.resolve(new Map>()).props().then(val => { propsMapValue = val }); -Promise.props(new Map()).then(val => { propsMapValue = val }); -Promise.props(new Map>()).then(val => { propsMapValue = val }); +let propsMapValue: Map; +Promise.resolve(new Map()).props().then(val => { propsMapValue = val; }); +Promise.resolve(new Map>()).props().then(val => { propsMapValue = val; }); +Promise.props(new Map()).then(val => { propsMapValue = val; }); +Promise.props(new Map>()).then(val => { propsMapValue = val; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -620,7 +616,7 @@ Promise.all([fooProm, barProm, fooProm]).then(result => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO fix collection inference +// TODO fix collection inference barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; @@ -649,7 +645,6 @@ barArrProm = fooArrProm.mapSeries((item: Foo) => { return bar; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { @@ -755,9 +750,7 @@ fooProm = Promise.attempt(() => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -asyncfunc = Promise.method(function () { - -}); +asyncfunc = Promise.method(() => {}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -785,7 +778,7 @@ Promise.longStackTraces(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO enable delay +// TODO enable delay fooProm = Promise.delay(num, fooThen); fooProm = Promise.delay(num, foo); @@ -809,22 +802,22 @@ anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback), // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -declare var util: any; +declare let util: any; -function defaultFilter(name: string, func: Function) { +function defaultFilter(name: string, func: (...args: any[]) => any) { return util.isIdentifier(name) && name.charAt(0) !== "_" && !util.isClass(func); } -function DOMPromisifier(originalMethod: Function) { +function DOMPromisifier(originalMethod: (...args: any[]) => any) { // return a function return function promisified() { - var args = [].slice.call(arguments); + let args = [].slice.call(arguments); // Needed so that the original method can be called with the correct receiver - var self = this; + let self = this; // which returns a promise - return new Promise(function(resolve, reject) { + return new Promise((resolve, reject) => { args.push(resolve, reject); originalMethod.apply(self, args); }); @@ -839,10 +832,12 @@ obj = Promise.promisifyAll(obj, { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO enable generator -/* - func = Promise.coroutine(f); +const generator = function*(a: number, b: string) { return "string"; }; +const coroutine = Promise.coroutine(generator); +coroutine(5, "foo").then((x: string) => {}); +const coroutineCustomYield = Promise.coroutine(generator, { yieldHandler: (value) => "whatever" }); +/* barProm = Promise.spawn(f); */ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -850,13 +845,11 @@ obj = Promise.promisifyAll(obj, { BlueBird = Promise.getNewLibraryCopy(); BlueBird = Promise.noConflict(); -Promise.onPossiblyUnhandledRejection((reason: any) => { - -}); +Promise.onPossiblyUnhandledRejection((reason: any) => {}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooArrProm = Promise.all(fooThenArrThen); fooArrProm = Promise.all(fooArrProm); fooArrProm = Promise.all(fooThenArr); @@ -869,7 +862,7 @@ objProm = Promise.props(obj); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooProm = Promise.any(fooThenArrThen); fooProm = Promise.any(fooArrProm); fooProm = Promise.any(fooThenArr); @@ -877,7 +870,7 @@ fooProm = Promise.any(fooArr); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooProm = Promise.race(fooThenArrThen); fooProm = Promise.race(fooArrProm); fooProm = Promise.race(fooThenArr); @@ -885,7 +878,7 @@ fooProm = Promise.race(fooArr); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooArrProm = Promise.some(fooThenArrThen, num); fooArrProm = Promise.some(fooThenArr, num); fooArrProm = Promise.some(fooArr, num); @@ -1088,7 +1081,6 @@ barArrProm = Promise.mapSeries(fooArrThen, (item: Foo, index: number, arrayLengt return barThen; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // fooThenArr @@ -1106,7 +1098,6 @@ barArrProm = Promise.mapSeries(fooThenArr, (item: Foo, index: number, arrayLengt return barThen; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // fooArr @@ -1124,7 +1115,6 @@ barArrProm = Promise.mapSeries(fooArr, (item: Foo, index: number, arrayLength: n return barThen; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // reduce() diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 7c879d1cf7..d88d4d704b 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bluebird 3.5.0 +// Type definitions for bluebird 3.5 // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -340,8 +340,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `.finally()`, but not called for rejections. */ - tap(onFulFill: (value: R) => PromiseLike): Bluebird; - tap(onFulfill: (value: R) => U): Bluebird; + tap(onFulFill: (value: R) => PromiseLike | U): Bluebird; /** * Like `.catch()` but rethrows the error @@ -350,33 +349,33 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, onReject: (error: E1) => U | PromiseLike, ): Bluebird; @@ -521,33 +520,33 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { catchReturn(value: U): Bluebird; catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, value: U, ): Bluebird; @@ -565,33 +564,33 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { catchThrow(reason: Error): Bluebird; catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; @@ -603,7 +602,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. */ - toJSON(): Object; + toJSON(): object; /** * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. @@ -695,6 +694,11 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. * This method is convenient when a function can sometimes return synchronously or throw synchronously. */ + static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird; + static method(fn: (arg1: A1, arg2: A2) => R | PromiseLike): (arg1: A1, arg2: A2) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; static method(fn: (...args: any[]) => R | PromiseLike): (...args: any[]) => Bluebird; /** @@ -763,7 +767,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. */ // TODO how to model promisifyAll? - static promisifyAll(target: Object, options?: Bluebird.PromisifyAllOptions): Object; + static promisifyAll(target: object, options?: Bluebird.PromisifyAllOptions): object; /** * Returns a promise that is resolved by a node style callback function. @@ -776,9 +780,17 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. */ - // TODO fix coroutine GeneratorFunction - static coroutine(generatorFunction: (...args: any[]) => IterableIterator): (...args: any[]) => Bluebird; - + // TODO: After https://github.com/Microsoft/TypeScript/issues/2983 is implemented, we can use + // the return type propagation of generators to automatically infer the return type T. + static coroutine(generatorFunction: () => IterableIterator, options?: Bluebird.CoroutineOptions): () => Bluebird; + static coroutine(generatorFunction: (a1: A1) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird; + static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird; /** * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. * @@ -797,7 +809,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; static all(values: [PromiseLike | T1]): Bluebird<[T1]>; // array with values - static all(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; + static all(values: PromiseLike | R>> | Array | R>): Bluebird; /** * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. @@ -806,25 +818,26 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * *The original object is not modified.* */ - // trusted promise for object + // trusted promise for map static props(map: PromiseLike | V>>): Bluebird>; - static props(object: PromiseLike>): Bluebird; + // trusted promise for object + static props(object: PromiseLike>): Bluebird; // tslint:disable-line:unified-signatures // map - static props(map: Map | V>): Bluebird>; + static props(map: Map | V>): Bluebird>; // tslint:disable-line:unified-signatures // object - static props(object: Bluebird.ResolvableProps): Bluebird; + static props(object: Bluebird.ResolvableProps): Bluebird; // tslint:disable-line:unified-signatures /** * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. */ - static any(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; + static any(values: PromiseLike | R>> | Array | R>): Bluebird; /** * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. * * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. */ - static race(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; + static race(values: PromiseLike | R>> | Array | R>): Bluebird; /** * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. @@ -833,14 +846,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * *The original array is not modified.* */ - // promise of array with promises of value - static some(values: PromiseLike[]>, count: number): Bluebird; - // promise of array with values - static some(values: PromiseLike, count: number): Bluebird; - // array with promises of value - static some(values: PromiseLike[], count: number): Bluebird; - // array with values - static some(values: R[], count: number): Bluebird; + static some(values: PromiseLike | R>> | Array | R>, count: number): Bluebird; /** * Promise.join( @@ -859,7 +865,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { // variadic array /** @deprecated use .all instead */ - static join(...values: (R | PromiseLike)[]): Bluebird; + static join(...values: Array>): Bluebird; /** * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. @@ -868,17 +874,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * *The original array is not modified.* */ - // promise of array with promises of value - static map(values: PromiseLike[]>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - // promise of array with values - static map(values: PromiseLike, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - // array with promises of value - static map(values: PromiseLike[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - // array with values - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + static map(values: PromiseLike | R>> | Array | R>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; /** * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. @@ -887,17 +883,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ - // promise of array with promises of value - static reduce(values: PromiseLike[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - // promise of array with values - static reduce(values: PromiseLike, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - // array with promises of value - static reduce(values: PromiseLike[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - // array with values - static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; + static reduce(values: PromiseLike | R>> | Array | R>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; /** * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. @@ -906,29 +892,14 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * *The original array is not modified. */ - // promise of array with promises of value - static filter(values: PromiseLike[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - // promise of array with values - static filter(values: PromiseLike, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - // array with promises of value - static filter(values: PromiseLike[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - // array with values - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter(values: PromiseLike | R>> | Array | R>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; /** * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. * * Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. */ - // promise of array with promises of value - static each(values: PromiseLike[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - // array with promises of value - static each(values: PromiseLike[], iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - // array with values OR promise of array with values - static each(values: R[] | PromiseLike, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + static each(values: PromiseLike | R>> | Array | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; /** * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. @@ -937,7 +908,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. */ - static mapSeries(values: (R | PromiseLike)[] | PromiseLike<(R | PromiseLike)[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + static mapSeries(values: PromiseLike | R>> | Array | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; /** * A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`. @@ -993,7 +964,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. */ - static Promise: typeof Bluebird + static Promise: typeof Bluebird; /** * The version number of the library @@ -1002,24 +973,27 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { } declare namespace Bluebird { - export interface ConcurrencyOption { + interface ConcurrencyOption { concurrency: number; } - export interface SpreadOption { + interface SpreadOption { spread: boolean; } - export interface FromNodeOptions { + interface FromNodeOptions { multiArgs?: boolean; } - export interface PromisifyOptions { + interface PromisifyOptions { context?: any; multiArgs?: boolean; } - export interface PromisifyAllOptions extends PromisifyOptions { + interface PromisifyAllOptions extends PromisifyOptions { suffix?: string; - filter?: (name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean) => boolean; + filter?(name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean): boolean; // The promisifier gets a reference to the original method and should return a function which returns a promise - promisifier?: (originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird) => () => PromiseLike; + promisifier?(originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird): () => PromiseLike; + } + interface CoroutineOptions { + yieldHandler(value: any): any; } /** @@ -1030,17 +1004,17 @@ declare namespace Bluebird { * * `OperationalError`s are caught in `.error` handlers. */ - export class OperationalError extends Error { } + class OperationalError extends Error { } /** * Signals that an operation has timed out. Used as a custom cancellation reason in `.timeout`. */ - export class TimeoutError extends Error { } + class TimeoutError extends Error { } /** * Signals that an operation has been aborted or cancelled. The default reason used by `.cancel`. */ - export class CancellationError extends Error {} + class CancellationError extends Error {} /** * A collection of errors. `AggregateError` is an array-like object, with numeric indices and a `.length` property. @@ -1050,7 +1024,7 @@ declare namespace Bluebird { * * `Promise.some` and `Promise.any` use `AggregateError` as rejection reason when they fail. */ - export class AggregateError extends Error implements ArrayLike { + class AggregateError extends Error implements ArrayLike { length: number; [index: number]: Error; join(separator?: string): string; @@ -1072,19 +1046,17 @@ declare namespace Bluebird { reverse(): AggregateError; } - /** * returned by `Bluebird.disposer()`. */ - export class Disposer { - } + class Disposer {} /** @deprecated Use PromiseLike directly. */ - export type Thenable = PromiseLike; + type Thenable = PromiseLike; - export type ResolvableProps = object & { [K in keyof T]: PromiseLike | T[K] }; + type ResolvableProps = object & { [K in keyof T]: PromiseLike | T[K] }; - export interface Resolver { + interface Resolver { /** * Returns a reference to the controlled promise that can be passed to clients. */ @@ -1107,10 +1079,10 @@ declare namespace Bluebird { * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. */ // TODO specify resolver callback - callback: (err: any, value: R, ...values: R[]) => void; + callback(err: any, value: R, ...values: R[]): void; } - export interface Inspection { + interface Inspection { /** * See if the underlying promise was fulfilled at the creation time of this inspection object. */ @@ -1151,14 +1123,14 @@ declare namespace Bluebird { * * This method should be used before you use any of the methods which would otherwise alter the global Bluebird object - to avoid polluting global state. */ - export function getNewLibraryCopy(): typeof Bluebird; + function getNewLibraryCopy(): typeof Bluebird; /** * This is relevant to browser environments with no module loader. * * Release control of the Promise namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. */ - export function noConflict(): typeof Bluebird; + function noConflict(): typeof Bluebird; /** * Changes how bluebird schedules calls a-synchronously. @@ -1166,7 +1138,7 @@ declare namespace Bluebird { * @param scheduler Should be a function that asynchronously schedules * the calling of the passed in function */ - export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; + function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; } export = Bluebird; diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index ec949f562b..94fc104c8f 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bluebird/tslint.json b/types/bluebird/tslint.json new file mode 100644 index 0000000000..44da6a5d92 --- /dev/null +++ b/types/bluebird/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "max-line-length": [true, 490], + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-generics": false, + "no-void-expression": false, + "prefer-const": false, + "void-return": false + } +} diff --git a/types/bluebird/v1/tsconfig.json b/types/bluebird/v1/tsconfig.json index 13442c777a..3e22a6a885 100644 --- a/types/bluebird/v1/tsconfig.json +++ b/types/bluebird/v1/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/bluebird/v2/tsconfig.json b/types/bluebird/v2/tsconfig.json index aeec8af920..773747fb4a 100644 --- a/types/bluebird/v2/tsconfig.json +++ b/types/bluebird/v2/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/blueimp-md5/tsconfig.json b/types/blueimp-md5/tsconfig.json index 8945974140..286b0abda2 100644 --- a/types/blueimp-md5/tsconfig.json +++ b/types/blueimp-md5/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/body-parser/tsconfig.json b/types/body-parser/tsconfig.json index e798cd97d3..9c0314a557 100644 --- a/types/body-parser/tsconfig.json +++ b/types/body-parser/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "body-parser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bonjour/tsconfig.json b/types/bonjour/tsconfig.json index 5f4f7d3088..8cc7d3f823 100644 --- a/types/bonjour/tsconfig.json +++ b/types/bonjour/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bookshelf/tsconfig.json b/types/bookshelf/tsconfig.json index 012a7c10b2..e983e9b53c 100644 --- a/types/bookshelf/tsconfig.json +++ b/types/bookshelf/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/boolify-string/tsconfig.json b/types/boolify-string/tsconfig.json index f7a57e27de..fcc1b15038 100644 --- a/types/boolify-string/tsconfig.json +++ b/types/boolify-string/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/boom/tsconfig.json b/types/boom/tsconfig.json index c3bee46396..81f6f5cacf 100644 --- a/types/boom/tsconfig.json +++ b/types/boom/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/boom/v3/tsconfig.json b/types/boom/v3/tsconfig.json index 689f5dec00..1f8b8e7f4a 100644 --- a/types/boom/v3/tsconfig.json +++ b/types/boom/v3/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/bootbox/index.d.ts b/types/bootbox/index.d.ts index ba5cc8c23b..850eb18c25 100644 --- a/types/bootbox/index.d.ts +++ b/types/bootbox/index.d.ts @@ -7,9 +7,9 @@ /// /** Bootbox options shared by all modal types */ -interface BootboxBaseOptions { +interface BootboxBaseOptions { title?: string | Element; - callback?: (result: boolean | string) => any; + callback?: (result: T) => any; onEscape?: (() => any) | boolean; show?: boolean; backdrop?: boolean; @@ -22,24 +22,24 @@ interface BootboxBaseOptions { } /** Bootbox options available for custom modals */ -interface BootboxDialogOptions extends BootboxBaseOptions { +interface BootboxDialogOptions extends BootboxBaseOptions { message: string | Element; } /** Bootbox options available for alert modals */ -interface BootboxAlertOptions extends BootboxDialogOptions { +interface BootboxAlertOptions extends BootboxDialogOptions { callback?: () => any; buttons?: BootboxAlertButtonMap; } /** Bootbox options available for confirm modals */ -interface BootboxConfirmOptions extends BootboxDialogOptions { +interface BootboxConfirmOptions extends BootboxDialogOptions { callback: (result: boolean) => any; buttons?: BootboxConfirmPromptButtonMap; } /** Bootbox options available for prompt modals */ -interface BootboxPromptOptions extends BootboxBaseOptions { +interface BootboxPromptOptions extends BootboxBaseOptions { title: string; value?: string; inputType?: "text" | "textarea" | "email" | "select" | "checkbox" | "date" | "time" | "number" | "password"; @@ -93,7 +93,7 @@ interface BootboxStatic { prompt(message: string, callback: (result: string) => void): JQuery; prompt(options: BootboxPromptOptions): JQuery; dialog(message: string, callback?: (result: string) => void): JQuery; - dialog(options: BootboxDialogOptions): JQuery; + dialog(options: BootboxDialogOptions): JQuery; setDefaults(options: BootboxDefaultOptions): void; hideAll(): void; diff --git a/types/bootbox/tsconfig.json b/types/bootbox/tsconfig.json index e9bedd04f7..75da35b2bc 100644 --- a/types/bootbox/tsconfig.json +++ b/types/bootbox/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootpag/tsconfig.json b/types/bootpag/tsconfig.json index fa1b79ad37..69b09cc3a6 100644 --- a/types/bootpag/tsconfig.json +++ b/types/bootpag/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-datepicker/tsconfig.json b/types/bootstrap-datepicker/tsconfig.json index bef8804bc6..6770944b42 100644 --- a/types/bootstrap-datepicker/tsconfig.json +++ b/types/bootstrap-datepicker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-fileinput/tsconfig.json b/types/bootstrap-fileinput/tsconfig.json index 9661cf12ad..fa1c069762 100644 --- a/types/bootstrap-fileinput/tsconfig.json +++ b/types/bootstrap-fileinput/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-maxlength/tsconfig.json b/types/bootstrap-maxlength/tsconfig.json index e67f6e33f1..403883963c 100644 --- a/types/bootstrap-maxlength/tsconfig.json +++ b/types/bootstrap-maxlength/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-notify/tsconfig.json b/types/bootstrap-notify/tsconfig.json index 70345035cb..f833291433 100644 --- a/types/bootstrap-notify/tsconfig.json +++ b/types/bootstrap-notify/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-select/tsconfig.json b/types/bootstrap-select/tsconfig.json index 28f30d6dc0..108bd0a43f 100644 --- a/types/bootstrap-select/tsconfig.json +++ b/types/bootstrap-select/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-slider/tsconfig.json b/types/bootstrap-slider/tsconfig.json index a793a1d164..7400a08d09 100644 --- a/types/bootstrap-slider/tsconfig.json +++ b/types/bootstrap-slider/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "bootstrap-slider-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bootstrap-switch/tsconfig.json b/types/bootstrap-switch/tsconfig.json index 6afea7feeb..794d73cac9 100644 --- a/types/bootstrap-switch/tsconfig.json +++ b/types/bootstrap-switch/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-table/tsconfig.json b/types/bootstrap-table/tsconfig.json index 7a82df8757..b38fb73330 100644 --- a/types/bootstrap-table/tsconfig.json +++ b/types/bootstrap-table/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-touchspin/tsconfig.json b/types/bootstrap-touchspin/tsconfig.json index de15b1ab32..1ce86dec76 100644 --- a/types/bootstrap-touchspin/tsconfig.json +++ b/types/bootstrap-touchspin/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap-treeview/tsconfig.json b/types/bootstrap-treeview/tsconfig.json index 0dce7ab41a..30898529bb 100644 --- a/types/bootstrap-treeview/tsconfig.json +++ b/types/bootstrap-treeview/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "bootstrap-treeview-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bootstrap-validator/tsconfig.json b/types/bootstrap-validator/tsconfig.json index c4415e6d19..4f61ae94f9 100644 --- a/types/bootstrap-validator/tsconfig.json +++ b/types/bootstrap-validator/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap.paginator/tsconfig.json b/types/bootstrap.paginator/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/bootstrap.paginator/tsconfig.json +++ b/types/bootstrap.paginator/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap.timepicker/tsconfig.json b/types/bootstrap.timepicker/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/bootstrap.timepicker/tsconfig.json +++ b/types/bootstrap.timepicker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap.v3.datetimepicker/tsconfig.json b/types/bootstrap.v3.datetimepicker/tsconfig.json index a405cd85dc..36febd5a8f 100644 --- a/types/bootstrap.v3.datetimepicker/tsconfig.json +++ b/types/bootstrap.v3.datetimepicker/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bootstrap.v3.datetimepicker/v3/tsconfig.json b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json index c81098be9e..3dcc23bdff 100644 --- a/types/bootstrap.v3.datetimepicker/v3/tsconfig.json +++ b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/bootstrap/tsconfig.json b/types/bootstrap/tsconfig.json index 0efb26f214..536901e8a6 100644 --- a/types/bootstrap/tsconfig.json +++ b/types/bootstrap/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/botvs/tsconfig.json b/types/botvs/tsconfig.json index a20db9c8e9..6ec444ef28 100644 --- a/types/botvs/tsconfig.json +++ b/types/botvs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "botvs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bounce.js/tsconfig.json b/types/bounce.js/tsconfig.json index aea0528321..a0f7048729 100644 --- a/types/bounce.js/tsconfig.json +++ b/types/bounce.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bowser/tsconfig.json b/types/bowser/tsconfig.json index d0f2ee1a88..533b285bb0 100644 --- a/types/bowser/tsconfig.json +++ b/types/bowser/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/box2d/tsconfig.json b/types/box2d/tsconfig.json index 77378f313f..9fae5e8326 100644 --- a/types/box2d/tsconfig.json +++ b/types/box2d/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/brace-expansion/tsconfig.json b/types/brace-expansion/tsconfig.json index ef79d3729f..a64fa9ea3b 100644 --- a/types/brace-expansion/tsconfig.json +++ b/types/brace-expansion/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "brace-expansion-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/braintree-web/tsconfig.json b/types/braintree-web/tsconfig.json index d326f77f12..3a39178d0e 100644 --- a/types/braintree-web/tsconfig.json +++ b/types/braintree-web/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +22,4 @@ "test/web.ts", "test/node.ts" ] -} +} \ No newline at end of file diff --git a/types/breeze/tsconfig.json b/types/breeze/tsconfig.json index b03254b93c..236bcba327 100644 --- a/types/breeze/tsconfig.json +++ b/types/breeze/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bricks.js/tsconfig.json b/types/bricks.js/tsconfig.json index 5a4746ea86..5f265430a3 100644 --- a/types/bricks.js/tsconfig.json +++ b/types/bricks.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "bricks.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/brorand/tsconfig.json b/types/brorand/tsconfig.json index 5fe5965087..52e7dbf24c 100644 --- a/types/brorand/tsconfig.json +++ b/types/brorand/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-bunyan/tsconfig.json b/types/browser-bunyan/tsconfig.json index c94eef83e2..ab3fb51bd2 100644 --- a/types/browser-bunyan/tsconfig.json +++ b/types/browser-bunyan/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-fingerprint/tsconfig.json b/types/browser-fingerprint/tsconfig.json index 412a577af0..7f34a8f380 100644 --- a/types/browser-fingerprint/tsconfig.json +++ b/types/browser-fingerprint/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-harness/tsconfig.json b/types/browser-harness/tsconfig.json index 262ff52cf5..1694e52c08 100644 --- a/types/browser-harness/tsconfig.json +++ b/types/browser-harness/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-pack/tsconfig.json b/types/browser-pack/tsconfig.json index 67da2f2560..1dc87a2e2d 100644 --- a/types/browser-pack/tsconfig.json +++ b/types/browser-pack/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-report/tsconfig.json b/types/browser-report/tsconfig.json index 997b307339..f0bb076ca9 100644 --- a/types/browser-report/tsconfig.json +++ b/types/browser-report/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-resolve/tsconfig.json b/types/browser-resolve/tsconfig.json index d1fd902a14..5f873c7ee5 100644 --- a/types/browser-resolve/tsconfig.json +++ b/types/browser-resolve/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index c20f27236a..85cd464a21 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -24,6 +24,46 @@ browserSync({ proxy: "yourlocal.dev" }); +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyReq: function(proxyReq) { + console.log(proxyReq); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyReq: [ + function(proxyReq) { + console.log(proxyReq); + } + ] + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: function(proxyRes, req, res) { + console.log(proxyRes); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: [ + function(proxyRes, req, res) { + console.log(proxyRes); + } + ] + } +}); + var config = { server: { baseDir: "./" diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index ade12d3cb6..b22054c367 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -48,6 +48,7 @@ declare namespace browserSync { * middleware - Default: undefined * reqHeaders - Default: undefined * proxyRes - Default: undefined + * proxyReq - Default: undefined */ proxy?: string | boolean | ProxyOptions; /** @@ -291,9 +292,10 @@ declare namespace browserSync { interface ProxyOptions { target?: string; middleware?: MiddlewareHandler; - ws: boolean; - reqHeaders: (config: any) => Hash; - proxyRes: (res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any; + ws?: boolean; + reqHeaders?: (config: any) => Hash; + proxyRes?: ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any)[] | ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any); + proxyReq?: ((res: http.ServerRequest) => any)[] | ((res: http.ServerRequest) => any); } interface MiddlewareHandler { diff --git a/types/browser-sync/tsconfig.json b/types/browser-sync/tsconfig.json index 83ef3f0e60..98204d433a 100644 --- a/types/browser-sync/tsconfig.json +++ b/types/browser-sync/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/browserify/tsconfig.json b/types/browserify/tsconfig.json index 531f734eb9..df71b7fb3b 100644 --- a/types/browserify/tsconfig.json +++ b/types/browserify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bs58/tsconfig.json b/types/bs58/tsconfig.json index 90c5bc2b88..9e0ed25701 100644 --- a/types/bs58/tsconfig.json +++ b/types/bs58/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bson/tsconfig.json b/types/bson/tsconfig.json index 78adc0219b..aa4936d595 100644 --- a/types/bson/tsconfig.json +++ b/types/bson/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bucks/tsconfig.json b/types/bucks/tsconfig.json index 641d6425e8..f06df83926 100644 --- a/types/bucks/tsconfig.json +++ b/types/bucks/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/buffer-compare/tsconfig.json b/types/buffer-compare/tsconfig.json index 46bf66605d..76638cae6e 100644 --- a/types/buffer-compare/tsconfig.json +++ b/types/buffer-compare/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/buffer-equal/tsconfig.json b/types/buffer-equal/tsconfig.json index fe456dae48..5576be8e43 100644 --- a/types/buffer-equal/tsconfig.json +++ b/types/buffer-equal/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/buffers/tsconfig.json b/types/buffers/tsconfig.json index 09a2f78457..148f3d1dbb 100644 --- a/types/buffers/tsconfig.json +++ b/types/buffers/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bufferstream/tsconfig.json b/types/bufferstream/tsconfig.json index b7a18fa043..000bd2d09c 100644 --- a/types/bufferstream/tsconfig.json +++ b/types/bufferstream/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bull/tsconfig.json b/types/bull/tsconfig.json index 0751a977c1..3ce6f08792 100644 --- a/types/bull/tsconfig.json +++ b/types/bull/tsconfig.json @@ -1,12 +1,17 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ "es6" ], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ "../" ], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/bull/v2/tsconfig.json b/types/bull/v2/tsconfig.json index 12445fc199..c0b2369568 100644 --- a/types/bull/v2/tsconfig.json +++ b/types/bull/v2/tsconfig.json @@ -1,16 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ "es6" ], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../../", - "typeRoots": [ "../../" ], + "typeRoots": [ + "../../" + ], "types": [], "paths": { - "bull": [ "bull/v2" ], - "bull/*": [ "bull/v2/*" ] + "bull": [ + "bull/v2" + ], + "bull/*": [ + "bull/v2/*" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/bunnymq/tsconfig.json b/types/bunnymq/tsconfig.json index fe2f7d19dd..d1a470e451 100644 --- a/types/bunnymq/tsconfig.json +++ b/types/bunnymq/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bunyan-blackhole/tsconfig.json b/types/bunyan-blackhole/tsconfig.json index cddd529d29..0266e86bae 100644 --- a/types/bunyan-blackhole/tsconfig.json +++ b/types/bunyan-blackhole/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bunyan-bugsnag/tsconfig.json b/types/bunyan-bugsnag/tsconfig.json index fc5f16775b..1910cbaf79 100644 --- a/types/bunyan-bugsnag/tsconfig.json +++ b/types/bunyan-bugsnag/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bunyan-bugsnag-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bunyan-config/tsconfig.json b/types/bunyan-config/tsconfig.json index 316e779857..7866deb22e 100644 --- a/types/bunyan-config/tsconfig.json +++ b/types/bunyan-config/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bunyan-logentries/tsconfig.json b/types/bunyan-logentries/tsconfig.json index fab7ab8adf..f367f2fff8 100644 --- a/types/bunyan-logentries/tsconfig.json +++ b/types/bunyan-logentries/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bunyan-prettystream/tsconfig.json b/types/bunyan-prettystream/tsconfig.json index 681f08207f..ac589169ba 100644 --- a/types/bunyan-prettystream/tsconfig.json +++ b/types/bunyan-prettystream/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bunyan-winston-adapter/tsconfig.json b/types/bunyan-winston-adapter/tsconfig.json index 7185731caf..7278f5ac72 100644 --- a/types/bunyan-winston-adapter/tsconfig.json +++ b/types/bunyan-winston-adapter/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "bunyan-winston-adapter-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bunyan/tsconfig.json b/types/bunyan/tsconfig.json index 9564bbdbc9..290ffc3a6d 100644 --- a/types/bunyan/tsconfig.json +++ b/types/bunyan/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/busboy/tsconfig.json b/types/busboy/tsconfig.json index 1879cda2a9..6e60377b23 100644 --- a/types/busboy/tsconfig.json +++ b/types/busboy/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/business-rules-engine/tsconfig.json b/types/business-rules-engine/tsconfig.json index a80b05099b..385150055b 100644 --- a/types/business-rules-engine/tsconfig.json +++ b/types/business-rules-engine/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "paths": { - "q": [ "q/v0" ] + "q": [ + "q/v0" + ] }, "types": [], "noEmit": true, diff --git a/types/bwip-js/tsconfig.json b/types/bwip-js/tsconfig.json index 9c80d3dd4a..c421a4a7b6 100644 --- a/types/bwip-js/tsconfig.json +++ b/types/bwip-js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/byline/tsconfig.json b/types/byline/tsconfig.json index 1b19defc70..f21fc8983d 100644 --- a/types/byline/tsconfig.json +++ b/types/byline/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bytebuffer/tsconfig.json b/types/bytebuffer/tsconfig.json index 4c483ce2a5..5fdc833e9b 100644 --- a/types/bytebuffer/tsconfig.json +++ b/types/bytebuffer/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/bytes/tsconfig.json b/types/bytes/tsconfig.json index 49c5cc8c74..4de1fdb57a 100644 --- a/types/bytes/tsconfig.json +++ b/types/bytes/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index e94921ceb7..fe3b00c503 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/cache-manager/tsconfig.json b/types/cache-manager/tsconfig.json index 522fd22794..f754de4a67 100644 --- a/types/cache-manager/tsconfig.json +++ b/types/cache-manager/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cachefactory/tsconfig.json b/types/cachefactory/tsconfig.json index f39484366b..2008da5619 100644 --- a/types/cachefactory/tsconfig.json +++ b/types/cachefactory/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cal-heatmap/tsconfig.json b/types/cal-heatmap/tsconfig.json index 7edf3d8067..ff8d65a2e2 100644 --- a/types/cal-heatmap/tsconfig.json +++ b/types/cal-heatmap/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/callsite/tsconfig.json b/types/callsite/tsconfig.json index cadb982eda..473c5c08fd 100644 --- a/types/callsite/tsconfig.json +++ b/types/callsite/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/callsites/tsconfig.json b/types/callsites/tsconfig.json index 68aca90ea3..010199b740 100644 --- a/types/callsites/tsconfig.json +++ b/types/callsites/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "callsites-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/calq/tsconfig.json b/types/calq/tsconfig.json index 3e0167d2a7..595f095f74 100644 --- a/types/calq/tsconfig.json +++ b/types/calq/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/camelcase-keys/tsconfig.json b/types/camelcase-keys/tsconfig.json index a0216c0338..f99870f8d9 100644 --- a/types/camelcase-keys/tsconfig.json +++ b/types/camelcase-keys/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/camelcase/tsconfig.json b/types/camelcase/tsconfig.json index a3fc596eb6..bcc1b505e1 100644 --- a/types/camelcase/tsconfig.json +++ b/types/camelcase/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "camelcase-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/camljs/tsconfig.json b/types/camljs/tsconfig.json index a606320418..5fbe5605e9 100644 --- a/types/camljs/tsconfig.json +++ b/types/camljs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/camo/tsconfig.json b/types/camo/tsconfig.json index 0e45c8b3f5..46a6a2814c 100644 --- a/types/camo/tsconfig.json +++ b/types/camo/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cannon/index.d.ts b/types/cannon/index.d.ts index 45e005d53d..8516d968dd 100644 --- a/types/cannon/index.d.ts +++ b/types/cannon/index.d.ts @@ -428,7 +428,7 @@ declare module CANNON { angularVelocity?: Vec3; quaternion?: Quaternion; mass?: number; - material?: number; + material?: Material; type?: number; linearDamping?: number; angularDamping?: number; @@ -478,7 +478,7 @@ declare module CANNON { interpolatedQuaternion: Quaternion; shapes: Shape[]; shapeOffsets: any[]; - shapeOrentiations: any[]; + shapeOrientations: any[]; inertia: Vec3; invInertia: Vec3; invInertiaWorld: Mat3; @@ -735,7 +735,7 @@ declare module CANNON { vertices: Vec3[]; worldVertices: Vec3[]; worldVerticesNeedsUpdate: boolean; - faces: number[]; + faces: number[][]; faceNormals: Vec3[]; uniqueEdges: Vec3[]; @@ -776,7 +776,7 @@ declare module CANNON { export class Heightfield extends Shape { - data: number[]; + data: number[][]; maxValue: number; minValue: number; elementSize: number; @@ -930,7 +930,7 @@ declare module CANNON { } export class World extends EventTarget { - + iterations: number; dt: number; allowSleep: boolean; contacts: ContactEquation[]; @@ -992,6 +992,10 @@ declare module CANNON { } + export interface ICollisionEvent extends IBodyEvent { + contact: any; + } + } diff --git a/types/cannon/tsconfig.json b/types/cannon/tsconfig.json index a59be4d465..ca5618a8a0 100644 --- a/types/cannon/tsconfig.json +++ b/types/cannon/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/canvas-gauges/tsconfig.json b/types/canvas-gauges/tsconfig.json index f33b09f813..07055c34bb 100644 --- a/types/canvas-gauges/tsconfig.json +++ b/types/canvas-gauges/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/canvasjs/tsconfig.json b/types/canvasjs/tsconfig.json index 459ca95138..57f76052a9 100644 --- a/types/canvasjs/tsconfig.json +++ b/types/canvasjs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "canvasjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/capitalize/tsconfig.json b/types/capitalize/tsconfig.json index d196ac1315..463b6ca645 100644 --- a/types/capitalize/tsconfig.json +++ b/types/capitalize/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/card-validator/tsconfig.json b/types/card-validator/tsconfig.json index a3e4d160e5..685e0c4bbe 100644 --- a/types/card-validator/tsconfig.json +++ b/types/card-validator/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "card-validator-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cash/tsconfig.json b/types/cash/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/cash/tsconfig.json +++ b/types/cash/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/casperjs/tsconfig.json b/types/casperjs/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/casperjs/tsconfig.json +++ b/types/casperjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cassandra-driver/tsconfig.json b/types/cassandra-driver/tsconfig.json index 9793b9a1b1..e47bfd4444 100644 --- a/types/cassandra-driver/tsconfig.json +++ b/types/cassandra-driver/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/catbox/tsconfig.json b/types/catbox/tsconfig.json index b04177a675..feb19f81dc 100644 --- a/types/catbox/tsconfig.json +++ b/types/catbox/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "catbox-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cbor/tsconfig.json b/types/cbor/tsconfig.json index d9643467aa..199ead141d 100644 --- a/types/cbor/tsconfig.json +++ b/types/cbor/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ccap/tsconfig.json b/types/ccap/tsconfig.json index d1c1d4d626..e4fa68a956 100644 --- a/types/ccap/tsconfig.json +++ b/types/ccap/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "ccap-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chai-arrays/tsconfig.json b/types/chai-arrays/tsconfig.json index a555dfb8e2..84b3de823b 100644 --- a/types/chai-arrays/tsconfig.json +++ b/types/chai-arrays/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "chai-arrays-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chai-as-promised/tsconfig.json b/types/chai-as-promised/tsconfig.json index 71874931b3..2d1a15b6eb 100644 --- a/types/chai-as-promised/tsconfig.json +++ b/types/chai-as-promised/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "chai-as-promised-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chai-datetime/tsconfig.json b/types/chai-datetime/tsconfig.json index 02fa4af994..93d28d082f 100644 --- a/types/chai-datetime/tsconfig.json +++ b/types/chai-datetime/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-dom/tsconfig.json b/types/chai-dom/tsconfig.json index 7580cc278e..8840510c78 100644 --- a/types/chai-dom/tsconfig.json +++ b/types/chai-dom/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-enzyme/tsconfig.json b/types/chai-enzyme/tsconfig.json index 772105a437..4b7cdcf075 100644 --- a/types/chai-enzyme/tsconfig.json +++ b/types/chai-enzyme/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-fuzzy/tsconfig.json b/types/chai-fuzzy/tsconfig.json index 0929562d02..c6254dc8d8 100644 --- a/types/chai-fuzzy/tsconfig.json +++ b/types/chai-fuzzy/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-http/tsconfig.json b/types/chai-http/tsconfig.json index a3b913d24f..3554b4ab09 100644 --- a/types/chai-http/tsconfig.json +++ b/types/chai-http/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-jest-snapshot/tsconfig.json b/types/chai-jest-snapshot/tsconfig.json index 32dea54632..ae15eb95a0 100644 --- a/types/chai-jest-snapshot/tsconfig.json +++ b/types/chai-jest-snapshot/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "chai-jest-snapshot-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chai-jquery/tsconfig.json b/types/chai-jquery/tsconfig.json index ca1d1b88ab..b26a07d06d 100644 --- a/types/chai-jquery/tsconfig.json +++ b/types/chai-jquery/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-json-schema/tsconfig.json b/types/chai-json-schema/tsconfig.json index 80f35a1598..9c8408ae05 100644 --- a/types/chai-json-schema/tsconfig.json +++ b/types/chai-json-schema/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-oequal/tsconfig.json b/types/chai-oequal/tsconfig.json index 40e4a0b1bc..0e63915d75 100644 --- a/types/chai-oequal/tsconfig.json +++ b/types/chai-oequal/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-spies/tsconfig.json b/types/chai-spies/tsconfig.json index 86f86541d9..a439cf07a4 100644 --- a/types/chai-spies/tsconfig.json +++ b/types/chai-spies/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-string/tsconfig.json b/types/chai-string/tsconfig.json index 9bca70cbb8..1227af23ab 100644 --- a/types/chai-string/tsconfig.json +++ b/types/chai-string/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-subset/tsconfig.json b/types/chai-subset/tsconfig.json index 21d5108f1c..c79fad5e82 100644 --- a/types/chai-subset/tsconfig.json +++ b/types/chai-subset/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-things/tsconfig.json b/types/chai-things/tsconfig.json index e426da66a1..84e31abe2f 100644 --- a/types/chai-things/tsconfig.json +++ b/types/chai-things/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai-xml/tsconfig.json b/types/chai-xml/tsconfig.json index f91b76a16c..95a0d68969 100644 --- a/types/chai-xml/tsconfig.json +++ b/types/chai-xml/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai/tsconfig.json b/types/chai/tsconfig.json index 1e16e4cbf9..4e0c687060 100644 --- a/types/chai/tsconfig.json +++ b/types/chai/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chai/v2/tsconfig.json b/types/chai/v2/tsconfig.json index bc5f6dc588..927a017f3d 100644 --- a/types/chai/v2/tsconfig.json +++ b/types/chai/v2/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/chalk/tsconfig.json b/types/chalk/tsconfig.json index 7cf506fcc1..13ab93883b 100644 --- a/types/chalk/tsconfig.json +++ b/types/chalk/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chance/tsconfig.json b/types/chance/tsconfig.json index 86e165072d..f05e6076cc 100644 --- a/types/chance/tsconfig.json +++ b/types/chance/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/change-emitter/tsconfig.json b/types/change-emitter/tsconfig.json index c009c08554..208441aafa 100644 --- a/types/change-emitter/tsconfig.json +++ b/types/change-emitter/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/charm/tsconfig.json b/types/charm/tsconfig.json index e8bb4426f8..40eba0a076 100644 --- a/types/charm/tsconfig.json +++ b/types/charm/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 63f5c01f9f..78f1aa6142 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -318,7 +318,7 @@ declare namespace Chart { lineWidth?: number; drawBorder?: boolean; drawOnChartArea?: boolean; - drawticks?: boolean; + drawTicks?: boolean; tickMarkLength?: number; zeroLineWidth?: number; zeroLineColor?: ChartColor; @@ -432,20 +432,6 @@ declare namespace Chart { type?: ScaleType | string; display?: boolean; position?: PositionType | string; - beforeUpdate?(scale?: any): void; - beforeSetDimension?(scale?: any): void; - beforeDataLimits?(scale?: any): void; - beforeBuildTicks?(scale?: any): void; - beforeTickToLabelConversion?(scale?: any): void; - beforeCalculateTickRotation?(scale?: any): void; - beforeFit?(scale?: any): void; - afterUpdate?(scale?: any): void; - afterSetDimension?(scale?: any): void; - afterDataLimits?(scale?: any): void; - afterBuildTicks?(scale?: any): void; - afterTickToLabelConversion?(scale?: any): void; - afterCalculateTickRotation?(scale?: any): void; - afterFit?(scale?: any): void; gridLines?: GridLineOptions; scaleLabel?: ScaleTitleOptions; ticks?: TickOptions; @@ -463,6 +449,20 @@ declare namespace Chart { gridLines?: GridLineOptions; barThickness?: number; scaleLabel?: ScaleTitleOptions; + beforeUpdate?(scale?: any): void; + beforeSetDimension?(scale?: any): void; + beforeDataLimits?(scale?: any): void; + beforeBuildTicks?(scale?: any): void; + beforeTickToLabelConversion?(scale?: any): void; + beforeCalculateTickRotation?(scale?: any): void; + beforeFit?(scale?: any): void; + afterUpdate?(scale?: any): void; + afterSetDimension?(scale?: any): void; + afterDataLimits?(scale?: any): void; + afterBuildTicks?(scale?: any): void; + afterTickToLabelConversion?(scale?: any): void; + afterCalculateTickRotation?(scale?: any): void; + afterFit?(scale?: any): void; } interface ChartXAxe extends CommonAxe { diff --git a/types/chart.js/tsconfig.json b/types/chart.js/tsconfig.json index aae63d6394..3b5b6bffed 100644 --- a/types/chart.js/tsconfig.json +++ b/types/chart.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index e1d4cba452..6bdb7ebfe3 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Chartist v0.9.6 +// Type definitions for Chartist v0.9.8 // Project: https://github.com/gionkunz/chartist-js -// Definitions by: Matt Gibbs , Simon Pfeifer +// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chartist { @@ -187,11 +187,17 @@ declare namespace Chartist { * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. */ donut?: boolean; + + /** + * If specified the donut segments will be drawn as shapes instead of strokes. + */ + donutSolid?: boolean; /** - * Specify the donut stroke width, currently done in javascript for convenience. + * Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future. + * This option can be set as number or string to specify a relative width (i.e. 100 or '30%'). */ - donutWidth?: number; + donutWidth?: number | string; /** * Specify if a label should be shown or not @@ -217,6 +223,16 @@ declare namespace Chartist { * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. */ labelDirection?: string; + + /** + * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + */ + reverseData?: boolean; + + /** + * If true empty values will be ignored to avoid drawing unncessary slices and labels + */ + ignoreEmptyValues?: boolean; } interface IChartPadding { @@ -351,129 +367,131 @@ declare namespace Chartist { area?: string; grid?: string; gridGroup?: string; + gridBackground?: string; vertical?: string; horizontal?: string; start?: string; end?: string; } - interface ICandleChartOptions extends IChartOptions { - - /** - * Options for X-Axis - */ - axisX?: ICandleChartAxis; - - /** - * Options for Y-Axis - */ - axisY?: ICandleChartAxis; - - /** - * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - */ - width?: number | string; - - /** - * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - */ - height?: number | string; - - /** - * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - */ - hight?: number | string; - - /** - * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - */ - low?: number | string; - - /** - * Width of candle body in pixel (IMO is 2 px best minimum value) - */ - candleWidth?: number | string; - - /** - * Width of candle wick in pixel (IMO is 1 px best minimum value) - */ - candleWickWidth?: number | string; - - /** - * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used. - */ - useStepLengthAsCandleWidth?: boolean | string; - - /** - * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used. - */ - useOneThirdAsCandleWickWidth?: boolean | string; - - /** - * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - */ - chartPadding?: IChartPadding | number; - - /** - * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. - */ - fullWidth?: boolean | string; - - /** - * Override the class names that get used to generate the SVG structure of the chart - */ - classNames?: ICandleChartClasses; - } - - interface ICandleChartAxis { - /** - * The offset of the chart drawing area to the border of the container - */ - offset?: number; - /** - * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - */ - position?: string; - /** - * Allows you to correct label positioning on this axis by positive or negative x and y offset. - */ - labelOffset?: { - x?: number; - y?: number; - }; - /** - * If labels should be shown or not - */ - showLabel?: boolean; - /** - * If the axis grid should be drawn or not - */ - showGrid?: boolean; - /** - * Interpolation function that allows you to intercept the value from the axis label - */ - labelInterpolationFnc?: Function; - /** - * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. - */ - type?: any; - } - - interface ICandleChartClasses { - chart?: string; - label?: string; - labelGroup?: string; - series?: string; - candlePositive?: string; - candleNegative?: string, - grid?: string, - gridGroup?: string, - gridBackground?: string, - vertical?: string, - horizontal?: string, - start?: string, - end?: string, - } + interface ICandleChartOptions extends IChartOptions { + + /** + * Options for X-Axis + */ + axisX?: ICandleChartAxis; + + /** + * Options for Y-Axis + */ + axisY?: ICandleChartAxis; + + /** + * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + */ + width?: number | string; + + /** + * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + */ + height?: number | string; + + /** + * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + */ + hight?: number | string; + + /** + * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + */ + low?: number | string; + + /** + * Width of candle body in pixel (IMO is 2 px best minimum value) + */ + candleWidth?: number | string; + + /** + * Width of candle wick in pixel (IMO is 1 px best minimum value) + */ + candleWickWidth?: number | string; + + /** + * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used. + */ + useStepLengthAsCandleWidth?: boolean | string; + + /** + * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used. + */ + useOneThirdAsCandleWickWidth?: boolean | string; + + /** + * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + */ + chartPadding?: IChartPadding | number; + + /** + * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawncorrectly you might need to add chart padding or offset the last label with a draw event handler. + */ + fullWidth?: boolean | string; + + /** + * Override the class names that get used to generate the SVG structure of the chart + */ + classNames?: ICandleChartClasses; + } + + interface ICandleChartAxis { + /** + * The offset of the chart drawing area to the border of the container + */ + offset?: number; + /** + * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + */ + position?: string; + /** + * Allows you to correct label positioning on this axis by positive or negative x and y offset. + */ + labelOffset?: { + x?: number; + y?: number; + }; + /** + * If labels should be shown or not + */ + showLabel?: boolean; + /** + * If the axis grid should be drawn or not + */ + showGrid?: boolean; + /** + * Interpolation function that allows you to intercept the value from the axis label + */ + labelInterpolationFnc?: Function; + /** + * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + */ + type?: any; + } + + interface ICandleChartClasses { + chart?: string; + label?: string; + labelGroup?: string; + series?: string; + candlePositive?: string; + candleNegative?: string, + grid?: string, + gridGroup?: string, + gridBackground?: string, + vertical?: string, + horizontal?: string, + start?: string, + end?: string, + } + interface ChartistSvgStatic { new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg; @@ -682,4 +700,4 @@ declare namespace Chartist { declare var Chartist: Chartist.ChartistStatic; export = Chartist; -export as namespace Chartist; +export as namespace Chartist; \ No newline at end of file diff --git a/types/chartist/tsconfig.json b/types/chartist/tsconfig.json index ee8ba7d34f..afe951be86 100644 --- a/types/chartist/tsconfig.json +++ b/types/chartist/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chartjs/index.d.ts b/types/chartjs/index.d.ts index a9075e02a2..4caaef4981 100644 --- a/types/chartjs/index.d.ts +++ b/types/chartjs/index.d.ts @@ -120,6 +120,10 @@ interface ChartScalesOptions { interface ScaleTicksOptions { min?: number; max?: number; + maxTicksLimit?: number; + suggestedMin?: number; + suggestedMax?: number; + stepSize?: number; } interface ChartTitle { diff --git a/types/chartjs/tsconfig.json b/types/chartjs/tsconfig.json index 6523e4bd77..17d7edaf2a 100644 --- a/types/chartjs/tsconfig.json +++ b/types/chartjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chayns/tsconfig.json b/types/chayns/tsconfig.json index 99d0599998..4ac301174a 100644 --- a/types/chayns/tsconfig.json +++ b/types/chayns/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "chayns-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/check-sum/tsconfig.json b/types/check-sum/tsconfig.json index 2143ca3bd6..5d2955a50f 100644 --- a/types/check-sum/tsconfig.json +++ b/types/check-sum/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "check-sum-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/checkstyle-formatter/tsconfig.json b/types/checkstyle-formatter/tsconfig.json index 3bc13b0278..abf333c6bf 100644 --- a/types/checkstyle-formatter/tsconfig.json +++ b/types/checkstyle-formatter/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/checksum/tsconfig.json b/types/checksum/tsconfig.json index 9fe2d44312..21e5de17ab 100644 --- a/types/checksum/tsconfig.json +++ b/types/checksum/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 4a15f029f0..1a9821a6bb 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -52,6 +52,7 @@ var $multiEl = $('selector', 'selector', 'selector'); */ // attr +$el.attr(); $el.attr('id'); $el.attr('id', 'favorite').html(); diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index f525a46ee6..2037e83c7a 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -13,6 +13,7 @@ interface Cheerio { // Attributes + attr(): {[attr: string]: string}; attr(name: string): string; attr(name: string, value: any): Cheerio; diff --git a/types/cheerio/tsconfig.json b/types/cheerio/tsconfig.json index d046b455e6..63c3aed57c 100644 --- a/types/cheerio/tsconfig.json +++ b/types/cheerio/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chmodr/tsconfig.json b/types/chmodr/tsconfig.json index 5aa0c9aac2..44e07784ac 100644 --- a/types/chmodr/tsconfig.json +++ b/types/chmodr/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "chmodr-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chocolatechipjs/tsconfig.json b/types/chocolatechipjs/tsconfig.json index a94278ac9e..d56dd67e2d 100644 --- a/types/chocolatechipjs/tsconfig.json +++ b/types/chocolatechipjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chokidar/tsconfig.json b/types/chokidar/tsconfig.json index 8782979f09..77a34a3964 100644 --- a/types/chokidar/tsconfig.json +++ b/types/chokidar/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chosen-js/tsconfig.json b/types/chosen-js/tsconfig.json index 1e2148076b..9f4ce049cb 100644 --- a/types/chosen-js/tsconfig.json +++ b/types/chosen-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chownr/tsconfig.json b/types/chownr/tsconfig.json index 587c9ef8f8..7b20bfde66 100644 --- a/types/chownr/tsconfig.json +++ b/types/chownr/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "chownr-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index 41f7a36785..f826c8f254 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -109,7 +109,7 @@ declare namespace chroma { * Blends two colors using RGB channel-wise blend functions. */ blend(color1: string | Color, color2: string | Color, - blendMode: 'multiply' | 'darken' | 'lighten' | 'screen' | 'overlay' | 'burn' | 'dogde'): Color; + blendMode: 'multiply' | 'darken' | 'lighten' | 'screen' | 'overlay' | 'burn' | 'dodge'): Color; /** * Returns a random color. diff --git a/types/chroma-js/tsconfig.json b/types/chroma-js/tsconfig.json index 66384ba080..af142ac45e 100644 --- a/types/chroma-js/tsconfig.json +++ b/types/chroma-js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/chroma-js/v0/tsconfig.json b/types/chroma-js/v0/tsconfig.json index 691743104e..93226eedaf 100644 --- a/types/chroma-js/v0/tsconfig.json +++ b/types/chroma-js/v0/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 5104ab7ca1..ca7b35bf0e 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1274,104 +1274,106 @@ declare namespace chrome.cookies { * Availability: Since Chrome 18. * Permissions: "debugger" */ -// TODO: Uncomment when Microsoft/TypeScript#8312 is merged in -// declare module chrome.debugger { -// /** Debuggee identifier. Either tabId or extensionId must be specified */ -// interface Debuggee { -// /** Optional. The id of the tab which you intend to debug. */ -// tabId?: number; -// /** -// * Optional. -// * Since Chrome 27. -// * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. -// */ -// extensionId?: string; -// /** -// * Optional. -// * Since Chrome 28. -// * The opaque id of the debug target. -// */ -// targetId?: string; -// } -// -// /** -// * Since Chrome 28. -// * Debug target information -// */ -// interface TargetInfo { -// /** Target type. */ -// type: string; -// /** Target id. */ -// id: string; -// /** -// * Optional. -// * Since Chrome 30. -// * The tab id, defined if type == 'page'. -// */ -// tabId?: number; -// /** -// * Optional. -// * Since Chrome 30. -// * The extension id, defined if type = 'background_page'. -// */ -// extensionId?: string; -// /** True if debugger is already attached. */ -// attached: boolean; -// /** Target page title. */ -// title: string; -// /** Target URL. */ -// url: string; -// /** Optional. Target favicon URL. */ -// faviconUrl?: string; -// } -// -// interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} -// -// interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} -// -// /** -// * Attaches debugger to the given target. -// * @param target Debugging target to which you want to attach. -// * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. -// * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function() {...}; -// */ -// export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; -// /** -// * Detaches debugger from the given target. -// * @param target Debugging target from which you want to detach. -// * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function() {...}; -// */ -// export function detach(target: Debuggee, callback?: () => void): void; -// /** -// * Sends given command to the debugging target. -// * @param target Debugging target to which you want to send the command. -// * @param method Method name. Should be one of the methods defined by the remote debugging protocol. -// * @param commandParams Since Chrome 22. -// * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. -// * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function(object result) {...}; -// */ -// export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; -// /** -// * Since Chrome 28. -// * Returns the list of available debug targets. -// * @param callback The callback parameter should be a function that looks like this: -// * function(array of TargetInfo result) {...}; -// * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. -// */ -// export function getTargets(callback: (result: TargetInfo[]) => void): void; -// -// /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ -// var onDetach: DebuggerDetachedEvent; -// /** Fired whenever debugging target issues instrumentation event. */ -// var onEvent: DebuggerEventEvent; -// } +declare module chrome { + namespace _debugger { + /** Debuggee identifier. Either tabId or extensionId must be specified */ + interface Debuggee { + /** Optional. The id of the tab which you intend to debug. */ + tabId?: number; + /** + * Optional. + * Since Chrome 27. + * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. + */ + extensionId?: string; + /** + * Optional. + * Since Chrome 28. + * The opaque id of the debug target. + */ + targetId?: string; + } + /** + * Since Chrome 28. + * Debug target information + */ + interface TargetInfo { + /** Target type. */ + type: string; + /** Target id. */ + id: string; + /** + * Optional. + * Since Chrome 30. + * The tab id, defined if type == 'page'. + */ + tabId?: number; + /** + * Optional. + * Since Chrome 30. + * The extension id, defined if type = 'background_page'. + */ + extensionId?: string; + /** True if debugger is already attached. */ + attached: boolean; + /** Target page title. */ + title: string; + /** Target URL. */ + url: string; + /** Optional. Target favicon URL. */ + faviconUrl?: string; + } + + interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} + + interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} + + /** + * Attaches debugger to the given target. + * @param target Debugging target to which you want to attach. + * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. + * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; + /** + * Detaches debugger from the given target. + * @param target Debugging target from which you want to detach. + * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function detach(target: Debuggee, callback?: () => void): void; + /** + * Sends given command to the debugging target. + * @param target Debugging target to which you want to send the command. + * @param method Method name. Should be one of the methods defined by the remote debugging protocol. + * @param commandParams Since Chrome 22. + * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. + * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result) {...}; + */ + export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; + /** + * Since Chrome 28. + * Returns the list of available debug targets. + * @param callback The callback parameter should be a function that looks like this: + * function(array of TargetInfo result) {...}; + * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. + */ + export function getTargets(callback: (result: TargetInfo[]) => void): void; + + /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ + var onDetach: DebuggerDetachedEvent; + /** Fired whenever debugging target issues instrumentation event. */ + var onEvent: DebuggerEventEvent; + } + + export {_debugger as debugger} +} //////////////////// // Declarative Content //////////////////// @@ -3311,13 +3313,13 @@ declare namespace chrome.history { declare namespace chrome.i18n { /** Holds detected ISO language code and its percentage in the input string */ interface DetectedLanguage { - /** An ISO language code such as 'en' or 'fr'. - * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. + /** An ISO language code such as 'en' or 'fr'. + * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ language: string; /** The percentage of the detected language */ - percentage: number; + percentage: number; } /** Holds detected language reliability and array of DetectedLanguage */ @@ -3328,7 +3330,7 @@ declare namespace chrome.i18n { /** Array of detectedLanguage */ languages: DetectedLanguage[]; } - + /** * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. * @param callback The callback parameter should be a function that looks like this: @@ -3347,7 +3349,7 @@ declare namespace chrome.i18n { * @since Chrome 35. */ export function getUILanguage(): string; - + /** Detects the language of the provided text using CLD. * @param text User input string to be translated. * @param callback The callback parameter should be a function that looks like this: function(object result) {...}; @@ -6598,7 +6600,7 @@ declare namespace chrome.tabs { * @since Chrome 38. */ var onZoomChange: TabZoomChangeEvent; - + /** * An ID which represents the absence of a browser tab. * @since Chrome 46. @@ -7226,7 +7228,7 @@ declare namespace chrome.webRequest { types?: string[]; /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */ urls: string[]; - + /** Optional. */ windowId?: number; } diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index b7b7868ba3..7b37e548b5 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -188,18 +188,18 @@ function beforeRedditNavigation() { // for chrome.tabs.InjectDetails.frameId function executeScriptFramed () { - + const tabId = 123; const frameId = 0; - + const code = "alert('hi');"; - + chrome.tabs.executeScript({frameId, code}); chrome.tabs.insertCSS({frameId, code}); - + chrome.tabs.executeScript(tabId, {frameId, code}); chrome.tabs.insertCSS(tabId, {frameId, code}); - + } // for chrome.tabs.TAB_ID_NONE @@ -298,6 +298,42 @@ function testOptionsPage() { }); } +// https://developer.chrome.com/extensions/debugger +function testDebugger() { + chrome.debugger.attach({tabId: 123}, '1.23', () => { + console.log('This is a callback!'); + }); + + chrome.debugger.detach({tabId: 123}, () => { + console.log('This is a callback!'); + }); + + chrome.debugger.sendCommand( + {targetId: 'abc'}, 'Debugger.Cmd', {param1: 'x'}, (result) => { + console.log('Do something with the result.' + result); + }); + + chrome.debugger.getTargets((results) => { + for (let result of results) { + if (result.tabId == 123) { + // Do Something. + } + } + }); + + chrome.debugger.onEvent.addListener((source, methodName, params) => { + if (source.tabId == 123) { + console.log('Hello World.'); + } + }); + + chrome.debugger.onDetach.addListener((source, reason) => { + if (source.tabId == 123) { + console.log('Hello World.'); + } + }); +} + // https://developer.chrome.com/extensions/storage#type-StorageArea function testStorage() { function getCallback(loadedData: { [key: string]: any; }) { diff --git a/types/chrome/tsconfig.json b/types/chrome/tsconfig.json index 96c0c31496..de1fde90ca 100644 --- a/types/chrome/tsconfig.json +++ b/types/chrome/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -23,4 +24,4 @@ "test/index.ts", "test/chrome-app.ts" ] -} +} \ No newline at end of file diff --git a/types/chui/tsconfig.json b/types/chui/tsconfig.json index 08c1f7740e..5463478868 100644 --- a/types/chui/tsconfig.json +++ b/types/chui/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -25,4 +26,4 @@ "index.d.ts", "chui-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chunked-dc/tsconfig.json b/types/chunked-dc/tsconfig.json index 55832d5160..28dc51c3c3 100644 --- a/types/chunked-dc/tsconfig.json +++ b/types/chunked-dc/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/circular-json/tsconfig.json b/types/circular-json/tsconfig.json index cdb4636702..65bd131757 100644 --- a/types/circular-json/tsconfig.json +++ b/types/circular-json/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ckeditor/tsconfig.json b/types/ckeditor/tsconfig.json index 49fc367e30..e845e96c0a 100644 --- a/types/ckeditor/tsconfig.json +++ b/types/ckeditor/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/clamp-js/tsconfig.json b/types/clamp-js/tsconfig.json index f70837d86f..d858957f4b 100644 --- a/types/clamp-js/tsconfig.json +++ b/types/clamp-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "clamp-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/classnames/tsconfig.json b/types/classnames/tsconfig.json index bb39a9d874..f9b03432fc 100644 --- a/types/classnames/tsconfig.json +++ b/types/classnames/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "bind.d.ts", "classnames-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cldrjs/tsconfig.json b/types/cldrjs/tsconfig.json index e3260d69a7..b17ea4c0a9 100644 --- a/types/cldrjs/tsconfig.json +++ b/types/cldrjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/clean-css/tsconfig.json b/types/clean-css/tsconfig.json index bf5cc0f80c..fe65b21c11 100644 --- a/types/clean-css/tsconfig.json +++ b/types/clean-css/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/clean-stack/tsconfig.json b/types/clean-stack/tsconfig.json index 79e1474200..e1fa33ac6c 100644 --- a/types/clean-stack/tsconfig.json +++ b/types/clean-stack/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "clean-stack-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clear-require/tsconfig.json b/types/clear-require/tsconfig.json index 9c28741f0b..538fbe385e 100644 --- a/types/clear-require/tsconfig.json +++ b/types/clear-require/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "clear-require-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx new file mode 100644 index 0000000000..3bbc6570a3 --- /dev/null +++ b/types/cleave.js/cleave.js-tests.tsx @@ -0,0 +1,17 @@ +import * as React from "react"; +import Cleave = require("cleave.js"); +import CleaveReact = require("cleave.js/react"); + +const Example1 = () => { + Cleave("#my-input", { phone: true }); +}; + +const ExampleReact1 = (props: any) => { + return ( + + ); +}; diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts new file mode 100644 index 0000000000..1ec788cd8f --- /dev/null +++ b/types/cleave.js/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for cleave.js 1.0 +// Project: https://github.com/nosir/cleave.js +// Definitions by: C Lentfort +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CleaveOptions } from './options'; + +declare function Cleave(selector: string, options: CleaveOptions): void; +export = Cleave; diff --git a/types/cleave.js/options.d.ts b/types/cleave.js/options.d.ts new file mode 100644 index 0000000000..4320881649 --- /dev/null +++ b/types/cleave.js/options.d.ts @@ -0,0 +1,60 @@ +// Credit Card Options +export type CreditCardType = + | "amex" + | "dankort" + | "diners" + | "discover" + | "instapayment" + | "jcb" + | "maestro" + | "mastercard" + | "uatp" + | "unknown" + | "visa"; +export type CreditCardTypeChangeHandler = (owner: HTMLInputElement, type: CreditCardType) => void; + +export interface CleaveOptions { + creditCard?: boolean; + creditCardStrictMode?: boolean; + creditCardType?: string; + onCreditCardTypeChanged?: CreditCardTypeChangeHandler; +} + +// Phone Options +export interface CleaveOptions { + phone?: boolean; + phoneRegionCode?: string; +} + +// Date Options +export interface CleaveOptions { + date?: boolean; + datePattern?: ReadonlyArray; +} + +// Numeral Options +export type NumeralThousandsGroupStyleType = "lakh" | "thousand" | "wan"; + +export interface CleaveOptions { + numeral?: boolean; + numeralDecimalMark?: string; + numeralDecimalScale?: number; + numeralIntegerScale?: number; + numeralPositiveOnly?: boolean; + numeralThousandsGroupStyle?: NumeralThousandsGroupStyleType; + stripLeadingZeroes?: boolean; +} + +// Extra Options +export interface CleaveOptions { + blocks?: ReadonlyArray; + copyDelimiter?: boolean; + delimiter?: string; + delimiters?: ReadonlyArray; + initValue?: any; + lowercase?: boolean; + numericOnly?: boolean; + prefix?: string; + rawValueTrimPrefix?: boolean; + uppercase?: boolean; +} diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts new file mode 100644 index 0000000000..6d40ea4ed5 --- /dev/null +++ b/types/cleave.js/react/index.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { CleaveOptions } from "../options"; + +type InitHandler = (owner: React.ReactInstance) => void; + +interface Props extends React.InputHTMLAttributes { + onInit?: InitHandler; + options: CleaveOptions; +} + +declare var Cleave: React.ComponentClass; +export = Cleave; diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json new file mode 100644 index 0000000000..40e69541bc --- /dev/null +++ b/types/cleave.js/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "cleave.js-tests.tsx", + "index.d.ts", + "options.d.ts", + "react/index.d.ts" + ] +} diff --git a/types/cleave.js/tslint.json b/types/cleave.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cleave.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-color/tsconfig.json b/types/cli-color/tsconfig.json index b0fe194172..4e8bceb94b 100644 --- a/types/cli-color/tsconfig.json +++ b/types/cli-color/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cli-table2/tsconfig.json b/types/cli-table2/tsconfig.json index e816ba5105..4d5bea5b9d 100644 --- a/types/cli-table2/tsconfig.json +++ b/types/cli-table2/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cli/tsconfig.json b/types/cli/tsconfig.json index 8ba822df5e..2a1b78ae92 100644 --- a/types/cli/tsconfig.json +++ b/types/cli/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/client-sessions/tsconfig.json b/types/client-sessions/tsconfig.json index 151ca87623..c1556587bc 100644 --- a/types/client-sessions/tsconfig.json +++ b/types/client-sessions/tsconfig.json @@ -1,10 +1,13 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,4 +20,4 @@ "index.d.ts", "client-sessions-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cliff/tsconfig.json b/types/cliff/tsconfig.json index d338d0b253..8c59f5c533 100644 --- a/types/cliff/tsconfig.json +++ b/types/cliff/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/clipboard-js/tsconfig.json b/types/clipboard-js/tsconfig.json index bb95836c8a..8927797525 100644 --- a/types/clipboard-js/tsconfig.json +++ b/types/clipboard-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/clipboard/tsconfig.json b/types/clipboard/tsconfig.json index f1033c0218..5d960d2fd4 100644 --- a/types/clipboard/tsconfig.json +++ b/types/clipboard/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/clipboardy/tsconfig.json b/types/clipboardy/tsconfig.json index 455154a1d2..6d6bfcc76a 100644 --- a/types/clipboardy/tsconfig.json +++ b/types/clipboardy/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "clipboardy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clndr/tsconfig.json b/types/clndr/tsconfig.json index 47e9476079..df25d1b075 100644 --- a/types/clndr/tsconfig.json +++ b/types/clndr/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "clndr-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clockpicker/clockpicker-tests.ts b/types/clockpicker/clockpicker-tests.ts new file mode 100644 index 0000000000..473c268aac --- /dev/null +++ b/types/clockpicker/clockpicker-tests.ts @@ -0,0 +1,32 @@ +// ClockPicker tests from https://github.com/weareoutman/clockpicker + +// Initialize ClockPicker +$('.clockpicker').clockpicker(); + +// Initialize ClockPicker with options +$('.clockpicker').clockpicker({ + default: 'now', + placement: 'bottom', + align: 'left', + donetext: 'Done', + autoclose: false, + twelvehour: true, + vibrate: true, + fromnow: 0, + init: () => {}, + beforeShow: () => {}, + afterShow: () => {}, + beforeHide: () => {}, + afterHide: () => {}, + beforeHourSelect: () => {}, + afterHourSelect: () => {}, + beforeDone: () => {}, + afterDone: () => {}, +}); + +// Invoke ClockPicker operation methods +$('.clockpicker').clockpicker('show'); +$('.clockpicker').clockpicker('hide'); +$('.clockpicker').clockpicker('remove'); +$('.clockpicker').clockpicker('toggleView', 'hours'); +$('.clockpicker').clockpicker('toggleView', 'minutes'); diff --git a/types/clockpicker/index.d.ts b/types/clockpicker/index.d.ts new file mode 100644 index 0000000000..d9dbd444e8 --- /dev/null +++ b/types/clockpicker/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for ClockPicker 0.0 +// Project: https://github.com/weareoutman/clockpicker +// Definitions by: jfcere +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface ClockPickerOptions { + default?: string; + placement?: string; + align?: string; + donetext?: string; + autoclose?: boolean; + twelvehour?: boolean; + vibrate?: boolean; + fromnow?: number; + init?: () => void; + beforeShow?: () => void; + afterShow?: () => void; + beforeHide?: () => void; + afterHide?: () => void; + beforeHourSelect?: () => void; + afterHourSelect?: () => void; + beforeDone?: () => void; + afterDone?: () => void; +} + +interface ClockPicker { + (options?: ClockPickerOptions): JQuery; + (methodName: string, ...params: any[]): JQuery; +} + +interface JQuery { + clockpicker: ClockPicker; +} diff --git a/types/log4js/tsconfig.json b/types/clockpicker/tsconfig.json similarity index 79% rename from types/log4js/tsconfig.json rename to types/clockpicker/tsconfig.json index a71e03c82a..64b80a0278 100644 --- a/types/log4js/tsconfig.json +++ b/types/clockpicker/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,6 +19,6 @@ }, "files": [ "index.d.ts", - "log4js-tests.ts" + "clockpicker-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/popper.js/tslint.json b/types/clockpicker/tslint.json similarity index 58% rename from types/popper.js/tslint.json rename to types/clockpicker/tslint.json index fd7e538a58..11584e5acd 100644 --- a/types/popper.js/tslint.json +++ b/types/clockpicker/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO - "ban-types": false + "prefer-method-signature": false } } diff --git a/types/clone/tsconfig.json b/types/clone/tsconfig.json index 3594995add..65bd178331 100644 --- a/types/clone/tsconfig.json +++ b/types/clone/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/closure-compiler/tsconfig.json b/types/closure-compiler/tsconfig.json index c5b91de6be..4a15360b18 100644 --- a/types/closure-compiler/tsconfig.json +++ b/types/closure-compiler/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cloud-env/tsconfig.json b/types/cloud-env/tsconfig.json index e6a1323629..0972bef4e5 100644 --- a/types/cloud-env/tsconfig.json +++ b/types/cloud-env/tsconfig.json @@ -1,19 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cloud-env-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cloud-env-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cloudflare-apps/tsconfig.json b/types/cloudflare-apps/tsconfig.json index 9f3ed2ece7..b521ed0aca 100644 --- a/types/cloudflare-apps/tsconfig.json +++ b/types/cloudflare-apps/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +22,4 @@ "forceConsistentCasingInFileNames": true, "jsx": "preserve" } -} +} \ No newline at end of file diff --git a/types/cls-hooked/cls-hooked-tests.ts b/types/cls-hooked/cls-hooked-tests.ts new file mode 100644 index 0000000000..affaa6c54a --- /dev/null +++ b/types/cls-hooked/cls-hooked-tests.ts @@ -0,0 +1,23 @@ +import * as http from 'http'; +import * as cls from 'cls-hooked'; + +const session = cls.createNamespace('my session'); +const user = { id: 'foo' }; +session.set('user', user); +session.run((value: number) => { + session.set('value', value); +}); +http.createServer((req, res) => { + session.bindEmitter(req); + session.bindEmitter(res); +}); +function bindLater(callback: (x: number) => number) { + return session.bind(callback, session.createContext()); +} + +bindLater((x: number) => { + return x; +})(123); // passing argument 'abc' should get compile error + +const session2 = cls.getNamespace('my session'); +session2.get('user'); diff --git a/types/cls-hooked/index.d.ts b/types/cls-hooked/index.d.ts new file mode 100644 index 0000000000..6d0a68aa6e --- /dev/null +++ b/types/cls-hooked/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for cls-hooked 4.2 +// Project: https://github.com/jeff-lewis/cls-hooked +// Definitions by: Leo Liang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; + +export interface Namespace { + active: any; + + set(key: string, value: T): T; + get(key: string): any; + run(fn: (...args: any[]) => void): void; + runAndReturn(fn: (...args: any[]) => T): T; + bind(fn: F, context?: any): F; // tslint:disable-line: ban-types + bindEmitter(emitter: EventEmitter): void; + createContext(): any; +} + +export function createNamespace(name: string): Namespace; +export function getNamespace(name: string): Namespace; +export function destroyNamespace(name: string): void; +export function reset(): void; diff --git a/types/cls-hooked/tsconfig.json b/types/cls-hooked/tsconfig.json new file mode 100644 index 0000000000..2e4da612f6 --- /dev/null +++ b/types/cls-hooked/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cls-hooked-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cls-hooked/tslint.json b/types/cls-hooked/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cls-hooked/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/co-body/index.d.ts b/types/co-body/index.d.ts index 0393db0a94..a2c15152e6 100644 --- a/types/co-body/index.d.ts +++ b/types/co-body/index.d.ts @@ -26,6 +26,7 @@ declare namespace CoBody { strict?: boolean; queryString?: qs.IParseOptions; jsonTypes?: string[]; + returnRawBody?: boolean; formTypes?: string[]; textTypes?: string[]; encoding?: string; diff --git a/types/co-body/tsconfig.json b/types/co-body/tsconfig.json index 32601a074a..295cfcd7cd 100644 --- a/types/co-body/tsconfig.json +++ b/types/co-body/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/co-views/tsconfig.json b/types/co-views/tsconfig.json index 5a319edbcf..8b129766a5 100644 --- a/types/co-views/tsconfig.json +++ b/types/co-views/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/code/tsconfig.json b/types/code/tsconfig.json index 78682fb6c2..ae86da199a 100644 --- a/types/code/tsconfig.json +++ b/types/code/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 88989b2ef2..4bf1844114 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -104,7 +104,9 @@ declare namespace CodeMirror { function signal(target: any, name: string, ...args: any[]): void; type DOMEvent = 'mousedown' | 'dblclick' | 'touchstart' | 'contextmenu' | 'keydown' | 'keypress' | 'keyup' | 'cut' | 'copy' | 'paste' | 'dragstart' | 'dragenter' | 'dragover' | 'dragleave' | 'drop'; - + + type CoordsMode = 'window' | 'page' | 'local'; + interface Token { /** The character(on the given line) at which the token starts. */ start: number; @@ -196,12 +198,15 @@ declare namespace CodeMirror { class can be left off to remove all classes for the specified node, or be a string to remove only a specific class. */ removeLineClass(line: any, where: string, class_?: string): CodeMirror.LineHandle; - /** - * Compute the line at the given pixel height. - * - * `mode` is the relative element to use to compute this line - defaults to 'page' if not specified - */ - lineAtHeight(height: number, mode?: 'window' | 'page' | 'local'): number + /** Compute the line at the given pixel height. mode is the relative element + to use to compute this line, it may be "window", "page" (the default), or "local" */ + lineAtHeight(height: number, mode?: CoordsMode): number; + + /** Computes the height of the top of a line, in the coordinate system specified by mode, it may be "window", + "page" (the default), or "local". When a line below the bottom of the document is specified, the returned value + is the bottom of the last line in the document. By default, the position of the actual text is returned. + If includeWidgets is true and the line has line widgets, the position above the first line widget is returned. */ + heightAtLine(line: any, mode?: CoordsMode, includeWidgets?: boolean): number; /** Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. */ lineInfo(line: any): { @@ -267,25 +272,28 @@ declare namespace CodeMirror { scrollIntoView(pos: { from: CodeMirror.Position, to: CodeMirror.Position }, margin: number): void; /** Returns an { left , top , bottom } object containing the coordinates of the cursor position. - If mode is "local" , they will be relative to the top-left corner of the editable document. + If mode is "local", they will be relative to the top-left corner of the editable document. If it is "page" or not given, they are relative to the top-left corner of the page. where is a boolean indicating whether you want the start(true) or the end(false) of the selection. */ - cursorCoords(where: boolean, mode: string): { left: number; top: number; bottom: number; }; + cursorCoords(where: boolean, mode?: CoordsMode): { left: number; top: number; bottom: number; }; /** Returns an { left , top , bottom } object containing the coordinates of the cursor position. - If mode is "local" , they will be relative to the top-left corner of the editable document. + If mode is "local", they will be relative to the top-left corner of the editable document. If it is "page" or not given, they are relative to the top-left corner of the page. where specifies the precise position at which you want to measure. */ - cursorCoords(where: CodeMirror.Position, mode: string): { left: number; top: number; bottom: number; }; + cursorCoords(where: CodeMirror.Position, mode?: CoordsMode): { left: number; top: number; bottom: number; }; - /** Returns the position and dimensions of an arbitrary character.pos should be a { line , ch } object. + /** Returns the position and dimensions of an arbitrary character. pos should be a { line , ch } object. + If mode is "local", they will be relative to the top-left corner of the editable document. + If it is "page" or not given, they are relative to the top-left corner of the page. This differs from cursorCoords in that it'll give the size of the whole character, rather than just the position that the cursor would have when it would sit at that position. */ - charCoords(pos: CodeMirror.Position, mode: string): { left: number; right: number; top: number; bottom: number; }; + charCoords(pos: CodeMirror.Position, mode?: CoordsMode): { left: number; right: number; top: number; bottom: number; }; /** Given an { left , top } object , returns the { line , ch } position that corresponds to it. - The optional mode parameter determines relative to what the coordinates are interpreted. It may be "window" , "page"(the default) , or "local". */ - coordsChar(object: { left: number; top: number; }, mode?: string): CodeMirror.Position; + The optional mode parameter determines relative to what the coordinates are interpreted. + It may be "window", "page" (the default), or "local". */ + coordsChar(object: { left: number; top: number; }, mode?: CoordsMode): CodeMirror.Position; /** Returns the line height of the default font for the editor. */ defaultTextHeight(): number; @@ -304,7 +312,7 @@ declare namespace CodeMirror { refresh(): void; /** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */ - getTokenAt(pos: CodeMirror.Position): Token; + getTokenAt(pos: CodeMirror.Position, precise?: boolean): Token; /** This is similar to getTokenAt, but collects all tokens for a given line into an array. */ getLineTokens(line: number, precise?: boolean): Token[]; @@ -1239,14 +1247,14 @@ declare namespace CodeMirror { * Left side of the merge view. */ left: DiffView; - leftChunks(): MergeViewDiffChunk; + leftChunks(): MergeViewDiffChunk[]; leftOriginal(): Editor; /** * Right side of the merge view. */ right: DiffView; - rightChunks(): MergeViewDiffChunk; + rightChunks(): MergeViewDiffChunk[]; rightOriginal(): Editor; /** diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index af9dc54023..2ff349d98e 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/codependency/tsconfig.json b/types/codependency/tsconfig.json index 2966809543..990aecea5d 100644 --- a/types/codependency/tsconfig.json +++ b/types/codependency/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/coffeeify/tsconfig.json b/types/coffeeify/tsconfig.json index 35cd981884..0ed14ee2f2 100644 --- a/types/coffeeify/tsconfig.json +++ b/types/coffeeify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/coinstring/tsconfig.json b/types/coinstring/tsconfig.json index 02daf5871a..43ca980dbb 100644 --- a/types/coinstring/tsconfig.json +++ b/types/coinstring/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/collections/tsconfig.json b/types/collections/tsconfig.json index e547d4914d..466c5b12c4 100644 --- a/types/collections/tsconfig.json +++ b/types/collections/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "collections-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "collections-tests.ts" + ] } \ No newline at end of file diff --git a/types/color-convert/tsconfig.json b/types/color-convert/tsconfig.json index 70b4bd0fd9..52c14017a1 100644 --- a/types/color-convert/tsconfig.json +++ b/types/color-convert/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +22,4 @@ "route.d.ts", "color-convert-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/color-name/tsconfig.json b/types/color-name/tsconfig.json index 30cfb50814..56777b5a12 100644 --- a/types/color-name/tsconfig.json +++ b/types/color-name/tsconfig.json @@ -10,11 +10,14 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "types": [], - "typeRoots": ["../"] + "typeRoots": [ + "../" + ] }, "files": [ "index.d.ts", "color-name-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/color-string/tsconfig.json b/types/color-string/tsconfig.json index bf5a829c6e..27f7f9f5f1 100644 --- a/types/color-string/tsconfig.json +++ b/types/color-string/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "color-string-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/color/tsconfig.json b/types/color/tsconfig.json index 77175286b3..0924b02ae0 100644 --- a/types/color/tsconfig.json +++ b/types/color/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "color-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/color/v0/tsconfig.json b/types/color/v0/tsconfig.json index 6039458199..73f49d6375 100644 --- a/types/color/v0/tsconfig.json +++ b/types/color/v0/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/color/v1/tsconfig.json b/types/color/v1/tsconfig.json index 66541f0172..8d8204cf87 100644 --- a/types/color/v1/tsconfig.json +++ b/types/color/v1/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" @@ -24,4 +25,4 @@ "index.d.ts", "color-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/colorbrewer/tsconfig.json b/types/colorbrewer/tsconfig.json index 7adac10930..561a5d114e 100644 --- a/types/colorbrewer/tsconfig.json +++ b/types/colorbrewer/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/colors/tsconfig.json b/types/colors/tsconfig.json index 2455a21c79..d935a49e18 100644 --- a/types/colors/tsconfig.json +++ b/types/colors/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/com.darktalker.cordova.screenshot/tsconfig.json b/types/com.darktalker.cordova.screenshot/tsconfig.json index b9e395e7c0..d2b5aabb00 100644 --- a/types/com.darktalker.cordova.screenshot/tsconfig.json +++ b/types/com.darktalker.cordova.screenshot/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/combine-source-map/tsconfig.json b/types/combine-source-map/tsconfig.json index 8ee6b85743..dfb725b738 100644 --- a/types/combine-source-map/tsconfig.json +++ b/types/combine-source-map/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/combined-stream/tsconfig.json b/types/combined-stream/tsconfig.json index e1986a21be..bc69eb2505 100644 --- a/types/combined-stream/tsconfig.json +++ b/types/combined-stream/tsconfig.json @@ -1,10 +1,13 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,4 +20,4 @@ "index.d.ts", "combined-stream-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/combokeys/tsconfig.json b/types/combokeys/tsconfig.json index 17af434c7d..b1fecec3b7 100644 --- a/types/combokeys/tsconfig.json +++ b/types/combokeys/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 27e01ecd7b..02963e3afd 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/command-line-args/tsconfig.json b/types/command-line-args/tsconfig.json index 2f22f95af1..92c02160ae 100644 --- a/types/command-line-args/tsconfig.json +++ b/types/command-line-args/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/command-line-commands/tsconfig.json b/types/command-line-commands/tsconfig.json index 5d98c64e58..fd8670e4a1 100644 --- a/types/command-line-commands/tsconfig.json +++ b/types/command-line-commands/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/commander/tsconfig.json b/types/commander/tsconfig.json index 0db54c9488..dcb92cc920 100644 --- a/types/commander/tsconfig.json +++ b/types/commander/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/commangular/tsconfig.json b/types/commangular/tsconfig.json index 1491e780c2..bd900bd300 100644 --- a/types/commangular/tsconfig.json +++ b/types/commangular/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/comment-json/tsconfig.json b/types/comment-json/tsconfig.json index 314e9c0143..0745d1cfc0 100644 --- a/types/comment-json/tsconfig.json +++ b/types/comment-json/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/common-tags/tsconfig.json b/types/common-tags/tsconfig.json index 29c1a44652..21158de285 100644 --- a/types/common-tags/tsconfig.json +++ b/types/common-tags/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/commonmark/tsconfig.json b/types/commonmark/tsconfig.json index 82e3004b78..682d69fed4 100644 --- a/types/commonmark/tsconfig.json +++ b/types/commonmark/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "commonmark-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/compare-version/tsconfig.json b/types/compare-version/tsconfig.json index fd75d47da6..5dcb7c3156 100644 --- a/types/compare-version/tsconfig.json +++ b/types/compare-version/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/complex/tsconfig.json b/types/complex/tsconfig.json index c4a5dfc9f8..b8a54e716a 100644 --- a/types/complex/tsconfig.json +++ b/types/complex/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/component-emitter/tsconfig.json b/types/component-emitter/tsconfig.json index 265fa2d955..71ded6be82 100644 --- a/types/component-emitter/tsconfig.json +++ b/types/component-emitter/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/compose-function/tsconfig.json b/types/compose-function/tsconfig.json index fd6529f97c..cdbf9e9709 100644 --- a/types/compose-function/tsconfig.json +++ b/types/compose-function/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/compressible/tsconfig.json b/types/compressible/tsconfig.json index fb011bf968..8e036c88d9 100644 --- a/types/compressible/tsconfig.json +++ b/types/compressible/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "compressible-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/compression-webpack-plugin/tsconfig.json b/types/compression-webpack-plugin/tsconfig.json index 70383d3658..b80c7a1977 100644 --- a/types/compression-webpack-plugin/tsconfig.json +++ b/types/compression-webpack-plugin/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "compression-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/compression/tsconfig.json b/types/compression/tsconfig.json index 8fef7d56d4..63ff5e3bc8 100644 --- a/types/compression/tsconfig.json +++ b/types/compression/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/concat-stream/tsconfig.json b/types/concat-stream/tsconfig.json index a02b39c8ce..20373a2de3 100644 --- a/types/concat-stream/tsconfig.json +++ b/types/concat-stream/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/concaveman/tsconfig.json b/types/concaveman/tsconfig.json index 99348e7ba6..6312321a70 100644 --- a/types/concaveman/tsconfig.json +++ b/types/concaveman/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/conf/tsconfig.json b/types/conf/tsconfig.json index d165e88ea2..84d6bf7657 100644 --- a/types/conf/tsconfig.json +++ b/types/conf/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "conf-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/conf/v0/tsconfig.json b/types/conf/v0/tsconfig.json index 6047f464f4..004bd4a1b5 100644 --- a/types/conf/v0/tsconfig.json +++ b/types/conf/v0/tsconfig.json @@ -8,12 +8,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "conf": ["conf/v0"] + "conf": [ + "conf/v0" + ] }, "types": [], "noEmit": true, @@ -23,4 +26,4 @@ "index.d.ts", "conf-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/confidence/tsconfig.json b/types/confidence/tsconfig.json index 3032693704..8996cbd660 100644 --- a/types/confidence/tsconfig.json +++ b/types/confidence/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/config/tsconfig.json b/types/config/tsconfig.json index 8ebae968ac..a595ffb10c 100644 --- a/types/config/tsconfig.json +++ b/types/config/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/configstore/tsconfig.json b/types/configstore/tsconfig.json index 2bff288f39..8479846189 100644 --- a/types/configstore/tsconfig.json +++ b/types/configstore/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/confit/tsconfig.json b/types/confit/tsconfig.json index fb3580f31f..6d141ea715 100644 --- a/types/confit/tsconfig.json +++ b/types/confit/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-ensure-login/tsconfig.json b/types/connect-ensure-login/tsconfig.json index 1440c86913..95f39e8bf0 100644 --- a/types/connect-ensure-login/tsconfig.json +++ b/types/connect-ensure-login/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "connect-ensure-login-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/connect-flash/tsconfig.json b/types/connect-flash/tsconfig.json index a89c345bee..0d8c04c7de 100644 --- a/types/connect-flash/tsconfig.json +++ b/types/connect-flash/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-history-api-fallback/tsconfig.json b/types/connect-history-api-fallback/tsconfig.json index 124c7dc340..ad8919e94e 100644 --- a/types/connect-history-api-fallback/tsconfig.json +++ b/types/connect-history-api-fallback/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "connect-history-api-fallback-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/connect-livereload/tsconfig.json b/types/connect-livereload/tsconfig.json index f8574cb409..599ea294bf 100644 --- a/types/connect-livereload/tsconfig.json +++ b/types/connect-livereload/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-modrewrite/tsconfig.json b/types/connect-modrewrite/tsconfig.json index 63cf878ef5..235df5d93e 100644 --- a/types/connect-modrewrite/tsconfig.json +++ b/types/connect-modrewrite/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts index a512d7dc71..67caed7c27 100644 --- a/types/connect-mongo/connect-mongo-tests.ts +++ b/types/connect-mongo/connect-mongo-tests.ts @@ -43,3 +43,11 @@ app.use(session({ secret: 'secret', store: new MongoStore({db: mongoDb}) })); + +// NativeMongoPromiseOptions +var Client = mongodb.MongoClient; +var mongoDbPromise = Client.connect('mongodb://localhost/test'); +app.use(session({ + secret: 'secret', + store: new MongoStore({ dbPromise: mongoDbPromise}) +})); diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index 0b7443f7e1..6f71906fa5 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -91,14 +91,16 @@ declare namespace connectMongo { mongooseConnection: mongoose.Connection; } - export interface NaitiveMongoOptions extends DefaultOptions { + export interface NativeMongoOptions extends DefaultOptions { db: mongodb.Db; } + export interface NativeMongoPromiseOptions extends DefaultOptions { + dbPromise: Promise; + } + export interface MongoStoreFactory { - new (options: MongoUrlOptions): MongoStore; - new (options: MogooseConnectionOptions): MongoStore; - new (options: NaitiveMongoOptions): MongoStore; + new(options: MongoUrlOptions | MogooseConnectionOptions | NativeMongoOptions | NativeMongoPromiseOptions): MongoStore; } export class MongoStore extends session.Store { diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index 7cf4cc0975..c352be5580 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-pg-simple/connect-pg-simple-tests.ts b/types/connect-pg-simple/connect-pg-simple-tests.ts new file mode 100644 index 0000000000..1e90c9b4e5 --- /dev/null +++ b/types/connect-pg-simple/connect-pg-simple-tests.ts @@ -0,0 +1,44 @@ +import connectPgSimple = require("connect-pg-simple"); +import * as session from "express-session"; +import * as pg from "pg"; +import * as express from "express"; + +const pgSession = connectPgSimple(session); + +const pgPool = new pg.Pool({}); +const store1: session.Store = new pgSession({ + pool: pgPool, + tableName: "user_sessions", + pruneSessionInterval: 300 +}); + +const app = express(); +app.use(session({ + store: store1, + secret: "foo" +})); + +const store2: session.Store = new pgSession({ + conString: "postgres://postgres@localhost:5432/foo", + ttl: 3600, + schemaName: "someschema", + pruneSessionInterval: false, + errorLog: (...args) => console.error(...args) +}); + +const store3 = new pgSession({ + conObject: { + host: "localhost", + user: "database-user", + max: 20, + idleTimeoutMillis: 30000 + } +}); + +const store4 = new pgSession(); + +store4.close(); + +store4.pruneSessions(); + +store4.pruneSessions(err => console.log(err)); diff --git a/types/connect-pg-simple/index.d.ts b/types/connect-pg-simple/index.d.ts new file mode 100644 index 0000000000..2337eef86b --- /dev/null +++ b/types/connect-pg-simple/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for connect-pg-simple 4.2 +// Project: https://github.com/voxpelli/node-connect-pg-simple#readme +// Definitions by: Pasi Eronen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { RequestHandler } from "express"; +import { Store, SessionOptions } from "express-session"; +import { Pool, PoolConfig } from "pg"; + +declare function connectPgSimple(session: (options?: SessionOptions) => RequestHandler): typeof connectPgSimple.PGStore; + +declare namespace connectPgSimple { + class PGStore extends Store { + constructor(options?: PGStoreOptions); + close(): void; + pruneSessions(callback?: (err: Error) => void): void; + } + interface PGStoreOptions { + pool?: Pool; + pgPromise?: object; // not typed to avoid dependency to "pg-promise" module (which includes its own types) + conString?: string; + conObject?: PoolConfig; + ttl?: number; + schemaName?: string; + tableName?: string; + pruneSessionInterval?: false | number; + // tslint:disable-next-line:prefer-method-signature + errorLog?: (...args: any[]) => void; + } +} + +export = connectPgSimple; diff --git a/types/connect-pg-simple/tsconfig.json b/types/connect-pg-simple/tsconfig.json new file mode 100644 index 0000000000..ed22faf257 --- /dev/null +++ b/types/connect-pg-simple/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "connect-pg-simple-tests.ts" + ] +} \ No newline at end of file diff --git a/types/connect-pg-simple/tslint.json b/types/connect-pg-simple/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/connect-pg-simple/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/connect-redis/tsconfig.json b/types/connect-redis/tsconfig.json index ebbef60825..b47af7235d 100644 --- a/types/connect-redis/tsconfig.json +++ b/types/connect-redis/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-slashes/tsconfig.json b/types/connect-slashes/tsconfig.json index cceb646faf..18eed04f1a 100644 --- a/types/connect-slashes/tsconfig.json +++ b/types/connect-slashes/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect-timeout/tsconfig.json b/types/connect-timeout/tsconfig.json index 52eff5e6b3..79082f279a 100644 --- a/types/connect-timeout/tsconfig.json +++ b/types/connect-timeout/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/connect/tsconfig.json b/types/connect/tsconfig.json index f0bf140567..bcd813bc77 100644 --- a/types/connect/tsconfig.json +++ b/types/connect/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/console-stamp/tsconfig.json b/types/console-stamp/tsconfig.json index a8ba0aae9b..e4112e2035 100644 --- a/types/console-stamp/tsconfig.json +++ b/types/console-stamp/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/consolidate/tsconfig.json b/types/consolidate/tsconfig.json index c03c07a3a9..aab02b23e5 100644 --- a/types/consolidate/tsconfig.json +++ b/types/consolidate/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "consolidate-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/consul/tsconfig.json b/types/consul/tsconfig.json index 96f66d5c7d..9401826c02 100644 --- a/types/consul/tsconfig.json +++ b/types/consul/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/content-disposition/tsconfig.json b/types/content-disposition/tsconfig.json index 459ad4c307..25125c4ab6 100644 --- a/types/content-disposition/tsconfig.json +++ b/types/content-disposition/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/content-type/tsconfig.json b/types/content-type/tsconfig.json index 3361989225..139851cbde 100644 --- a/types/content-type/tsconfig.json +++ b/types/content-type/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "content-type-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/contentful-resolve-response/tsconfig.json b/types/contentful-resolve-response/tsconfig.json index 04b6576fee..f15c47db0a 100644 --- a/types/contentful-resolve-response/tsconfig.json +++ b/types/contentful-resolve-response/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/contextjs/tsconfig.json b/types/contextjs/tsconfig.json index f307972922..3054b8f3ca 100644 --- a/types/contextjs/tsconfig.json +++ b/types/contextjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/continuation-local-storage/tsconfig.json b/types/continuation-local-storage/tsconfig.json index 0bf318d3e8..f1305a49af 100644 --- a/types/continuation-local-storage/tsconfig.json +++ b/types/continuation-local-storage/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "continuation-local-storage-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/convert-hrtime/tsconfig.json b/types/convert-hrtime/tsconfig.json index 08efd1ab39..9d2b304763 100644 --- a/types/convert-hrtime/tsconfig.json +++ b/types/convert-hrtime/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "convert-hrtime-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/convert-layout/convert-layout-tests.ts b/types/convert-layout/convert-layout-tests.ts new file mode 100644 index 0000000000..8a55a1bfb5 --- /dev/null +++ b/types/convert-layout/convert-layout-tests.ts @@ -0,0 +1,5 @@ +import { ru } from 'convert-layout'; + +const s = 'Lorem ipsum dolor sit amet.'; +let result = ru.toEn(s); +result = ru.fromEn(s); diff --git a/types/convert-layout/index.d.ts b/types/convert-layout/index.d.ts new file mode 100644 index 0000000000..b19370efd2 --- /dev/null +++ b/types/convert-layout/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for convert-layout 0.5 +// Project: https://github.com/ai/convert-layout#readme +// Definitions by: Mikhail Aksenov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 +declare var layouts: { [id: string]: layout }; +declare var lang_layout: layout; + +declare const convert_layout: { + by: layout; + de: layout; + es: layout; + he: layout; + kk: layout; + ru: layout; + uk: layout; +}; + +declare module "convert-layout" { + export = convert_layout; +} + +declare module "convert-layout/by" { + export = lang_layout; +} + +declare module "convert-layout/de" { + export = lang_layout; +} + +declare module "convert-layout/es" { + export = lang_layout; +} + +declare module "convert-layout/he" { + export = lang_layout; +} + +declare module "convert-layout/kk" { + export = lang_layout; +} + +declare module "convert-layout/ru" { + export = lang_layout; +} + +declare module "convert-layout/uk" { + export = lang_layout; +} + +interface layout { + toEn(s: string): string; + fromEn(s: string): string; +} diff --git a/types/turf/tsconfig.json b/types/convert-layout/tsconfig.json similarity index 85% rename from types/turf/tsconfig.json rename to types/convert-layout/tsconfig.json index 8e175eaeff..e9ef959215 100644 --- a/types/turf/tsconfig.json +++ b/types/convert-layout/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,6 +18,6 @@ }, "files": [ "index.d.ts", - "turf-tests.ts" + "convert-layout-tests.ts" ] } \ No newline at end of file diff --git a/types/convert-layout/tslint.json b/types/convert-layout/tslint.json new file mode 100644 index 0000000000..5ef9aa96e5 --- /dev/null +++ b/types/convert-layout/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-declare-current-package": false + } +} diff --git a/types/convert-source-map/tsconfig.json b/types/convert-source-map/tsconfig.json index 4e5ff0aa9f..a9125c586c 100644 --- a/types/convert-source-map/tsconfig.json +++ b/types/convert-source-map/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index d7904ec5d6..5aac427dd0 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for convict 4.0 +// Type definitions for convict 4.1 // Project: https://github.com/mozilla/node-convict // Definitions by: Wim Looman // Vesa Poikajärvi @@ -118,7 +118,7 @@ declare namespace convict { interface convict { addFormat(format: convict.Format): void; addFormats(formats: { [name: string]: convict.Format }): void; - (config: convict.Schema): convict.Config; + (config: convict.Schema | string): convict.Config; } declare var convict: convict; export = convict; diff --git a/types/convict/tsconfig.json b/types/convict/tsconfig.json index 9c86c0db34..75e1402283 100644 --- a/types/convict/tsconfig.json +++ b/types/convict/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cookie-parser/tsconfig.json b/types/cookie-parser/tsconfig.json index 3eb1356a9d..20cf8359b5 100644 --- a/types/cookie-parser/tsconfig.json +++ b/types/cookie-parser/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cookie-session/tsconfig.json b/types/cookie-session/tsconfig.json index 14e5bffe19..bacf93c9f4 100644 --- a/types/cookie-session/tsconfig.json +++ b/types/cookie-session/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cookie-signature/tsconfig.json b/types/cookie-signature/tsconfig.json index 57344e816a..38aab055c7 100644 --- a/types/cookie-signature/tsconfig.json +++ b/types/cookie-signature/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cookie-signature-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cookie/tsconfig.json b/types/cookie/tsconfig.json index 3a3a4b60f9..f1a68c4f57 100644 --- a/types/cookie/tsconfig.json +++ b/types/cookie/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cookie_js/tsconfig.json b/types/cookie_js/tsconfig.json index 146b1adc25..d181ce7661 100644 --- a/types/cookie_js/tsconfig.json +++ b/types/cookie_js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cookie_js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cookies/tsconfig.json b/types/cookies/tsconfig.json index cba6e21671..d7a17c23bc 100644 --- a/types/cookies/tsconfig.json +++ b/types/cookies/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/copy-paste/tsconfig.json b/types/copy-paste/tsconfig.json index 2995ec5145..7c78f81542 100644 --- a/types/copy-paste/tsconfig.json +++ b/types/copy-paste/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/copy-text-to-clipboard/tsconfig.json b/types/copy-text-to-clipboard/tsconfig.json index 71b4595292..2889d9fdc6 100644 --- a/types/copy-text-to-clipboard/tsconfig.json +++ b/types/copy-text-to-clipboard/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "copy-text-to-clipboard-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/copy-webpack-plugin/tsconfig.json b/types/copy-webpack-plugin/tsconfig.json index 6952c8998f..026508651e 100644 --- a/types/copy-webpack-plugin/tsconfig.json +++ b/types/copy-webpack-plugin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-ionic/tsconfig.json b/types/cordova-ionic/tsconfig.json index 9468064357..52153dc3a6 100644 --- a/types/cordova-ionic/tsconfig.json +++ b/types/cordova-ionic/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-app-version/tsconfig.json b/types/cordova-plugin-app-version/tsconfig.json index 1c9f396113..bf9fa4b727 100644 --- a/types/cordova-plugin-app-version/tsconfig.json +++ b/types/cordova-plugin-app-version/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cordova-plugin-app-version-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova-plugin-app-version-tests.ts" + ] } \ No newline at end of file diff --git a/types/cordova-plugin-background-mode/tsconfig.json b/types/cordova-plugin-background-mode/tsconfig.json index 40b785d13b..2f4b1be013 100644 --- a/types/cordova-plugin-background-mode/tsconfig.json +++ b/types/cordova-plugin-background-mode/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-badge/tsconfig.json b/types/cordova-plugin-badge/tsconfig.json index 5f6a71f137..1354c708fd 100644 --- a/types/cordova-plugin-badge/tsconfig.json +++ b/types/cordova-plugin-badge/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "cordova-plugin-badge-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cordova-plugin-battery-status/tsconfig.json b/types/cordova-plugin-battery-status/tsconfig.json index dc873349a3..0149bb419c 100644 --- a/types/cordova-plugin-battery-status/tsconfig.json +++ b/types/cordova-plugin-battery-status/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-ble-central/tsconfig.json b/types/cordova-plugin-ble-central/tsconfig.json index 82135ca8f7..84cd1205c3 100644 --- a/types/cordova-plugin-ble-central/tsconfig.json +++ b/types/cordova-plugin-ble-central/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-camera/tsconfig.json b/types/cordova-plugin-camera/tsconfig.json index e54cb67d89..267426a6fa 100644 --- a/types/cordova-plugin-camera/tsconfig.json +++ b/types/cordova-plugin-camera/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-canvascamera/tsconfig.json b/types/cordova-plugin-canvascamera/tsconfig.json index f4a291c106..dcc6bf63a2 100644 --- a/types/cordova-plugin-canvascamera/tsconfig.json +++ b/types/cordova-plugin-canvascamera/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, "baseUrl": "../", diff --git a/types/cordova-plugin-contacts/tsconfig.json b/types/cordova-plugin-contacts/tsconfig.json index 76ef345600..6217f6ac02 100644 --- a/types/cordova-plugin-contacts/tsconfig.json +++ b/types/cordova-plugin-contacts/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-device-motion/tsconfig.json b/types/cordova-plugin-device-motion/tsconfig.json index 7330314961..ac897b5d8b 100644 --- a/types/cordova-plugin-device-motion/tsconfig.json +++ b/types/cordova-plugin-device-motion/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-device-name/tsconfig.json b/types/cordova-plugin-device-name/tsconfig.json index 5012f628be..c74e58b914 100644 --- a/types/cordova-plugin-device-name/tsconfig.json +++ b/types/cordova-plugin-device-name/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-device-orientation/tsconfig.json b/types/cordova-plugin-device-orientation/tsconfig.json index 8ffb719195..9b5d7a2f53 100644 --- a/types/cordova-plugin-device-orientation/tsconfig.json +++ b/types/cordova-plugin-device-orientation/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-device/tsconfig.json b/types/cordova-plugin-device/tsconfig.json index 3265c8b5b8..43170b45db 100644 --- a/types/cordova-plugin-device/tsconfig.json +++ b/types/cordova-plugin-device/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-dialogs/tsconfig.json b/types/cordova-plugin-dialogs/tsconfig.json index 1f11e8d304..0f12ab4850 100644 --- a/types/cordova-plugin-dialogs/tsconfig.json +++ b/types/cordova-plugin-dialogs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-email-composer/tsconfig.json b/types/cordova-plugin-email-composer/tsconfig.json index c01c309dc3..9de9930ed1 100644 --- a/types/cordova-plugin-email-composer/tsconfig.json +++ b/types/cordova-plugin-email-composer/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-file-opener2/tsconfig.json b/types/cordova-plugin-file-opener2/tsconfig.json index b9b71ec9e2..0b84dfe84e 100644 --- a/types/cordova-plugin-file-opener2/tsconfig.json +++ b/types/cordova-plugin-file-opener2/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "cordova-plugin-file-opener2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cordova-plugin-file-transfer/tsconfig.json b/types/cordova-plugin-file-transfer/tsconfig.json index 558186b6a7..eaa8a05e18 100644 --- a/types/cordova-plugin-file-transfer/tsconfig.json +++ b/types/cordova-plugin-file-transfer/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-file/tsconfig.json b/types/cordova-plugin-file/tsconfig.json index c735f5876b..f855076e2a 100644 --- a/types/cordova-plugin-file/tsconfig.json +++ b/types/cordova-plugin-file/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-globalization/tsconfig.json b/types/cordova-plugin-globalization/tsconfig.json index d9317cc455..8455c229c3 100644 --- a/types/cordova-plugin-globalization/tsconfig.json +++ b/types/cordova-plugin-globalization/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-ibeacon/tsconfig.json b/types/cordova-plugin-ibeacon/tsconfig.json index af70edc7f5..ba0aa9b7cf 100644 --- a/types/cordova-plugin-ibeacon/tsconfig.json +++ b/types/cordova-plugin-ibeacon/tsconfig.json @@ -8,12 +8,15 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "paths": { - "q": [ "q/v0" ] + "q": [ + "q/v0" + ] }, "types": [], "noEmit": true, diff --git a/types/cordova-plugin-inappbrowser/index.d.ts b/types/cordova-plugin-inappbrowser/index.d.ts index b266fbab44..1cf2c67642 100644 --- a/types/cordova-plugin-inappbrowser/index.d.ts +++ b/types/cordova-plugin-inappbrowser/index.d.ts @@ -25,7 +25,7 @@ interface Window { * NOTE: The InAppBrowser window behaves like a standard web browser, and can't access Cordova APIs. */ interface InAppBrowser extends Window { - onloadstart(type: InAppBrowserEvent): void; + onloadstart(type: Event): void; onloadstop(type: InAppBrowserEvent): void; onloaderror(type: InAppBrowserEvent): void; onexit(type: InAppBrowserEvent): void; diff --git a/types/cordova-plugin-inappbrowser/tsconfig.json b/types/cordova-plugin-inappbrowser/tsconfig.json index fc11c3516e..ff0151160c 100644 --- a/types/cordova-plugin-inappbrowser/tsconfig.json +++ b/types/cordova-plugin-inappbrowser/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-insomnia/tsconfig.json b/types/cordova-plugin-insomnia/tsconfig.json index 27dec59de9..9704e7c020 100644 --- a/types/cordova-plugin-insomnia/tsconfig.json +++ b/types/cordova-plugin-insomnia/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-keyboard/tsconfig.json b/types/cordova-plugin-keyboard/tsconfig.json index d5003a2452..730b84c530 100644 --- a/types/cordova-plugin-keyboard/tsconfig.json +++ b/types/cordova-plugin-keyboard/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-mapsforge/tsconfig.json b/types/cordova-plugin-mapsforge/tsconfig.json index 47574a27f4..2be513a0d3 100644 --- a/types/cordova-plugin-mapsforge/tsconfig.json +++ b/types/cordova-plugin-mapsforge/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-media-capture/tsconfig.json b/types/cordova-plugin-media-capture/tsconfig.json index 06cb2a424f..5f87c5709a 100644 --- a/types/cordova-plugin-media-capture/tsconfig.json +++ b/types/cordova-plugin-media-capture/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-media/tsconfig.json b/types/cordova-plugin-media/tsconfig.json index 75eb223a75..8399ccf964 100644 --- a/types/cordova-plugin-media/tsconfig.json +++ b/types/cordova-plugin-media/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-ms-adal/tsconfig.json b/types/cordova-plugin-ms-adal/tsconfig.json index fb114e9983..9ebb3fca10 100644 --- a/types/cordova-plugin-ms-adal/tsconfig.json +++ b/types/cordova-plugin-ms-adal/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-native-keyboard/tsconfig.json b/types/cordova-plugin-native-keyboard/tsconfig.json index 4309b2406b..72ec2f6371 100644 --- a/types/cordova-plugin-native-keyboard/tsconfig.json +++ b/types/cordova-plugin-native-keyboard/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cordova-plugin-native-keyboard-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cordova-plugin-network-information/tsconfig.json b/types/cordova-plugin-network-information/tsconfig.json index 8e10e94b39..2ffebf9678 100644 --- a/types/cordova-plugin-network-information/tsconfig.json +++ b/types/cordova-plugin-network-information/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-ouralabs/tsconfig.json b/types/cordova-plugin-ouralabs/tsconfig.json index 6f49ddee6d..2cbd8ea053 100644 --- a/types/cordova-plugin-ouralabs/tsconfig.json +++ b/types/cordova-plugin-ouralabs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-qrscanner/tsconfig.json b/types/cordova-plugin-qrscanner/tsconfig.json index bb4c00016f..e2ef38fa17 100644 --- a/types/cordova-plugin-qrscanner/tsconfig.json +++ b/types/cordova-plugin-qrscanner/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-spinner/tsconfig.json b/types/cordova-plugin-spinner/tsconfig.json index 71540baad3..19ec9b294f 100644 --- a/types/cordova-plugin-spinner/tsconfig.json +++ b/types/cordova-plugin-spinner/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-splashscreen/tsconfig.json b/types/cordova-plugin-splashscreen/tsconfig.json index 20313323c0..cc4a7f28c5 100644 --- a/types/cordova-plugin-splashscreen/tsconfig.json +++ b/types/cordova-plugin-splashscreen/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-statusbar/tsconfig.json b/types/cordova-plugin-statusbar/tsconfig.json index 0518e44a96..2b6c772083 100644 --- a/types/cordova-plugin-statusbar/tsconfig.json +++ b/types/cordova-plugin-statusbar/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-vibration/tsconfig.json b/types/cordova-plugin-vibration/tsconfig.json index 0ea0850540..679fc97d2d 100644 --- a/types/cordova-plugin-vibration/tsconfig.json +++ b/types/cordova-plugin-vibration/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-websql/tsconfig.json b/types/cordova-plugin-websql/tsconfig.json index 190c2aa2fb..db8d59bbe6 100644 --- a/types/cordova-plugin-websql/tsconfig.json +++ b/types/cordova-plugin-websql/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-x-socialsharing/tsconfig.json b/types/cordova-plugin-x-socialsharing/tsconfig.json index 6dc2e352c9..e2c4bc63d9 100644 --- a/types/cordova-plugin-x-socialsharing/tsconfig.json +++ b/types/cordova-plugin-x-socialsharing/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-sqlite-storage/tsconfig.json b/types/cordova-sqlite-storage/tsconfig.json index 45a90093e7..a9eb2af0ad 100644 --- a/types/cordova-sqlite-storage/tsconfig.json +++ b/types/cordova-sqlite-storage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova.plugins.diagnostic/tsconfig.json b/types/cordova.plugins.diagnostic/tsconfig.json index 0c89cc0ff4..bb2cdc4dfd 100644 --- a/types/cordova.plugins.diagnostic/tsconfig.json +++ b/types/cordova.plugins.diagnostic/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova/tsconfig.json b/types/cordova/tsconfig.json index f6a6b7ae87..591c25a1bb 100644 --- a/types/cordova/tsconfig.json +++ b/types/cordova/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova_app_version_plugin/tsconfig.json b/types/cordova_app_version_plugin/tsconfig.json index 62f656037c..2f439d4979 100644 --- a/types/cordova_app_version_plugin/tsconfig.json +++ b/types/cordova_app_version_plugin/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordovarduino/tsconfig.json b/types/cordovarduino/tsconfig.json index e10237b685..cb0cf33a1a 100644 --- a/types/cordovarduino/tsconfig.json +++ b/types/cordovarduino/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/core-decorators/tsconfig.json b/types/core-decorators/tsconfig.json index 1c0b389c96..af573cbe86 100644 --- a/types/core-decorators/tsconfig.json +++ b/types/core-decorators/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "experimentalDecorators": true, "typeRoots": [ diff --git a/types/core-js/tsconfig.json b/types/core-js/tsconfig.json index 8c7007b563..a342d6c1bd 100644 --- a/types/core-js/tsconfig.json +++ b/types/core-js/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cors/tsconfig.json b/types/cors/tsconfig.json index 92608af1c2..e9e1db77eb 100644 --- a/types/cors/tsconfig.json +++ b/types/cors/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cote/tsconfig.json b/types/cote/tsconfig.json index 2f8460f53d..c25e78e090 100644 --- a/types/cote/tsconfig.json +++ b/types/cote/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cote-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/couchbase/tsconfig.json b/types/couchbase/tsconfig.json index 42b654bc76..66ef360c2c 100644 --- a/types/couchbase/tsconfig.json +++ b/types/couchbase/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/countdown/tsconfig.json b/types/countdown/tsconfig.json index 13f9392c88..bf1074d820 100644 --- a/types/countdown/tsconfig.json +++ b/types/countdown/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/counterpart/tsconfig.json b/types/counterpart/tsconfig.json index 9f2ad836b7..1a771cd73c 100644 --- a/types/counterpart/tsconfig.json +++ b/types/counterpart/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "counterpart-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/countries-and-timezones/tsconfig.json b/types/countries-and-timezones/tsconfig.json index 8a5b341368..e5f7728b57 100644 --- a/types/countries-and-timezones/tsconfig.json +++ b/types/countries-and-timezones/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "countries-and-timezones-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/country-list/tsconfig.json b/types/country-list/tsconfig.json index dce3c4a287..30433764bf 100644 --- a/types/country-list/tsconfig.json +++ b/types/country-list/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "country-list-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/country-select-js/tsconfig.json b/types/country-select-js/tsconfig.json index 749b1b3af1..56cb852a6d 100644 --- a/types/country-select-js/tsconfig.json +++ b/types/country-select-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "country-select-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cp-file/tsconfig.json b/types/cp-file/tsconfig.json index ab4eca94d8..12138d0002 100644 --- a/types/cp-file/tsconfig.json +++ b/types/cp-file/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cp-file-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cpy/tsconfig.json b/types/cpy/tsconfig.json index 75f61a1e5d..90098461b2 100644 --- a/types/cpy/tsconfig.json +++ b/types/cpy/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cpy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cradle/tsconfig.json b/types/cradle/tsconfig.json index c4e14edbf5..694d713edf 100644 --- a/types/cradle/tsconfig.json +++ b/types/cradle/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/crc/tsconfig.json b/types/crc/tsconfig.json index 1cf7c2f4ff..96511b6609 100644 --- a/types/crc/tsconfig.json +++ b/types/crc/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/create-error/tsconfig.json b/types/create-error/tsconfig.json index 0483cd70bf..7ff8a82807 100644 --- a/types/create-error/tsconfig.json +++ b/types/create-error/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/create-react-class/create-react-class-tests.ts b/types/create-react-class/create-react-class-tests.ts new file mode 100644 index 0000000000..c3f7c620ef --- /dev/null +++ b/types/create-react-class/create-react-class-tests.ts @@ -0,0 +1,106 @@ +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import * as DOM from "react-dom-factories"; +import * as createReactClass from "create-react-class"; + +interface Props { + foo: string; +} + +interface State { + bar: number; +} + +const props: Props & React.ClassAttributes<{}> = { + foo: "foo" +}; + +const container: Element = document.createElement("div"); + +// +// Top-Level API +// -------------------------------------------------------------------------- + +const ClassicComponent: React.ClassicComponentClass = createReactClass({ + childContextTypes: {}, + componentDidCatch(err, errorInfo) { + const msg: string = err.message; + const name: string = err.name; + const stack: string | undefined = err.stack; + const componentStack: string = errorInfo.componentStack; + }, + componentDidMount() {}, + componentDidUpdate(props, state) { + const foo: string = props.foo; + const bar: number = state.bar; + }, + componentWillMount() {}, + componentWillReceiveProps(nextProps) { + const oldFoo: string = nextProps.foo; + }, + componentWillUnmount() {}, + componentWillUpdate(props, state) { + const foo: string = props.foo; + const bar: number = state.bar; + }, + contextTypes: {}, + displayName: "Test", + getDefaultProps() { + return { foo: "f" }; + }, + getInitialState() { + return { bar: 1 }; + }, + mixins: [], + propTypes: {}, + shouldComponentUpdate(this: React.ClassicComponent, nextProps, nextState) { + const newFoo: string = nextProps.foo; + const newBar: number = nextState.bar; + return newFoo !== this.props.foo && newBar !== this.state.bar; + }, + statics: { + test: 1 + }, + reset() { + this.replaceState(this.getInitialState!()); + }, + render() { + return DOM.div(null, + DOM.input({ + ref: input => this._input = input, + value: this.state.bar + })); + } +}); + +// React.createFactory +const classicFactory: React.ClassicFactory = + React.createFactory(ClassicComponent); +const classicFactoryElement: React.ClassicElement = + classicFactory(props); + +// React.createElement +const classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); + +// React.cloneElement +const clonedClassicElement: React.ClassicElement = + React.cloneElement(classicElement, props); + +// ReactDOM.render +const classicComponent: React.ClassicComponent = ReactDOM.render(classicElement, container); + +// +// React Components +// -------------------------------------------------------------------------- + +const displayName: string | undefined = ClassicComponent.displayName; +const defaultProps: Props = ClassicComponent.getDefaultProps ? ClassicComponent.getDefaultProps() : {} as Props; +const propTypes: React.ValidationMap | undefined = ClassicComponent.propTypes; + +// +// Component API +// -------------------------------------------------------------------------- + +// classic +const isMounted: boolean = classicComponent.isMounted(); +classicComponent.replaceState({ inputValue: "???", seconds: 60 }); diff --git a/types/create-react-class/index.d.ts b/types/create-react-class/index.d.ts new file mode 100644 index 0000000000..211474ac16 --- /dev/null +++ b/types/create-react-class/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for create-react-class 15.6 +// Project: https://facebook.github.io/react/ +// Definitions by: John Gozde +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ComponentSpec, ClassicComponentClass } from "react"; + +declare namespace createReactClass {} +declare function createReactClass(spec: ComponentSpec): ClassicComponentClass

; + +export as namespace createReactClass; +export = createReactClass; diff --git a/types/create-react-class/tsconfig.json b/types/create-react-class/tsconfig.json new file mode 100644 index 0000000000..b003c69e53 --- /dev/null +++ b/types/create-react-class/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" + }, + "files": [ + "index.d.ts", + "create-react-class-tests.ts" + ] +} diff --git a/types/create-react-class/tslint.json b/types/create-react-class/tslint.json new file mode 100644 index 0000000000..08337e85f7 --- /dev/null +++ b/types/create-react-class/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-object-literal-type-assertion": false, + "no-unnecessary-generics": false + } +} diff --git a/types/createjs-lib/tsconfig.json b/types/createjs-lib/tsconfig.json index 27e01ecd7b..02963e3afd 100644 --- a/types/createjs-lib/tsconfig.json +++ b/types/createjs-lib/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/createjs/tsconfig.json b/types/createjs/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/createjs/tsconfig.json +++ b/types/createjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/credential/tsconfig.json b/types/credential/tsconfig.json index 627a597d83..fb8e758820 100644 --- a/types/credential/tsconfig.json +++ b/types/credential/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/credit-card-type/tsconfig.json b/types/credit-card-type/tsconfig.json index 350e87fba3..0a3b957a29 100644 --- a/types/credit-card-type/tsconfig.json +++ b/types/credit-card-type/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cron/tsconfig.json b/types/cron/tsconfig.json index 926752dcc8..19a72853db 100644 --- a/types/cron/tsconfig.json +++ b/types/cron/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cropperjs/tsconfig.json b/types/cropperjs/tsconfig.json index 4100fb8912..ea6b7edb26 100644 --- a/types/cropperjs/tsconfig.json +++ b/types/cropperjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/croppie/index.d.ts b/types/croppie/index.d.ts index 78ab07ad61..ec4626aa7f 100644 --- a/types/croppie/index.d.ts +++ b/types/croppie/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for croppie 2.4 +// Type definitions for croppie 2.5 // Project: https://github.com/Foliotek/Croppie // Definitions by: Connor Peet +// dklmuc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export default class Croppie { @@ -31,7 +32,10 @@ export type CropType = 'square' | 'circle'; export type Format = 'jpeg' | 'png' | 'webp'; +export type Type = 'canvas' | 'base64' | 'html' | 'blob' | 'rawcanvas'; + export interface ResultOptions { + type?: Type; size?: 'viewport' | 'original' | { width: number, height: number }; format?: Format; quality?: number; diff --git a/types/croppie/tsconfig.json b/types/croppie/tsconfig.json index 488e016fce..aa4a07017d 100644 --- a/types/croppie/tsconfig.json +++ b/types/croppie/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cross-storage/tsconfig.json b/types/cross-storage/tsconfig.json index 58cd7f5807..eb05417639 100644 --- a/types/cross-storage/tsconfig.json +++ b/types/cross-storage/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/crossfilter/tsconfig.json b/types/crossfilter/tsconfig.json index 4512ebdb3c..bc0573220f 100644 --- a/types/crossfilter/tsconfig.json +++ b/types/crossfilter/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/crossroads/tsconfig.json b/types/crossroads/tsconfig.json index 4560977b00..b948857129 100644 --- a/types/crossroads/tsconfig.json +++ b/types/crossroads/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cryptiles/tsconfig.json b/types/cryptiles/tsconfig.json index 2515c735a4..6ae78bacb4 100644 --- a/types/cryptiles/tsconfig.json +++ b/types/cryptiles/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cryptiles-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/crypto-js/crypto-js-tests.ts b/types/crypto-js/crypto-js-tests.ts index c36def9f90..9b5dd1be6f 100644 --- a/types/crypto-js/crypto-js-tests.ts +++ b/types/crypto-js/crypto-js-tests.ts @@ -11,6 +11,10 @@ wordArray = CryptoJS.SHA1('some message', 'some key', { any: true }); wordArray = CryptoJS.format.OpenSSL('some message'); wordArray = CryptoJS.format.OpenSSL('some message', 'some key'); +var FR = new FileReader(); +FR.onloadend = () => { + var hash = CryptoJS.SHA1(CryptoJS.lib.WordArray.create(FR.result)).toString() +} // Ciphers var encrypted: CryptoJS.WordArray; diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index 8e80c74a07..c3dad4637b 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -8,10 +8,10 @@ export as namespace CryptoJS; declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { - type Hash = (message: string, key?: string, ...options: any[]) => WordArray; + type Hash = (message: string | LibWordArray, key?: string, ...options: any[]) => WordArray; interface Cipher { - encrypt(message: string, secretPassphrase: string, option?: CipherOption): WordArray; - decrypt(encryptedMessage: string | WordArray, secretPassphrase: string, option?: CipherOption): DecryptedMessage; + encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; + decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; } interface CipherAlgorythm { createEncryptor(secretPassphrase: string, option?: CipherOption): Encriptor; @@ -25,6 +25,10 @@ declare namespace CryptoJS { process(messagePart: string): string; finalize(): string; } + interface LibWordArray { + sigBytes: number, + words: number[], + } export interface WordArray { iv: string; salt: string; @@ -97,6 +101,11 @@ declare namespace CryptoJS { Utf16LE: Encoder; Base64: Encoder; }; + lib: { + WordArray: { + create: (v: any) => LibWordArray; + }; + }; mode: { CBC: Mode; CFB: Mode; diff --git a/types/crypto-js/tsconfig.json b/types/crypto-js/tsconfig.json index 10865613d3..62ec3d1e40 100644 --- a/types/crypto-js/tsconfig.json +++ b/types/crypto-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -65,4 +66,4 @@ "pad-zeropadding/index.d.ts", "pad-nopadding/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/cryptojs/tsconfig.json b/types/cryptojs/tsconfig.json index 37c28e35d8..6747ffb9c5 100644 --- a/types/cryptojs/tsconfig.json +++ b/types/cryptojs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cson/tsconfig.json b/types/cson/tsconfig.json index dc01e869d3..a5ca0a8041 100644 --- a/types/cson/tsconfig.json +++ b/types/cson/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/csprng/tsconfig.json b/types/csprng/tsconfig.json index 0877c1ab25..b921bb3b7c 100644 --- a/types/csprng/tsconfig.json +++ b/types/csprng/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "csprng-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/csrf/tsconfig.json b/types/csrf/tsconfig.json index 658116154e..423d71f3c2 100644 --- a/types/csrf/tsconfig.json +++ b/types/csrf/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "csrf-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/css-font-loading-module/tsconfig.json b/types/css-font-loading-module/tsconfig.json index 7037164a1f..b45d115596 100644 --- a/types/css-font-loading-module/tsconfig.json +++ b/types/css-font-loading-module/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/css-modules-require-hook/tsconfig.json b/types/css-modules-require-hook/tsconfig.json index 3343450de2..e7f91df2f8 100644 --- a/types/css-modules-require-hook/tsconfig.json +++ b/types/css-modules-require-hook/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/css-modules/tsconfig.json b/types/css-modules/tsconfig.json index 40a428a927..e079616b1d 100644 --- a/types/css-modules/tsconfig.json +++ b/types/css-modules/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/css/tsconfig.json b/types/css/tsconfig.json index 5e942dfd7c..7a69ddb612 100644 --- a/types/css/tsconfig.json +++ b/types/css/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cssbeautify/tsconfig.json b/types/cssbeautify/tsconfig.json index 622328ac5d..a8c452dc97 100644 --- a/types/cssbeautify/tsconfig.json +++ b/types/cssbeautify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/csurf/tsconfig.json b/types/csurf/tsconfig.json index 27e01ecd7b..02963e3afd 100644 --- a/types/csurf/tsconfig.json +++ b/types/csurf/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/csv-parse/tsconfig.json b/types/csv-parse/tsconfig.json index b721ff4fe6..2b52f434a2 100644 --- a/types/csv-parse/tsconfig.json +++ b/types/csv-parse/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/csv-stringify/tsconfig.json b/types/csv-stringify/tsconfig.json index 12aac1d2a0..766e9c084e 100644 --- a/types/csv-stringify/tsconfig.json +++ b/types/csv-stringify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/csvrow/csvrow-tests.ts b/types/csvrow/csvrow-tests.ts new file mode 100644 index 0000000000..133eab5937 --- /dev/null +++ b/types/csvrow/csvrow-tests.ts @@ -0,0 +1,10 @@ +import csvrow = require("csvrow"); + +let row = "a,b,c"; +let columns: string[]; + +columns = csvrow.parse(row); + +row = csvrow.stringify(columns); + +row = csvrow.normalize(row); diff --git a/types/csvrow/index.d.ts b/types/csvrow/index.d.ts new file mode 100644 index 0000000000..53df54a249 --- /dev/null +++ b/types/csvrow/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for csvrow 0.1 +// Project: https://github.com/trentm/node-csvrow +// Definitions by: Peter Harris +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Parse a CSV row (i.e. a single row) into an array of strings. + * + * c.f. http://en.wikipedia.org/wiki/Comma-separated_values + * + * Limitations/Opinions: + * - don't support elements with line-breaks + * - leading a trailing spaces are trimmed, unless the entry is quoted + * + * @throws {TypeError} if the given CSV row is invalid + * + * @summary Parse a CSV row into an array of strings. + */ +export function parse(row: string): string[]; + +/** + * Serialize the given array to a CSV row. + */ +export function stringify(columns: string[]): string; + +/** + * Normalize the given CSV line. + */ +export function normalize(row: string): string; diff --git a/types/csvrow/tsconfig.json b/types/csvrow/tsconfig.json new file mode 100644 index 0000000000..7fc1637725 --- /dev/null +++ b/types/csvrow/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes" : true + }, + "files": [ + "index.d.ts", + "csvrow-tests.ts" + ] +} diff --git a/types/csvrow/tslint.json b/types/csvrow/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/csvrow/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/csvtojson/tsconfig.json b/types/csvtojson/tsconfig.json index 81ec6a66a2..91b15a3856 100644 --- a/types/csvtojson/tsconfig.json +++ b/types/csvtojson/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "csvtojson-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cucumber/tsconfig.json b/types/cucumber/tsconfig.json index a2bd1c7023..e2f9cd081b 100644 --- a/types/cucumber/tsconfig.json +++ b/types/cucumber/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "cucumber-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cucumber/v1/tsconfig.json b/types/cucumber/v1/tsconfig.json index 3c64799f9a..343c701491 100644 --- a/types/cucumber/v1/tsconfig.json +++ b/types/cucumber/v1/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../../", "typeRoots": [ "../../" @@ -28,4 +29,4 @@ "index.d.ts", "cucumber-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cuid/tsconfig.json b/types/cuid/tsconfig.json index 838a40b34e..6aebd0a158 100644 --- a/types/cuid/tsconfig.json +++ b/types/cuid/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/currency-formatter/currency-formatter-tests.ts b/types/currency-formatter/currency-formatter-tests.ts index f06f53ce05..83617a6404 100644 --- a/types/currency-formatter/currency-formatter-tests.ts +++ b/types/currency-formatter/currency-formatter-tests.ts @@ -3,12 +3,21 @@ import currencyFormatter = require('currency-formatter'); currencyFormatter.format(1000000, { code: 'USD' }); // => '$1,000,000.00' +currencyFormatter.unformat('$1,000,000.00', { code: 'USD' }); +// => 1000000 + currencyFormatter.format(1000000, { code: 'GBP' }); // => 'ÂŁ1,000,000.00' +currencyFormatter.unformat('ÂŁ1,000,000.00', { code: 'GBP' }); +// => 1000000 + currencyFormatter.format(1000000, { code: 'EUR' }); // => '1 000 000,00 €' +currencyFormatter.unformat('1 000 000,00 €', { code: 'EUR' }); +// => 1000000 + currencyFormatter.findCurrency('USD'); // returns: // { diff --git a/types/currency-formatter/index.d.ts b/types/currency-formatter/index.d.ts index 67591738ab..d88f18ea7c 100644 --- a/types/currency-formatter/index.d.ts +++ b/types/currency-formatter/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for currency-formatter 1.0 +// Type definitions for currency-formatter 1.3 // Project: https://github.com/smirzaei/currency-formatter#readme // Definitions by: Mohamed Hegazy +// David Paz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Currency { @@ -18,6 +19,7 @@ export const defaultCurrency: Currency; export function findCurrency(currencyCode: string): Currency; export function format(value: number, options: { code?: string, + locale?: string, symbol?: string, decimal?: string, thousand?: string, @@ -28,3 +30,17 @@ export function format(value: number, options: { zero: string } }): string; + +export function unformat(value: string, options: { + code?: string, + locale?: string, + symbol?: string, + decimal?: string, + thousand?: string, + precision?: number, + format?: string | { + pos: string, + neg: string, + zero: string + } +}): number; diff --git a/types/currency-formatter/tsconfig.json b/types/currency-formatter/tsconfig.json index 1b94e5fe16..47674cfe0d 100644 --- a/types/currency-formatter/tsconfig.json +++ b/types/currency-formatter/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/custom-error-generator/tsconfig.json b/types/custom-error-generator/tsconfig.json index 78356d1c2a..ab16a76d97 100644 --- a/types/custom-error-generator/tsconfig.json +++ b/types/custom-error-generator/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cwise-compiler/tsconfig.json b/types/cwise-compiler/tsconfig.json index a78923fa03..083c5f1666 100644 --- a/types/cwise-compiler/tsconfig.json +++ b/types/cwise-compiler/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cwise-compiler-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cwise-parser/tsconfig.json b/types/cwise-parser/tsconfig.json index ce6c3c1355..226bb609fb 100644 --- a/types/cwise-parser/tsconfig.json +++ b/types/cwise-parser/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cwise-parser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cwise/tsconfig.json b/types/cwise/tsconfig.json index f4aaf9b1a3..c1ea871113 100644 --- a/types/cwise/tsconfig.json +++ b/types/cwise/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cwise-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cwise-tests.ts" + ] } \ No newline at end of file diff --git a/types/cybozulabs-md5/tsconfig.json b/types/cybozulabs-md5/tsconfig.json index 2bfbaca631..a85459ac83 100644 --- a/types/cybozulabs-md5/tsconfig.json +++ b/types/cybozulabs-md5/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cypress/tsconfig.json b/types/cypress/tsconfig.json index 6e61b09e60..93fcd9f8c2 100644 --- a/types/cypress/tsconfig.json +++ b/types/cypress/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "cypress-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts new file mode 100644 index 0000000000..0b7bac436e --- /dev/null +++ b/types/cytoscape/cytoscape-tests.ts @@ -0,0 +1,82 @@ +'use strict'; +import cytoscape = require('cytoscape'); + +const parentCSS = { + 'padding-top': '10px', + 'padding-left': '10px', + 'padding-bottom': '10px', + 'padding-right': '10px', + 'text-valign': 'top', + 'text-halign': 'center', + 'background-color': '#CCC', + 'font-size': 40, + 'min-zoomed-font-size': 15 +}; + +const showAllStyle: cytoscape.Stylesheet[] = [ + { + selector: 'node', + css: { + content: 'data(id)', + 'text-valign': 'center', + 'text-halign': 'center', + shape: 'rectangle', + 'min-zoomed-font-size': 20, + opacity: 1 + } + }, + { + selector: '$node > node', + css: parentCSS + }, + { + selector: 'edge', + css: { + 'target-arrow-shape': 'triangle' + } + }, + { + selector: ':selected', + css: { + 'background-color': 'black', + 'line-color': 'black', + 'target-arrow-color': 'black', + 'source-arrow-color': 'black' + } + } +]; + +const cy = cytoscape({ + container: document.getElementById('cy'), + + boxSelectionEnabled: false, + autounselectify: true, + + style: showAllStyle, + + elements: { + nodes: [ + { data: { id: 'a', parent: 'b' }, position: { x: 215, y: 85 } }, + { data: { id: 'b' } }, + { data: { id: 'c', parent: 'b' }, position: { x: 300, y: 85 } }, + { data: { id: 'd' }, position: { x: 215, y: 175 } }, + { data: { id: 'e' } }, + { data: { id: 'f', parent: 'e' }, position: { x: 300, y: 175 } } + ], + edges: [ + { data: { id: 'ad', source: 'a', target: 'd' } }, + { data: { id: 'eb', source: 'e', target: 'b' } } + ] + }, + + layout: { + name: 'preset', + padding: 5 + } +}); + +cy.on('zoom', (event) => { + if (cy.zoom() <= 1) { + cy.nodes('$node > node').style('opacity', 0); + } +}); diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts new file mode 100644 index 0000000000..3a618195d1 --- /dev/null +++ b/types/cytoscape/index.d.ts @@ -0,0 +1,4521 @@ +// Type definitions for Cytoscape.js 3.1 +// Project: http://js.cytoscape.org/ +// Definitions by: Fabian Schmidt and Fred Eisele +// Shenghan Gao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// Translation from Objects in help to Typescript interface. +// http://js.cytoscape.org/#notation/functions +// + +/** + * cy --> Cy.Core + * the core + * + * eles --> Cy.Collection + * a collection of one or more elements (nodes and edges) + * + * ele --> Cy.Singular + * a collection of a single element (node or edge) + * + * node --> Cy.NodeSingular + * a collection of a single node + * + * nodes -> Cy.NodeCollection + * a collection of one or more nodes + * + * edge --> Cy.EdgeSingular + * a collection of a single edge + * + * edges -> Cy.EdgeCollection + * a collection of one or more edges + * + * The library makes a distinction between input and output parameters + * due to the dynamic behaviour of the Cytoscape library. + * + * For a input parameter it will always expect: + * - Cy.Collection + * The input can be any element (node and edge) collection. + * - Cy.NodeCollection + * The input must be a node collection. + * - Cy.EdgeCollection + * The input must be a edge collection. + * - Cy.Singular + * The input must be a single element. + * - Cy.NodeSingular + * The inut must be a single node. + * - Cy.EdgeSingular + * The input must be a single edge. + * + * For a output of a function it will always give: + * - Cy.CollectionElements + * The output is a collection of node and edge elements OR single element. + * - Cy.EdgeCollection + * The output is a collection of edge elements OR single edge. + * - Cy.NodeCollection + * The output is a collection of node elements OR single node. + * + * A number of interfaces contain nothing as they server to collect interfaces. + * + */ +export = cytoscape; +export as namespace cytoscape; + +declare function cytoscape(options?: cytoscape.CytoscapeOptions): cytoscape.Core; +declare function cytoscape(extensionName: string, foo: string, bar: any): cytoscape.Core; + +declare namespace cytoscape { + interface Position { + x: number; + y: number; + } + + type CssStyleDeclaration = any; + + interface ElementDefinition { + group?: ElementGroup; + data: NodeDataDefinition | EdgeDataDefinition; + /** + * Scratchpad data (usually temp or nonserialisable data) + */ + scatch?: Scratchpad; + /** + * The model position of the node (optional on init, mandatory after) + */ + position?: Position; + /** + * can alternatively specify position in rendered on-screen pixels + */ + renderedPosition?: Position; + /** + * Whether the element is selected (default false) + */ + selected?: boolean; + /** + * Whether the selection state is mutable (default true) + */ + selectable?: boolean; + /** + * When locked a node's position is immutable (default false) + */ + locked?: boolean; + /** + * Wether the node can be grabbed and moved by the user + */ + grabbable?: boolean; + /** + * a space separated list of class names that the element has + */ + classes?: string; + /** + * CssStyleDeclaration; + */ + style?: CssStyleDeclaration; + /** + * you should only use `style`/`css` for very special cases; use classes instead + */ + css?: Css.Node | Css.Edge; + } + + interface ElementDataDefinition { + /** + * elided id => autogenerated id + */ + id?: string; + position?: Position; + } + + interface EdgeDefinition extends ElementDefinition { + data: EdgeDataDefinition; + } + + interface EdgeDataDefinition extends ElementDataDefinition { + /** + * the source node id (edge comes from this node) + */ + source: string; + /** + * the target node id (edge goes to this node) + */ + target: string; + } + + interface NodeDefinition extends ElementDefinition { + data: NodeDataDefinition; + } + + interface NodeDataDefinition extends ElementDataDefinition { + parent?: string; + } + + interface CytoscapeOptions { + /////////////////////////////////////// + // very commonly used options: + /** + * A HTML DOM element in which the graph should be rendered. + * This is optional if Cytoscape.js is run headlessly or if you initialise using jQuery (in which case your jQuery object already has an associated DOM element). + * + * The default is undefined. + */ + container?: HTMLElement | null; + + /** + * An array of [[Elements]] specified as plain objects. For convenience, this option can alternatively be specified as a promise that resolves to the elements JSON. + */ + elements?: ElementsDefinition | ElementDefinition[] | Promise | Promise; + /** + * The [[Stylesheet]] used to style the graph. For convenience, this option can alternatively be specified as a promise that resolves to the stylesheet. + */ + style?: Stylesheet[] | Promise; + /** + * A plain object that specifies layout options. + * Which layout is initially run is specified by the name field. + * Refer to a layout's documentation for the options it supports. + * If you want to specify your node positions yourself in your elements JSON, + * you can use the preset layout — by default it does not set any positions, + * leaving your nodes in their current positions + * (e.g. specified in options.elements at initialisation time) + */ + layout?: NullLayoutOptions | RandomLayoutOptions | PresetLayoutOptions | + GridLayoutOptions | CircleLayoutOptions | ConcentricLayoutOptions | + BreadthFirstLayoutOptions | CoseLayoutOptions; + + /////////////////////////////////////// + // initial viewport state: + /** + * The initial zoom level of the graph. + * Make sure to disable viewport manipulation options, such as fit, in your layout so that it is not overridden when the layout is applied. + * You can set options.minZoom and options.maxZoom to set restrictions on the zoom level. + * + * The default value is 1. + */ + zoom?: number; + /** + * The initial panning position of the graph. Make sure to disable viewport manipulation options, such as fit, + * in your layout so that it is not overridden when the layout is applied. + */ + pan?: Position; + + /////////////////////////////////////// + // interaction options?: + /** + * A minimum bound on the zoom level of the graph. The viewport can not be scaled smaller than this zoom level. + * + * The default value is 1e-50. + */ + minZoom?: number; + /** + * A maximum bound on the zoom level of the graph. The viewport can not be scaled larger than this zoom level. + * + * The default value is 1e50. + */ + maxZoom?: number; + /** + * Whether zooming the graph is enabled, both by user events and programmatically. + * + * The default value is true. + */ + zoomingEnabled?: boolean; + /** + * Whether user events (e.g. mouse wheel, pinch-to-zoom) are allowed to zoom the graph. Programmatic changes to zoom are unaffected by this option. + * + * The default value is true. + */ + userZoomingEnabled?: boolean; + /** + * Whether panning the graph is enabled, both by user events and programmatically. + * + * The default value is true. + */ + panningEnabled?: boolean; + /** + * Whether user events (e.g. dragging the graph background) are allowed to pan the graph. Programmatic changes to pan are unaffected by this option. + * + * The default value is true. + */ + userPanningEnabled?: boolean; + /** + * Whether box selection (i.e. drag a box overlay around, and release it to select) is enabled. If enabled, the user must taphold to pan the graph. + * + * The default value is false. + */ + boxSelectionEnabled?: boolean; + /** + * A string indicating the selection behaviour from user input. + * By default, this is set automatically for you based on the type of input device detected. + * On touch devices, 'additive' is default — a new selection made by the user adds to the set of currenly selected elements. + * On mouse-input devices, 'single' is default — a new selection made by the user becomes the entire set of currently selected elements (i.e. the previous elements are unselected). + * + * The default value is (isTouchDevice ? 'additive' : 'single'). + */ + selectionType?: SelectionType; + /** + * A nonnegative integer that indicates the maximum allowable distance that a user may move during a tap gesture, + * on touch devices and desktop devices respectively. + * + * This makes tapping easier for users. + * These values have sane defaults, so it is not advised to change these options unless you have very good reason for doing so. + * Larger values will almost certainly have undesirable consequences. + * + * The default value is is 8. + */ + touchTapThreshold?: number; + /** + * A nonnegative integer that indicates the maximum allowable distance that a user may move during a tap gesture, + * on touch devices and desktop devices respectively. + * + * This makes tapping easier for users. + * These values have sane defaults, + * so it is not advised to change these options unless you have very good reason for doing so. + * Larger values will almost certainly have undesirable consequences. + * + * The default value is 4. + */ + desktopTapThreshold?: number; + /** + * Whether nodes should be locked (not draggable at all) by default (if true, overrides individual node state). + * + * The default value is false. + */ + autolock?: boolean; + /** + * Whether nodes should be ungrabified (not grabbable by user) by default (if true, overrides individual node state). + * + * The default value is false. + */ + autoungrabify?: boolean; + /** + * Whether nodes should be unselectified (immutable selection state) by default (if true, overrides individual element state). + * + * The default value is false. + */ + autounselectify?: boolean; + + /////////////////////////////////////// + // rendering options: + /** + * A convenience option that initialises the Core to run headlessly. + * You do not need to set this in environments that are implicitly headless (e.g. Node.js). + * However, it is handy to set headless: true if you want a headless Core in a browser. + * + * The default value is false. + */ + headless?: boolean; + /** + * A boolean that indicates whether styling should be used. + * For headless (i.e. outside the browser) environments, + * display is not necessary and so neither is styling necessary — thereby speeding up your code. + * You can manually enable styling in headless environments if you require it for a special case. + * Note that it does not make sense to disable style if you plan on rendering the graph. + * + * The default value is true. + */ + styleEnabled?: boolean; + /** + * When set to true, the renderer does not render edges while the viewport is being manipulated. + * This makes panning, zooming, dragging, et cetera more responsive for large graphs. + * + * The default value is false. + */ + hideEdgesOnViewport?: boolean; + /** + * when set to true, the renderer does not render labels while the viewport is being manipulated. + * This makes panning, zooming, dragging, et cetera more responsive for large graphs. + * + * The default value is false. + */ + hideLabelsOnViewport?: boolean; + /** + * When set to true, the renderer uses a texture (if supported) during panning and zooming instead of drawing the elements, + * making large graphs more responsive. + * + * The default value is false. + */ + textureOnViewport?: boolean; + /** + * When set to true, the renderer will use a motion blur effect to make the transition between frames seem smoother. + * This can significantly increase the perceived performance for a large graphs. + * + * The default value is false. + */ + motionBlur?: boolean; + /** + * When motionBlur: true, this value controls the opacity of motion blur frames. + * Higher values make the motion blur effect more pronounced. + * + * The default value is 0.2. + */ + motionBlurOpacity?: number; + /** + * Changes the scroll wheel sensitivity when zooming. This is a multiplicative modifier. + * So, a value between 0 and 1 reduces the sensitivity (zooms slower), and a value greater than 1 increases the sensitivity (zooms faster). + * + * The default value is 1. + */ + wheelSensitivity?: number; + /** + * Overrides the screen pixel ratio with a manually set value (1.0 or 0.666 recommended, if set). + * This can be used to increase performance on high density displays by reducing the effective area that needs to be rendered. + * If you want to use the hardware's actual pixel ratio at the expense of performance, you can set pixelRatio: 'auto'. + * + * The default value is 1. + */ + pixelRatio?: number; + } + + /** + * cy --> Cy.Core + * The core object is your interface to a graph. + * + * It is your entry point to Cytoscape.js: + * All of the library’s features are accessed through this object. + * http://js.cytoscape.org/#core + */ + interface Core extends + CoreGraphManipulation, CoreGraphManipulationExt, + CoreEvents, CoreViewportManipulation, CoreAnimation, + CoreLayout, CoreStyle, CoreExport { } + + /** + * These are the principle functions used to interact with the graph model. + * + * http://js.cytoscape.org/#core/graph-manipulation + */ + interface CoreGraphManipulation { + /** + * Add elements to the graph and return them. + */ + add(eles: ElementDefinition | ElementDefinition[] | Collection): CollectionElements; + + /** + * Remove elements in collecion or match the selector from the graph and return them. + */ + remove(eles: Collection | Selector): CollectionElements; + + /** + * Get a collection from elements in the graph matching the specified selector or from an array of elements. + * If no parameter specified, an empty collection will be returned + */ + collection(eles?: Selector | CollectionElements[]): CollectionElements; + + /** + * Get an element from its ID in a very performant way. + */ + getElementById(id: string): CollectionElements; + + /** + * Get elements in the graph matching the specified selector. + * http://js.cytoscape.org/#cy.$ + */ + $(selector: Selector): CollectionElements; + + /** + * Get elements in the graph matching the specified selector. + * http://js.cytoscape.org/#cy.$ + */ + elements(selector?: Selector): CollectionElements; + + /** + * Get nodes in the graph matching the specified selector. + */ + nodes(selector?: Selector): NodeCollection; + + /** + * Get edges in the graph matching the specified selector. + */ + edges(selector?: Selector): EdgeCollection; + /** + * Get elements in the graph matching the specified selector or filter function. + */ + filter(selector: Selector | ((i: number, ele: Singular) => boolean)): CollectionElements; + + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * http://js.cytoscape.org/#cy.batch + * A callback within which you can make batch updates to elements. + */ + batch(callback: () => void): void; + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * http://js.cytoscape.org/#cy.batch + * + * Starts batching manually (useful for asynchronous cases). + */ + startBatch(): void; + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * http://js.cytoscape.org/#cy.batch + * + * Ends batching manually (useful for asynchronous cases). + */ + endBatch(): void; + + /** + * A convenience function to explicitly destroy the Core. + * http://js.cytoscape.org/#cy.destroy + */ + destroy(): void; + } + + /** + * http://js.cytoscape.org/#core/graph-manipulation + * http://js.cytoscape.org/#extensions + * These functions are intended for use in extensions. + */ + interface CoreGraphManipulationExt { + /** + * Set the scratchpad at a particular namespace, + * where temporary or non-JSON data can be stored. + * App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'. + * + * If no parameter provided, the entire scratchpad will be returned. + * If only namespace provided, the scratchpad with the namespace will be returned. + * + * @param namespace A namespace string. + * @param value The value to set at the specified namespace. + */ + scratch(namespace?: string, value?: any): Scratchpad; + + /** + * Remove scratchpad data. You should remove scratchpad data only at your own namespaces. + * http://js.cytoscape.org/#cy.removeScratch + * + * @param namespace A namespace string. + */ + removeScratch(namespace: string): void; + } + + /** + * The principle events from the graph model. + * http://js.cytoscape.org/#core/events + */ + interface CoreEvents { + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + * @param eventsMap A map of event names to handler functions. + */ + + on(events: EventNames, handler: EventHandler): void; + on(events: EventNames, selector: Selector, handler: EventHandler): void; + on(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + on(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + bind(events: EventNames, handler: EventHandler): void; + bind(events: EventNames, selector: Selector, handler: EventHandler): void; + bind(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + bind(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + listen(events: EventNames, handler: EventHandler): void; + listen(events: EventNames, selector: Selector, handler: EventHandler): void; + listen(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + listen(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + addListener(events: EventNames, handler: EventHandler): void; + addListener(events: EventNames, selector: Selector, handler: EventHandler): void; + addListener(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + addListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + /** + * Get a promise that is resolved with the first + * of any of the specified events triggered on the graph. + * @param events A space separated list of event names. + * @param selector [optional] A selector to specify elements for which the handler is triggered. + */ + promiseOn(events: EventNames, selector?: Selector): Promise; + pon(events: EventNames, selector?: Selector): Promise; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + one(events: EventNames, handler: EventHandler): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + one(events: EventNames, selector: Selector, handler: EventHandler): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + one(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + one(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + /** + * Remove event handlers. + * http://js.cytoscape.org/#cy.off + * + * @param events A space separated list of event names. + * @param selector [optional] The same selector used to bind to the events. + * @param handler [optional] A reference to the handler function to remove. + * @param eventsMap A map of event names to handler functions to remove. + */ + off(events: EventNames, selector?: Selector, handler?: EventHandler): void; + off(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + unbind(events: EventNames, selector?: Selector, handler?: EventHandler): void; + unbind(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + unlisten(events: EventNames, selector?: Selector, handler?: EventHandler): void; + unlisten(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + removeListener(events: EventNames, selector?: Selector, handler?: EventHandler): void; + removeListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + /** + * Trigger one or more events. + * + * @param events A space separated list of event names to trigger. + * @param extraParams [optional] An array of additional parameters to pass to the handler. + */ + trigger(events: EventNames, extraParams?: any[]): void; + emit(events: EventNames, extraParams?: any[]): void; + + /** + * Run a callback as soon as the graph becomes ready. If the graph is already ready, then the callback is called immediately. + * @param fn The callback run as soon as the graph is ready, inside which this refers to the core (cy). + */ + ready(fn: EventHandler): void; + } + + interface ZoomOptions { + /** The zoom level to set. */ + level: number; + /** The position about which to zoom. */ + position: Position; + /** The rendered position about which to zoom. */ + renderedPosition: Position; + } + /** + * http://js.cytoscape.org/#core/viewport-manipulation + */ + interface CoreViewportManipulation { + /** + * Get the HTML DOM element in which the graph is visualised. + * A null value is returned if the Core is headless. + */ + container(): any; + + /** + * Pan the graph to the centre of a collection. + * + * @param eles The collection to centre upon. + */ + center(eles?: Collection): CollectionElements; + + /** + * Pan and zooms the graph to fit to a collection. + * http://js.cytoscape.org/#cy.fit + * + * @param eles [optional] The collection to fit to. + * @param padding [optional] An amount of padding (in pixels) to have around the graph + */ + fit(eles?: Collection, padding?: number): CollectionElements; + + /** + * Reset the graph to the default zoom level and panning position. + * http://js.cytoscape.org/#cy.reset + */ + reset(): CollectionElements; + + /** + * Get the panning position of the graph. + * http://js.cytoscape.org/#cy.pan + */ + pan(): Position; + + /** + * Set the panning position of the graph. + * http://js.cytoscape.org/#cy.pan + * + * @param renderedPosition The rendered position to pan the graph to. + */ + pan(renderedPosition?: Position): void; + + /** + * Relatively pan the graph by a specified rendered position vector. + * http://js.cytoscape.org/#cy.panBy + * + * @param renderedPosition The rendered position vector to pan the graph by. + */ + panBy(renderedPosition: Position): void; + + /** + * Get whether panning is enabled. + * If cy.boxSelectionEnabled() === true, then the user + * must taphold to initiate panning. + * http://js.cytoscape.org/#cy.panningEnabled + */ + panningEnabled(): boolean; + + /** + * Set whether panning is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * http://js.cytoscape.org/#cy.panningEnabled + * + * @param bool A truthy value enables panning; a falsey value disables it. + */ + panningEnabled(bool: boolean): void; + + /** + * Get whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * http://js.cytoscape.org/#cy.userPanningEnabled + */ + userPanningEnabled(): boolean; + + /** + * Set whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * http://js.cytoscape.org/#cy.userPanningEnabled + * + * @param bool A truthy value enables user panning; a falsey value disables it. + */ + userPanningEnabled(bool: boolean): void; + /** + * Get the zoom level. + * http://js.cytoscape.org/#cy.zoom + */ + zoom(): number; + /** + * Set the zoom level. + * http://js.cytoscape.org/#cy.zoom + * + * @param level The zoom level to set. + * @param options The options for zooming. + */ + zoom(level?: number | ZoomOptions): void; + + /** + * Set or get whether zooming is enabled. Get if no parameter provided. + * http://js.cytoscape.org/#cy.zoomingEnabled + * + * @param bool A truthy value enables zooming; a falsey value disables it. + */ + zoomingEnabled(bool?: boolean): void; + + /** + * Get whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) + * is enabled. + * http://js.cytoscape.org/#cy.userZoomingEnabled + */ + userZoomingEnabled(): boolean; + /** + * Get or set whether zooming by user events get if no parameter provided + * (e.g. mouse wheel, pinch-to-zoom) is enabled. + * http://js.cytoscape.org/#cy.userZoomingEnabled + * + * @param bool A truthy value enables user zooming; a falsey value disables it. + */ + userZoomingEnabled(bool?: boolean): void; + + /** + * Get the minimum zoom level. + * http://js.cytoscape.org/#cy.minZoom + */ + minZoom(): number; + /** + * Set the minimum zoom level. + * http://js.cytoscape.org/#cy.minZoom + * + * @param zoom The new minimum zoom level to use. + */ + minZoom(zoom: number): void; + + /** + * Get the maximum zoom level. + * http://js.cytoscape.org/#cy.maxZoom + */ + maxZoom(): number; + /** + * Set the maximum zoom level. + * http://js.cytoscape.org/#cy.maxZoom + * + * @param zoom The new maximum zoom level to use. + */ + maxZoom(zoom: number): void; + + /** + * Set the viewport state (pan & zoom) in one call. + * http://js.cytoscape.org/#cy.viewport + * + * @param zoom The zoom level to set. + * @param pan The pan to set (a rendered position). + */ + viewport(zoom: number, pan: Position): void; + + /** + * Get whether box selection is enabled. + * If enabled, the user must hold left-click to initiate panning. + * http://js.cytoscape.org/#cy.boxSelectionEnabled + */ + boxSelectionEnabled(): boolean; + /** + * Set whether box selection is enabled. + * If enabled, the user must hold left-click to initiate panning. + * http://js.cytoscape.org/#cy.boxSelectionEnabled + * + * @param bool A truthy value enables box selection; a falsey value disables it. + */ + boxSelectionEnabled(bool: boolean): void; + + /** + * Get the on-screen width of the viewport in pixels. + * http://js.cytoscape.org/#cy.width + */ + width(): number; + + /** + * Get the on-screen height of the viewport in pixels. + * http://js.cytoscape.org/#cy.height + */ + height(): number; + + /** + * Get the extent of the viewport, a bounding box in model + * coordinates that lets you know what model + * positions are visible in the viewport. + * http://js.cytoscape.org/#cy.extent + */ + extent(): { + x1: number, y1: number, x2: number, y2: number, w: number, h: number + }; + + /** + * Get whether nodes are automatically locked + * (i.e. if true, nodes are locked despite their individual state). + * http://js.cytoscape.org/#cy.autolock + */ + autolock(): boolean; + /** + * Set whether nodes are automatically locked + * (i.e. if true, nodes are locked despite their individual state). + * http://js.cytoscape.org/#cy.autolock + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autolock(bool: boolean): void; + + /** + * Get whether nodes are automatically ungrabified + * (i.e. if true, nodes are ungrabbale despite their individual state). + * http://js.cytoscape.org/#cy.autoungrabify + */ + autoungrabify(): boolean; + /** + * Set whether nodes are automatically ungrabified + * (i.e. if true, nodes are ungrabbale despite their individual state). + * http://js.cytoscape.org/#cy.autoungrabify + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autoungrabify(bool: boolean): void; + + /** + * Get whether nodes are automatically unselectified + * (i.e. if true, nodes are unselectable despite their individual state). + * http://js.cytoscape.org/#cy.autounselectify + */ + autounselectify(): boolean; + /** + * Set whether nodes are automatically unselectified + * (i.e. if true, nodes are unselectable despite their individual state). + * http://js.cytoscape.org/#cy.autounselectify + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autounselectify(bool: boolean): void; + + /** + * Force the renderer to redraw (i.e. draw a new frame). + * + * This function forces the renderer to draw a new frame. + * It is useful for very specific edgecases, such as in certain UI plugins, + * but it should not be needed for most developers. + * http://js.cytoscape.org/#cy.forceRender + */ + forceRender(): void; + + /** + * Force the renderer to recalculate the viewport bounds. + * + * If your code resizes the graph's dimensions or position + * (i.e. by changing the style of the HTML DOM element that holds the graph), + * you will want to call cy.resize() to have the graph resize and redraw itself. + * + * Cytoscape.js can not automatically monitor the bounding box of the viewport, + * as querying the DOM for those dimensions can be expensive. + * Although cy.resize() is automatically called for you on the window's resize event, + * there is no resize or style event for arbitrary DOM elements. + * http://js.cytoscape.org/#cy.resize + */ + resize(): CollectionElements; + } + + /** + * http://js.cytoscape.org/#core/animation + * + */ + interface AnimationFitOptions { + eles: CollectionElements | Selector; // to which the viewport will be fitted. + padding: number; // Padding to use with the fitting. + } + interface CenterOptions { + eles: CollectionElements | Selector; // to which the viewport will be selected. + } + interface AnimateOptionsCommon { + /** A zoom level to which the graph will be animated. */ + zoom?: number; + /** A panning position to which the graph will be animated. */ + pan?: Position; + /** A relative panning position to which the graph will be animated. */ + panBy?: Position; + /** An object containing fitting options from which the graph will be animated. */ + fit?: AnimationFitOptions; + /** An object containing centring options from which the graph will be animated. */ + center?: CenterOptions; + + /** duration - The duration of the animation in milliseconds. */ + duration?: number; + } + interface AnimateOptions extends AnimateOptionsCommon { + /** queue - A boolean indicating whether to queue the animation. */ + queue?: boolean; + /** complete - A function to call when the animation is done. */ + complete?(): void; + /** step - A function to call each time the animation steps. */ + step(): void; + } + interface AnimationOptions extends AnimateOptionsCommon { + /** queue - A transition-timing-function easing style string that shapes the animation progress curve. */ + easing?: boolean; + /** complete - A function to call when the animation is done. */ + complete?(): void; + /** step - A function to call each time the animation steps. */ + step?(): void; + } + + interface CoreAnimation { + /** + * Get whether the viewport is currently being animated. + * http://js.cytoscape.org/#cy.animated + */ + animated(): boolean; + + /** + * Animate the viewport. + * http://js.cytoscape.org/#cy.animate + * + * @param anis An object containing the details of the animation. + * + * @param options An object containing animation options. + */ + animate(anis: AnimateOptions, options?: AnimateOptions): Core; + + /** + * Get an animation of the viewport. + * http://js.cytoscape.org/#cy.animation + */ + animation(options: AnimationOptions): any; + + /** + * Add a delay between animations for the viewport. + * + * @param duration How long the delay should be in milliseconds. + * @param complete A function to call when the delay is complete. + */ + delay(duration: number, complete?: () => void): Core; + + /** + * Get a delay animation of the viewport. + * http://js.cytoscape.org/#cy.delayAnimation + */ + delayAnimation(duration: number): void; + + /** + * Stop all viewport animations that are currently running. + * http://js.cytoscape.org/#cy.stop + * + * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. + * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): Core; + + /** + * Remove all queued animations for the viewport. + * http://js.cytoscape.org/#cy.clearQueue + */ + clearQueue(): Core; + } + + /** + * http://js.cytoscape.org/#core/layout + */ + interface CoreLayout { + /** + * Run a layout, which algorithmically positions the nodes in the graph. + * For layouts included with Cytoscape.js, you can find their + * options documented in the Layouts section. + * For external layouts, please refer to their accompanying documentation. + * + * An analogue to run a layout on a subset of the graph exists as eles.layout(). + * http://js.cytoscape.org/#cy.layout + */ + layout(layout: LayoutOptions): void; + /** + * Get a new layout, which can be used to algorithmically + * position the nodes in the graph. + * + * You must specify options.name with the name of the layout you wish to use. + * + * This function creates and returns a layout object. + * You may want to keep a reference to the layout for more advanced usecases, + * such as running multiple layouts simultaneously. + * Note that you must call layout.run() in order for it to affect the graph. + * An analogue to make a layout on a subset of the graph exists as eles.makeLayout(). + */ + makeLayout(options: LayoutOptions): void; + } + + /** + * Get the entry point to modify the visual style of the graph after initialisation. + * http://js.cytoscape.org/#core/style + */ + interface ElementStylesheet extends StylesheetStyle { + json(): any; + } + + interface CoreStyle { + /** + * Get the current style object. + */ + style(): ElementStylesheet | string; + /** + * Assign a new stylesheet to replace the existing one. + */ + style(sheet: Stylesheet): Stylesheet; + } + + /** + * http://js.cytoscape.org/#cy.style + */ + type Stylesheet = StylesheetStyle | StylesheetCSS; + + interface StylesheetStyle { + selector: string; + style: Css.Node | Css.Edge; + } + + /** + * http://js.cytoscape.org/#cy.style + */ + interface StylesheetCSS { + selector: string; + css: Css.Node | Css.Edge; + } + + /** + * http://js.cytoscape.org/#core/export + */ + interface ExportOptions { + /** + * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. + */ + output?: "base64uri" | "base64" | "blob"; + /** + * The background colour of the image (transparent by default). + */ + bg?: string; + /** + * Whether to export the current viewport view (false, default) or the entire graph (true). + */ + full?: boolean; + /** + * This value specifies a positive number that scales the size of the resultant image. + */ + scale?: number; + /** + * Specifies the scale automatically in combination with maxHeight such that the resultant image is no wider than maxWidth. + */ + maxWidth?: number; + /** + * Specifies the scale automatically in combination with maxWidth such that the resultant image is no taller than maxHeight. + */ + maxHeight?: number; + } + + interface ExportJpgOptions extends ExportOptions { + /** + * quality Specifies the quality of the image from 0 + * (low quality, low filesize) to 1 (high quality, high filesize). + * If not set, the browser's default quality value is used. + */ + quality?: number; + } + + interface CoreExport { + /** + * Export the current graph view as a PNG image in Base64 representation. + */ + png(options?: ExportOptions): string; + + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpg(options?: ExportOptions): string; + + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpeg(options?: ExportOptions): string; + + /** + * Export the graph as JSON, the same format used at initialisation. + */ + json(): string; + } + + /** + * eles --> Cy.Collection + * a collection of one or more elements (nodes and edges) + * + * The input can be any element (node and edge) collection. + * http://js.cytoscape.org/#collection + */ + interface Collection extends Singular, + CollectionGraphManipulation, CollectionEvents, + CollectionData, CollectionPosition, + CollectionLayout, + CollectionSelection, CollectionStyle, CollectionAnimation, + CollectionComparision, CollectionIteration, + CollectionBuildingUnion, CollectionAlgorithms { } + + /** + * ele --> Cy.Singular + * a collection of a single element (node or edge) + */ + interface Singular extends + SingularGraphManipulation, + SingularData, SingularPosition, + SingularSelection, SingularStyle, SingularAnimation { } + + interface ElementsDefinition { + nodes: NodeDefinition[]; + edges: EdgeDefinition[]; + } + + type EventHandler = (event: EventObject) => void; + + /** + * The output is a collection of node and edge elements OR single element. + */ + interface CollectionElements extends + EdgeCollection, NodeCollection, SingularElement { } + + /** + * edges -> Cy.EdgeCollection + * a collection of one or more edges + * + * The output is a collection of edge elements OR single edge. + */ + interface EdgeCollection extends Collection, EdgeSingular, + EdgeCollectionTraversing { } + /** + * nodes -> Cy.NodeCollection + * a collection of one or more nodes + * + * The output is a collection of node elements OR single node. + */ + interface NodeCollection extends Collection, NodeSingular, + NodeCollectionMetadata, NodeCollectionPosition, NodeCollectionTraversing, + NodeCollectionCompound { } + + interface SingularElement extends EdgeSingular, NodeSingular { + // Intentionally empty. + } + /** + * edge --> Cy.EdgeSingular + * a collection of a single edge + */ + interface EdgeSingular extends Singular, + EdgeSingularData, EdgeSingularTraversing { } + + /** + * node --> Cy.NodeSingular + * a collection of a single node + */ + interface NodeSingular extends Singular, + NodeSingularMetadata, NodeSingularPosition, NodeSingularCompound { } + + /** + * http://js.cytoscape.org/#collection/graph-manipulation + */ + interface CollectionGraphManipulation { + /** + * Remove the elements from the graph. + * http://js.cytoscape.org/#eles.remove + */ + remove(): CollectionElements; + + /** + * Put removed elements back into the graph. + * http://js.cytoscape.org/#eles.restore + */ + restore(): CollectionElements; + + /** + * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. + * http://js.cytoscape.org/#eles.clone + */ + clone(): CollectionElements; + /** + * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. + * http://js.cytoscape.org/#eles.clone + */ + copy(): CollectionElements; + + /** + * Effectively move edges to different nodes. The modified (actually new) elements are returned. + * http://js.cytoscape.org/#eles.move + */ + move(location: { source?: string, target?: string }): EdgeCollection; + /** + * Effectively move nodes to different parent node. The modified (actually new) elements are returned. + * http://js.cytoscape.org/#eles.move + */ + move(location: { parent: string }): NodeCollection; + } + + /** + * http://js.cytoscape.org/#collection/graph-manipulation + */ + interface SingularGraphManipulation { + /** + * Get whether the element has been removed from the graph. + * http://js.cytoscape.org/#ele.removed + */ + removed(): boolean; + /** + * Get whether the element is inside the graph (i.e. not removed). + * http://js.cytoscape.org/#ele.inside + */ + inside(): boolean; + } + + /** + * http://js.cytoscape.org/#collection/events + */ + interface CollectionEvents { + /** + * http://js.cytoscape.org/#eles.on + */ + on(events: EventNames, selector: string, data: any, handler: EventHandler): void; + on(events: EventNames, selector: string, handler: EventHandler): void; + on(events: EventNames, handler: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.promiseOn + * alias: pon + */ + promiseOn(events: EventNames, selector?: string): Promise; + pon(events: EventNames, selector?: string): Promise; + + /** + * @param events A space separated list of event names. + * @param selector [optional] A delegate selector to specify child elements for which the handler is triggered. + * @param data [optional] A plain object which is passed to the handler in the event object argument. + * @param function(event) The handler function that is called when one of the specified events occurs. + * @param event The event object. + * http://js.cytoscape.org/#eles.one + */ + one(events: EventNames, selector: string, data: any, handler: EventHandler): void; + one(events: EventNames, selector: string, handler: EventHandler): void; + one(events: EventNames, handler: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.once + */ + once(events: EventNames, selector: string, data: any, handler: EventHandler): void; + once(events: EventNames, selector: string, handler: EventHandler): void; + once(events: EventNames, handler: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.off + * alias unbind, unlisten, removeListener + */ + off(events: EventNames, selector?: string, handler?: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.trigger + * alias: emit + */ + trigger(events: EventNames, extra?: string[]): void; + } + + /** + * http://js.cytoscape.org/#collection/data + * + * The following fields are immutable: + * id: The id field is used to uniquely identify an element in the graph. + * source & target : These fields define an edge's relationship to nodes, and this relationship can not be changed after creation. + * parent: The parent field defines the parent (compound) node. + */ + interface CollectionData { + /** + * Remove developer-defined data associated with the elements. + * http://js.cytoscape.org/#eles.removeData + * @param names A space-separated list of fields to delete. + */ + removeData(names?: string): CollectionElements; + removeAttr(names?: string): CollectionElements; + + /** + * Get an array of the plain JavaScript object + * representation of all elements in the collection. + */ + jsons(): string[]; + } + /** + * http://js.cytoscape.org/#collection/data + */ + interface SingularData { + /** + * Read and write developer-defined data associated with the elements + * http://js.cytoscape.org/#eles.data + */ + + /** + * Get a particular data field for the element. + * @param name The name of the field to get. + */ + data(name?: string): any; + /** + * Set a particular data field for the element. + * @param name The name of the field to set. + * @param value The value to set for the field. + */ + data(name: string, value: any): void; + /** + * Update multiple data fields at once via an object. + * @param obj The object containing name- value pairs to update data fields. + */ + data(obj: any): void; + + /** + * Get or set the scratchpad at a particular namespace, + * where temporary or non-JSON data can be stored. + * Get scratchpad if one or no parameter provided. + * App-level scratchpad data should use namespaces + * prefixed with underscore, like '_foo'. + * http://js.cytoscape.org/#ele.scratch + * @param namespace A namespace string. + * @param value The value to set at the specified namespace. + */ + scratch(namespace?: string, value?: any): Scratchpad; + + /** + * Remove scratchpad data. + * You should remove scratchpad data only at your own namespaces. + * http://js.cytoscape.org/#ele.removeScratch + * @param namespace A namespace string. + */ + removeScratch(namespace: string): void; + + /** + * A shortcut to get the ID of an element. + * http://js.cytoscape.org/#ele.id + */ + id(): string; + + /** + * Get the element's plain JavaScript object representation. + * http://js.cytoscape.org/#ele.json + */ + json(): string; + + /** + * Get the group string that defines the type of the element. + * + * The group strings are 'nodes' for nodes and 'edges' for edges. + * In general, you should be using ele.isEdge() + * and ele.isNode() instead of ele.group(). + * http://js.cytoscape.org/#ele.group + */ + group(): ElementGroup; + + /** + * Get whether the element is a node. + * http://js.cytoscape.org/#ele.isNode + */ + isNode(): boolean; + + /** + * Get whether the element is an edge. + * http://js.cytoscape.org/#ele.isEdge + */ + isEdge(): boolean; + } + /** + * http://js.cytoscape.org/#collection/data + */ + interface EdgeSingularData { + /** + * Get whether the edge is a loop (i.e. source same as target). + * http://js.cytoscape.org/#edge.isLoop + */ + isLoop(): boolean; + + /** + * Get whether the edge is simple (i.e. source different than target). + * http://js.cytoscape.org/#edge.isSimple + */ + isSimple(): boolean; + } + + /** + * http://js.cytoscape.org/#collection/metadata + */ + interface NodeSingularMetadata { + /** + * Get the degree of a node. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + degree(includeLoops: boolean): number; + /** + * Get the indegree of a node. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + indegree(includeLoops: boolean): number; + /** + * Get the outdegree of a node. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + outdegree(includeLoops: boolean): number; + } + + /** + * http://js.cytoscape.org/#collection/metadata + */ + interface NodeCollectionMetadata { + /** + * Get the total degree of a collection of nodes. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + totalDegree(includeLoops: boolean): number; + + /** + * Get the minimum degree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minDegree(includeLoops: boolean): number; + + /** + * Get the maximum degree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxDegree(includeLoops: boolean): number; + + /** + * Get the minimum indegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minIndegree(includeLoops: boolean): number; + + /** + * Get the maximum indegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxIndegree(includeLoops: boolean): number; + + /** + * Get the minimum outdegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minOutdegree(includeLoops: boolean): number; + + /** + * Get the maximum outdegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxOutdegree(includeLoops: boolean): number; + } + + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface NodeSingularPosition { + /** + * Get the (model) position of a node. + */ + position(): Position; + /** + * Set the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + position(dimension: PositionDimension, value?: Position): void; + /** + * Set the position using name-value pairs in the specified object. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + position(pos: Position): void; + + /** + * Get or set the rendered (on-screen) position of a node. + * http://js.cytoscape.org/#node.renderedPosition + */ + /** + * Get the value of a specified rendered position dimension. + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + renderedPosition(dimension?: PositionDimension): Position; + renderedPosition(dimension: PositionDimension, value: Position): void; + renderedPosition(pos: { [name: string]: number }): void; + + /** + * Set the value of a specified rendered position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + renderedPoint(dimension?: PositionDimension): Position; + renderedPoint(dimension: PositionDimension, value: Position): void; + renderedPoint(pos: { [name: string]: number }): void; + + /** + * + * http://js.cytoscape.org/#node.relativePosition + */ + /** + * Get the value of a specified relative position dimension. + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + relativePosition(dimension?: PositionDimension): Position; + relativePosition(dimension: PositionDimension, value: Position): void; + relativePosition(pos: { [name: string]: number }): void; + + /** + * Get the value of a specified relative position dimension. + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + relativePoint(dimension?: PositionDimension): Position; + relativePoint(dimension: PositionDimension, value: Position): void; + relativePoint(pos: { [name: string]: number }): void; + + /** + * Get whether a node is currently grabbed, meaning the user has hold of the node. + * http://js.cytoscape.org/#node.grabbed + */ + grabbed(): boolean; + /** + * Get whether the user can grab a node. + * http://js.cytoscape.org/#node.grabbable + */ + grabbable(): boolean; + /** + * Get whether a node is locked, meaning that its position can not be changed. + * http://js.cytoscape.org/#node.locked + */ + locked(): boolean; + } + + /** + * @param ele The element being iterated over for which the function should return a position to set. + * @param ix The index of the element when iterating over the elements in the collection. + */ + type ElementPositionFunction = (ele: CollectionElements, ix: number) => void; + type ElementCollectionFunction = (ele: CollectionElements, ix: number, eles: CollectionElements) => void; + + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface NodeCollectionPosition { + /** + * Set the positions via a function. + * @param handler A callback function that returns the position to set for each element. + * @param pos An object specifying name-value pairs representing dimensions to set. + * http://js.cytoscape.org/#nodes.positions + */ + positions(handler: ElementPositionFunction | Position): void; + + modelPositions(handler: ElementPositionFunction | Position): void; + + points(handler: ElementPositionFunction | Position): void; + + /** + * Allow the user to grab the nodes. + * http://js.cytoscape.org/#nodes.grabify + */ + grabify(): void; + /** + * Disallow the user to grab the nodes. + * http://js.cytoscape.org/#nodes.ungrabify + */ + ungrabify(): void; + /** + * Lock the nodes such that their positions can not be changed. + * http://js.cytoscape.org/#nodes.lock + */ + lock(): void; + /** + * Unlock the nodes such that their positions can be changed. + * http://js.cytoscape.org/#nodes.unlock + */ + unlock(): void; + } + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface SingularPosition { + /** + * Get the width of the element. + */ + width(): number; + /** + * Get the outer width of the element (includes width, padding, & border). + */ + outerWidth(): number; + + /** + * Get the width of the element in rendered dimensions. + */ + renderedWidth(): number; + + /** + * Get the outer width of the element (includes width, padding, & border) in rendered dimensions. + */ + renderedOuterWidth(): number; + + /** + * Get the height of the element. + */ + height(): number; + /** + * Get the outer height of the element (includes height, padding, & border). + */ + outerHeight(): number; + /** + * Get the height of the element in rendered dimensions. + */ + renderedHeight(): number; + + /** + * Get the outer height of the element (includes height, padding, & border) in rendered dimensions. + */ + renderedOuterHeight(): number; + /** + * Gets whether the element is active (e.g. on user tap, grab, etc). + * http://js.cytoscape.org/#ele.active + */ + active(): boolean; + } + + interface BoundingBoxOptions { + /** A boolean indicating whether to include nodes in the bounding box (default true). */ + includeNodes?: boolean; + /** A boolean indicating whether to include edges in the bounding box (default true). */ + includeEdges?: boolean; + /** A boolean indicating whether to include labels in the bounding box (default true). */ + includeLabels?: boolean; + } + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface CollectionPosition { + /** + * Get the bounding box of the elements in model coordinates. + * @param options An object containing options for the function. + * http://js.cytoscape.org/#eles.boundingBox + */ + boundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + /** + * Get the bounding box of the elements in rendered coordinates. + * @param options An object containing options for the function. + */ + renderedBoundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + } + + /** + * http://js.cytoscape.org/#collection/layout + */ + interface CollectionLayout { + /** + * Get a new layout, which can be used to algorithmically position the nodes in the collection. + * This function is useful for running a layout on a subset of the elements in the graph, perhaps in parallel to other layouts. + * + * You must specify options.name with the name of the layout you wish to use. + * + * Note: that you must call layout.run() in order for it to affect the graph. + * + * @param options The layout options. + */ + layout(options: LayoutOptions): CollectionElements; + makeLayout(options: LayoutOptions): CoreLayout; + createLayout(options: LayoutOptions): CoreLayout; + } + + /** + * http://js.cytoscape.org/#collection/layout + */ + interface LayoutPositionOptions { + // whether to animate changes to the layout + animate?: boolean; + // duration of animation in ms, if enabled + animationDuration?: number; + // easing of animation, if enabled + animationEasing?: number; + // collection of elements involved in the layout; set by cy.layout() or eles.layout() + eles: CollectionElements; + // whether to fit the viewport to the graph + fit?: boolean; + // padding to leave between graph and viewport + padding?: number; + // pan the graph to the provided position, given as { x, y } + pan?: Position; + // callback for the layoutready event + ready?: undefined; + // callback for the layoutstop event + stop?: undefined; + // a positive value which adjusts spacing between nodes (>1 means greater than usual spacing) + spacingFactor?: number; + // zoom level as a positive number to set after animation + zoom?: number; + } + interface NodeCollectionLayout { + /** + * Position the nodes for a discrete/synchronous layout. + * http://js.cytoscape.org/#nodes.layoutPositions + * @param layout The layout. + * @param options The layout options object. + */ + layoutPositions(layout: string, options: LayoutPositionOptions, handler: ElementPositionFunction): void; + } + /** + * http://js.cytoscape.org/#collection/layout + */ + interface LayoutDimensionOptions { + // Boolean which changes whether label dimensions are included when calculating node dimensions + nodeDimensionsIncludeLabels: boolean; + } + interface NodeSingularLayout { + /** + * Returns the node width and height. + * Meant for use in layout positioning to do overlap detection. + * @param options The layout options object. + */ + layoutDimensions(options: LayoutDimensionOptions): { x: number; y: number }; + } + + /** + * http://js.cytoscape.org/#collection/selection + */ + interface SingularSelection { + /** + * Get whether the element is selected. + * http://js.cytoscape.org/#ele.selected + */ + selected(): boolean; + + /** + * Get whether the element's selection state is mutable. + * http://js.cytoscape.org/#ele.selectable + */ + selectable(): boolean; + } + /** + * http://js.cytoscape.org/#collection/layout + */ + interface CollectionSelection { + /** + * Make the elements selected (NB other elements outside the collection are not affected). + * http://js.cytoscape.org/#eles.select + */ + select(): void; + /** + * Make the elements not selected (NB other elements outside the collection are not affected). + * http://js.cytoscape.org/#eles.unselect + */ + unselect(): void; + deselect(): void; + /** + * Make the selection states of the elements mutable. + * http://js.cytoscape.org/#eles.selectify + */ + selectify(): void; + /** + * Make the selection states of the elements immutable. + * http://js.cytoscape.org/#eles.unselectify + */ + unselectify(): void; + } + + /** + * http://js.cytoscape.org/#collection/style + */ + type ClassName = string; + /** A space-separated list of class names */ + type ClassNames = string; + + interface CollectionStyle { + /** + * Add classes to elements. + * http://js.cytoscape.org/#eles.addClass + * @param classes A space-separated list of class names to add to the elements. + */ + addClass(classes: ClassNames): void; + /** + * Remove classes from elements. + * @param classes A space-separated list of class names to remove from the elements. + * http://js.cytoscape.org/#eles.removeClass + */ + removeClass(classes: ClassNames): void; + /** + * Toggle whether the elements have the specified classes. + * @param classes A space-separated list of class names to toggle on the elements. + * @param toggle [optional] Instead of automatically toggling, adds the classes on truthy values or removes them on falsey values. + * http://js.cytoscape.org/#eles.toggleClass + */ + toggleClass(classes: ClassNames, toggle?: boolean): void; + /** + * Replace the current list of classes on the elements with the specified list. + * @param classes A space-separated list of class names that replaces the current class list. + * http://js.cytoscape.org/#eles.classes + * Note: can be used to clear all classes (no arguments). + */ + classes(classes?: ClassNames): void; + /** + * Add classes to the elements, and then remove the classes after a specified duration. + * @param classes A space-separated list of class names to flash on the elements. + * @param duration [optional] The duration in milliseconds that the classes should be added on the elements. After the duration, the classes are removed. + * http://js.cytoscape.org/#eles.flashClass + */ + flashClass(classes: ClassNames, duration?: number): void; + + /** + * Get or set a particular style property value. + * @param name The name of the visual style property to get. + * @param value The value to which the property is set. + */ + style(name?: string, value?: any): any; + } + + /** + * http://js.cytoscape.org/#collection/style + */ + interface SingularStyle { + /** + * Get whether an element has a particular class. + * @param className The name of the class to test for. + * http://js.cytoscape.org/#ele.hasClass + */ + hasClass(className: ClassName): boolean; + + /** + * Get a name-value pair object containing rendered visual + * style properties and their values for the element. + * @param name The name of the visual style property to get. + */ + renderedStyle(): { [name: string]: any }; + renderedStyle(name: string): any; + + renderedCss(): { [name: string]: any }; + renderedCss(name: string): any; + + /** + * Get the numeric value of a style property in + * preferred units that can be used for calculations. + * @param name The name of the style property to get. + * http://js.cytoscape.org/#ele.numericStyle + */ + numericStyle(name: string): any; + + /** + * Get the units that ele.numericStyle() is expressed in, for a particular property. + * @param name The name of the style property to get. + * http://js.cytoscape.org/#ele.numericStyleUnits + */ + numericStyleUnits(name: string): any; + /** + * Get whether the element is visible. + * http://js.cytoscape.org/#ele.visible + */ + visible(): boolean; + /** + * Get whether the element is hidden. + * http://js.cytoscape.org/#ele.visible + */ + hidden(): boolean; + /** + * Get the effective opacity of the element + * (i.e. on-screen opacity), + * which takes into consideration parent node opacity. + * http://js.cytoscape.org/#ele.effectiveOpacity + */ + effectiveOpacity(): number; + /** + * Get whether the element's effective opacity is completely transparent, + * which takes into consideration parent node opacity. + * http://js.cytoscape.org/#ele.transparent + */ + transparent(): number; + } + + /** + * http://js.cytoscape.org/#collection/animation + */ + interface ElementAnimateOptionsBase { + /** An object containing name-value pairs of style properties to animate. */ + style?: { [name: string]: any }; + /** The duration of the animation in milliseconds. */ + duration?: number; + /** A boolean indicating whether to queue the animation. */ + queue?: boolean; + /** A function to call when the animation is done. */ + complete?(): void; + /** A function to call each time the animation steps. */ + step?(): void; + /** A transition-timing-function easing style string that shapes the animation progress curve. */ + easing?(): void; + } + interface ElementAnimateOptionPos { + /** A position to which the elements will be animated. */ + position?: Position; + /** A rendered position to which the elements will be animated. */ + renderedPosition?: Position; + } + interface ElementAnimateOptionRen { + /** A position to which the elements will be animated. */ + position?: Position; + /** A rendered position to which the elements will be animated. */ + renderedPosition?: Position; + } + interface CollectionAnimation { + /** + * Animate the elements. + * @param options An object containing the details of the animation. + * http://js.cytoscape.org/#eles.animate + */ + animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen): void; + /** + * Add a delay between animations for the elements. + * @param duration How long the delay should be in milliseconds. + * @param complete A function to call when the delay is complete. + * http://js.cytoscape.org/#eles.delay + */ + delay(duration: number, complete: () => void): void; + /** + * Stop all animations that are currently running. + * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. + * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. + * http://js.cytoscape.org/#eles.stop + */ + stop(clearQueue: boolean, jumpToEnd: boolean): void; + /** + * Remove all queued animations for the elements. + * http://js.cytoscape.org/#eles.clearQueue + */ + clearQueue(): void; + } + interface SingularAnimationOptions { + /** A position to which the elements will be animated. */ + position: Position; + /** A rendered position to which the elements will be animated. */ + renderedPosition: Position; + /** An object containing name-value pairs of style properties to animate. */ + style: any; + /** The duration of the animation in milliseconds. */ + duration: number; + /** A transition-timing-function easing style string that shapes the animation progress curve. */ + easing(): void; + } + interface SingularAnimation { + /** + * Get whether the element is currently being animated. + */ + animated(): boolean; + /** + * Get an animation for the element. + * @param options An object containing the details of the animation. + */ + animation(options: SingularAnimationOptions): void; + + /** + * Get a delay animation for the element. + * @param duration How long the delay should be in milliseconds. + * http://js.cytoscape.org/#ele.delayAnimation + */ + delayAnimation(duration: number): void; + } + + /** + * http://js.cytoscape.org/#collection/comparison + */ + interface CollectionComparision { + // http://js.cytoscape.org/#collection/comparison + + /** + * Determine whether this collection contains exactly the same elements as another collection. + * + * @param eles The other elements to compare to. + */ + same(eles: Collection): boolean; + + /** + * Determine whether this collection contains any of the same elements as another collection. + * + * @param eles The other elements to compare to. + */ + anySame(eles: Collection): boolean; + + /** + * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. + * + * @param eles The other elements to compare to. + */ + allAreNeighbors(eles: Collection): boolean; + /** + * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. + * + * @param eles The other elements to compare to. + */ + allAreNeighbours(eles: Collection): boolean; + + /** + * Determine whether any element in this collection matches a selector. + * + * @param selector The selector to match against. + */ + is(selector: Selector): boolean; + + /** + * Determine whether all elements in the collection match a selector. + * @param selector The selector to match against. + */ + allAre(selector: Selector): boolean; + + /** + * Determine whether any element in this collection satisfies the specified test function. + * + * @param test The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being tested. + * @param thisArg [optional] The value for this within the test function. + */ + some(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + + /** + * Determine whether all elements in this collection satisfy the specified test function. + * + * @param test The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being tested. + * @param thisArg [optional] The value for this within the test function. + */ + every(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + } + + /** + * http://js.cytoscape.org/#collection/iteration + */ + interface CollectionIteration { + /** + * Get the number of elements in the collection. + */ + size(): number; + /** + * Get the number of elements in the collection. + */ + length: number; + + /** + * Get whether the collection is empty, meaning it has no elements. + */ + empty(): boolean; + /** + * Get whether the collection is nonempty, meaning it has elements. + */ + nonempty(): boolean; + + /** + * Iterate over the elements in the collection using an implementation like the native array function namesake. + * + * This function behaves like Array.prototype.forEach() with minor changes for convenience: + * You can exit the iteration early by returning false in the iterating function. + * The Array.prototype.forEach() implementation does not support this, but it is included anyway on account of its utility. + * + * @param each The function executed each iteration. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being iterated. + * @param thisArg [optional] The value for this within the iterating function. + */ + each(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void | boolean, thisArg?: any): void; + forEach(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void | boolean, thisArg?: any): void; + + /** + * Get an element at a particular index in the collection. + * + * You may use eles[i] in place of eles.eq(i) as a more performant alternative. + * + * @param index The index of the element to get. + */ + eq(index: number): CollectionElements; + /** + * Get an element at a particular index in the collection. + * + * @param index The index of the element to get. + */ + [index: number]: CollectionElements; + /** + * Get the first element in the collection. + */ + first(): CollectionElements; + /** + * Get the last element in the collection. + */ + last(): CollectionElements; + + /** + * Get a subset of the elements in the collection based on specified indices. + * + * @param start [optional] An integer that specifies where to start the selection. + * The first element has an index of 0. + * Use negative numbers to select from the end of an array. + * @param end [optional] An integer that specifies where to end the selection. + * If omitted, all elements from the start position and to the end of the array will be selected. + * Use negative numbers to select from the end of an array. + */ + slice(start?: number, end?: number): CollectionElements; + } + + /** + * http://js.cytoscape.org/#collection/building--filtering + */ + /** + * Get a new collection, resulting from adding the collection with another one + * + * @param eles The elements or array of elements to add or elements in the graph matching the selector. + * http://js.cytoscape.org/#eles.union + */ + type CollectionBuildingUnionFunc = (eles: Collection | Collection[] | Selector) => CollectionElements; + + /** + * Get a new collection, resulting from the collection without some specified elements. + * http://js.cytoscape.org/#eles.difference + * @param eles The elements that will not be in the resultant collection. + * Elements from the calling collection matching this selector will not be in the resultant collection. + */ + type CollectionBuildingDifferenceFunc = (eles: Collection | Selector) => CollectionElements; + + /** + * Get the elements in both this collection and another specified collection. + * http://js.cytoscape.org/#eles.intersection + * @param eles The elements to intersect with. + * A selector representing the elements to intersect with. + * All elements in the graph matching the selector are used as the passed collection. + */ + type CollectionBuildingIntersectionFunc = (eles: Collection | Selector) => CollectionElements; + + /** + * Get the elements that are in the calling collection or the passed collection but not in both. + * http://js.cytoscape.org/#eles.symmetricDifference + * @param eles The elements to apply the symmetric difference with. + * A selector representing the elements to apply the symmetric difference with. + * All elements in the graph matching the selector are used as the passed collection. + */ + type CollectionSymmetricDifferenceFunc = (eles: Collection | Selector) => CollectionElements; + /** + * http://js.cytoscape.org/#collection/building--filtering + */ + interface CollectionBuildingUnion { + /** + * Get a new collection, resulting from adding the collection with another one + * http://js.cytoscape.org/#eles.union + */ + union: CollectionBuildingUnionFunc; + // [index: "u"]: CollectionBuildingUnionFunc; + add: CollectionBuildingUnionFunc; + // [index: "+"]: CollectionBuildingUnionFunc; + or: CollectionBuildingUnionFunc; + // [index: "|"]: CollectionBuildingUnionFunc; + + /** + * Get a new collection, resulting from the collection without some specified elements. + * http://js.cytoscape.org/#eles.difference + */ + difference: CollectionBuildingDifferenceFunc; + // [index: "\\"]: CollectionBuildingDifferenceFunc; + not: CollectionBuildingDifferenceFunc; + // [index: "!"]: CollectionBuildingDifferenceFunc; + relativeComplement: CollectionBuildingDifferenceFunc; + // [index: "-"]: CollectionBuildingDifferenceFunc; + + /** + * Get all elements in the graph that are not in the calling collection. + * http://js.cytoscape.org/#eles.absoluteComplement + */ + absoluteComplement(): CollectionElements; + abscomp(): CollectionElements; + complement(): CollectionElements; + + /** + * Get the elements in both this collection and another specified collection. + * http://js.cytoscape.org/#eles.intersection + */ + intersection: CollectionSymmetricDifferenceFunc; + intersect: CollectionSymmetricDifferenceFunc; + and: CollectionSymmetricDifferenceFunc; + // [index: "n"]: CollectionSymmetricDifferenceFunc; + // [index: "&"]: CollectionSymmetricDifferenceFunc; + // [index: "."]: CollectionSymmetricDifferenceFunc; + + /** + * Get the elements that are in the calling collection + * or the passed collection but not in both. + * http://js.cytoscape.org/#eles.symmetricDifference + */ + symmetricDifference: CollectionSymmetricDifferenceFunc; + symdiff: CollectionSymmetricDifferenceFunc; + xor: CollectionSymmetricDifferenceFunc; + // [index: "^"]: CollectionSymmetricDifferenceFunc; + // [index: "(+)"]: CollectionSymmetricDifferenceFunc; + // [index: "(-)"]: CollectionSymmetricDifferenceFunc; + + // [index: string]: CollectionBuildingDifferenceFunc |CollectionBuildingUnionFunc | CollectionBuildingDifferenceFunc | CollectionSymmetricDifferenceFunc; + + /** + * Perform a traditional left/right diff on the two collections. + * + * @param selector + * A selector representing the elements on the right side of the diff. All elements in the graph matching the selector are used as the passed collection. + * The elements on the right side of the diff. + * @return This function returns a plain object of the form { left, right, both } where + * left - is the set of elements only in the calling (i.e. left) collection, + * right - is the set of elements only in the passed (i.e. right) collection, and + * both - is the set of elements in both collections. + * http://js.cytoscape.org/#eles.diff + */ + diff(selector: Selector | Collection): { + left: CollectionElements, + right: CollectionElements, + both: CollectionElements + }; + + /** + * Get a new collection containing elements that are accepted by the specified filter. + * + * @param selector The selector to match against. + * @param filter selector The filter function that returns true for elements to include. + * i - The index of the current element being considered. + * ele - The element being considered. + * http://js.cytoscape.org/#eles.filter + */ + filter(selector: Selector | ((i: number, ele: CollectionElements) => boolean)): CollectionElements; + /** + * Get the nodes that match the specified selector. + * + * @param selector The selector to match against. + * http://js.cytoscape.org/#eles.filter + */ + nodes(selector: Selector): NodeCollection; + /** + * Get the edges that match the specified selector. + * + * @param selector The selector to match against. + * http://js.cytoscape.org/#eles.filter + */ + edges(selector: Selector): EdgeCollection; + + /** + * Get a new collection containing the elements sorted by the + * specified comparison function. + * + * @param sort The sorting comparison function that returns a negative number + * for ele1 before ele2, 0 for ele1 same as ele2, + * or a positive number for ele1 after ele2. + * + * http://js.cytoscape.org/#eles.sort + */ + sort(sort: (ele1: CollectionElements, ele2: CollectionElements) => number): CollectionElements; + + /** + * Get an array containing values mapped from the collection. + * + * @param fn The function that returns the mapped value for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + * + * http://js.cytoscape.org/#eles.map + */ + map(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): any[]; + + /** + * Reduce a single value by applying a + * function against an accumulator and each value of the collection. + * + * @param fn The function that returns the accumulated value + * given the previous value and the current element. + * prevVal The value accumulated from previous elements. + * ele The current element. + * ix The index of the current element. + * eles The collection of elements being reduced. + * + * http://js.cytoscape.org/#eles.reduce + */ + reduce(fn: (prevVal: any, ele: CollectionElements, + ix: number, eles: CollectionElements) => any): number[]; + + /** + * Find a minimum value in a collection. + * + * @param fn The function that returns the value to compare for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + * + * http://js.cytoscape.org/#eles.min + */ + min(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + /** + * The minimum value found. + */ + value: any, + /** + * The element that corresponds to the minimum value. + */ + ele: CollectionElements + }; + + /** + * Find a maximum value and the corresponding element. + * + * @param fn The function that returns the value to compare for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + * + * http://js.cytoscape.org/#eles.max + */ + max(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + /** + * The maximum value found. + */ + value: any, + /** + * The element that corresponds to the maximum value. + */ + ele: CollectionElements + }; + } + + /** + * http://js.cytoscape.org/#collection/traversing + */ + + type MinumumSpanningTree = any; + + interface CollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the open neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": + * This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + neighborhood(selector?: Selector): CollectionElements; + + /** + * Get the open neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": + * This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + openNeighborhood(selector?: Selector): CollectionElements; + /** + * Get the closed neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": + * This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * A closed neighbourhood is one that does include the original set of elements. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + closedNeighborhood(selector?: Selector): CollectionElements; + + /** + * Get the connected components, considering only the elements in the calling collection. + * An array of collections is returned, with each collection representing a component. + */ + components(): Collection; + } + interface EdgeSingularTraversing { + /** + * Get source node of this edge. + * @param selector An optional selector that is used to filter the resultant collection. + * http://js.cytoscape.org/#edge.source + */ + source(selector?: Selector): NodeCollection; + + /** + * Get target node of this edge. + * @param selector An optional selector that is used to filter the resultant collection. + * http://js.cytoscape.org/#edge.target + */ + target(selector?: Selector): NodeCollection; + } + interface EdgeCollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the nodes connected to the edges in the collection + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + connectedNodes(selector?: Selector): NodeCollection; + + /** + * Get source nodes connected to the edges in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + sources(selector?: Selector): NodeCollection; + + /** + * Get target nodes connected to the edges in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + targets(selector?: Selector): NodeCollection; + + /** + * Get edges parallel to those in the collection. + * + * Two edges are said to be parallel if they connect the same two nodes. + * Any two parallel edges may connect nodes in the same direction, in which case the edges share the same source and target. + * They may alternatively connect nodes in the opposite direction, in which case the source and target are reversed in the second edge. + * That is: + * - edge1.source().id() === edge2.source().id() + * && edge1.target().id() === edge2.target().id() + * OR + * - edge1.source().id() === edge2.target().id() + * && edge1.target().id() === edge2.source().id() + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + parallelEdges(selector?: Selector): EdgeCollection; + + /** + * Get edges codirected to those in the collection. + * + * Two edges are said to be codirected if they connect the same two nodes in the same direction: The edges have the same source and target. + * That is: + * - edge1.source().id() === edge2.source().id() + * && edge1.target().id() === edge2.target().id() + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + codirectedEdges(selector?: Selector): EdgeCollection; + } + interface NodeCollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the edges connecting the collection to another collection. Direction of the edges does not matter. + * + * @param eles The other collection. + * @param selector The other collection, specified as a selector which is matched against all elements in the graph. + */ + edgesWith(eles: Collection | Selector): EdgeCollection; + + /** + * Get the edges coming from the collection (i.e. the source) going to another collection (i.e. the target). + * + * @param eles The other collection. + * @param selector The other collection, specified as a selector which is matched against all elements in the graph. + */ + edgesTo(eles: Collection | Selector): EdgeCollection; + + /** + * Get the edges connected to the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + connectedEdges(selector?: Selector): EdgeCollection; + + /** + * From the set of calling nodes, get the nodes which are roots (i.e. no incoming edges, as in a directed acyclic graph). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + roots(selector?: Selector): NodeCollection; + + /** + * From the set of calling nodes, get the nodes which are leaves (i.e. no outgoing edges, as in a directed acyclic graph). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + leaves(selector?: Selector): NodeCollection; + + /** + * Get edges (and their targets) coming out of the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + outgoers(selector?: Selector): EdgeCollection; + + /** + * Recursively get edges (and their targets) coming out of the nodes in the collection (i.e. the outgoers, the outgoers' outgoers, ...). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + successors(selector?: Selector): EdgeCollection; + + /** + * Get edges (and their sources) coming into the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + incomers(selector?: Selector): EdgeCollection; + + /** + * Recursively get edges (and their sources) coming into the nodes in the collection (i.e. the incomers, the incomers' incomers, ...). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + predecessors(selector?: Selector): EdgeCollection; + } + + /** + * + * http://js.cytoscape.org/#collection/algorithms + */ + + type WeightFn = (edge: EdgeCollection) => number; + + /** + * The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + */ + type SearchVisitFunction = (i: number, depth: number, v: NodeCollection, e: EdgeCollection, u: NodeCollection) => boolean; + interface SearchFirstOptions { + /** + * The root nodes (selector or collection) to start the search from. + */ + roots: Selector | Collection; + /** + * A handler function that is called when a node is visited in the search. + */ + visit?: SearchVisitFunction; + /** + * A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + directed?: boolean; + } + interface SearchFirstResult { + /** + * The path of the search. + * - The path returned includes edges such that if path[i] is a node, then path[i - 1] is the edge used to get to that node. + */ + path: CollectionElements; + /** + * The node found by the search + * - If no node was found, then found is empty. + * - If your handler function returns false, then the only the path up to that point is returned. + */ + found: NodeCollection; + } + + /** + * http://js.cytoscape.org/#eles.dijkstra + */ + interface SearchDijkstraOptions { + /** + * The root node (selector or collection) where the algorithm starts. + */ + root: Selector | Collection; + + /** + * A function that returns the positive numeric weight for this edge. + * + * If no weight function is defined, a constant weight of 1 is used for each edge. + */ + weight?: WeightFn; + + /** + * A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.dijkstra + */ + interface SearchDijkstraResult { + /** + * Returns the distance from the source node to node. + */ + distanceTo(node: NodeSingular): number; + + /** + * Returns a collection containing the shortest path from the source node to node. + * The path starts with the source node and includes the edges between the nodes in the path such that if pathTo(node)[i] is an edge, + * then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] is the next node in the path. + */ + pathTo(node: NodeSingular): Collection; + } + /** + * http://js.cytoscape.org/#eles.aStar + */ + interface SearchAStarOptions { + root: Selector | Collection; + goal: Selector | Collection; + weight?: WeightFn; + heuristic?(node: NodeCollection): number; + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.aStar + */ + interface SearchAStarResult { + found: boolean; + distance: number; + path: Collection; + } + + /** + * http://js.cytoscape.org/#eles.floydWarshall + */ + interface SearchFloydWarshallOptions { + weight: WeightFn; + directed?: boolean; + } + + /** + * http://js.cytoscape.org/#eles.floydWarshall + */ + interface SearchFloydWarshallResult { + /** + * Returns the distance from the source node to node. + */ + distance(fromNode: NodeSingular | CollectionSelection, toNode: NodeSingular | Selector): number; + + /** + * Returns a collection containing the shortest path from the source node to node. + * The path starts with the source node and includes the edges + * between the nodes in the path such that if pathTo(node)[i] is an edge, + * then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] + * is the next node in the path. + */ + path(fromNode: NodeSingular | CollectionSelection, toNode: NodeSingular | Selector): Collection; + } + + /** + * http://js.cytoscape.org/#eles.bellmanFord + */ + interface SearchBellmanFordOptions { + /** + * The root node (selector or collection) where the search starts. + */ + "root": any; + /** + * A function that returns the positive numeric weight for this edge. + */ + "weight"?: WeightFn; + /** + * Indicating whether the algorithm should only go along + * edges from source to target (default false). + */ + "directed": boolean; + } + /** + * http://js.cytoscape.org/#eles.bellmanFord + */ + interface SearchBellmanFordResult { + /** + * function that computes the shortest path from root node to the argument node + * (either objects or selector string) + */ + pathTo(node: NodeSingular | Selector): Collection; + + /** + * function that computes the shortest distance from root node to argument node + * (either objects or selector string) + * + */ + distanceTo(node: NodeSingular | Selector): number; + + /* true/false. If true, pathTo and distanceTo will be undefined */ + hasNegativeWeightCycle: boolean; + } + + /** + * http://js.cytoscape.org/#eles.kruskal + * trivial so implemented in the function + */ + + /** + * http://js.cytoscape.org/#eles.pageRank + */ + interface SearchPageRankOptions { + /** Numeric parameter for the algorithm. */ + dampingFactor?: number; + /** Numeric parameter that represents the required precision. */ + precision?: number; + /** Maximum number of iterations to perform. */ + iterations?: number; + } + /** + * http://js.cytoscape.org/#eles.pageRank + */ + interface SearchPageRankResult { + /** function that computes the rank of a given node (either object or selector string) */ + rank(node: NodeCollection): void; + } + + /** + * http://js.cytoscape.org/#eles.degreeCentrality + */ + interface SearchDegreeCentralityOptions { + /** The root node (selector or collection) for which the + * centrality calculation is made. + */ + root: NodeSingular | Selector; + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + /** + * The alpha value for the centrality calculation, ranging on [0, 1]. + * With value 0 (default), disregards edge weights and solely uses + * number of edges in the centrality calculation. With value 1, + * disregards number of edges and solely uses the edge weights + * in the centrality calculation. + */ + alpha?: number; + /** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.degreeCentrality + */ + interface SearchDegreeCentralityResultUndirected { + /** the degree centrality of the root node */ + degree: number; + } + interface SearchDegreeCentralityResultDirected { + /* the indegree centrality of the root node */ + indegree: number; + /* the outdegree centrality of the root node */ + outdegree: number; + } + /** + * http://js.cytoscape.org/#eles.degreeCentralityNormalized + */ + interface SearchDegreeCentralityNormalizedOptions { + /** A function that returns the weight for the edge. */ + weight(edge: EdgeSingular): number; + /** + * The alpha value for the centrality calculation, ranging on [0, 1]. + * With value 0 (default), disregards edge weights and solely uses + * number of edges in the centrality calculation. With value 1, + * disregards number of edges and solely uses the edge weights + * in the centrality calculation. + */ + alpha?: number; + /** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.degreeCentralityNormalized + */ + interface SearchDegreeCentralityNormalizedResultUndirected { + /** the normalised degree centrality of the specified node */ + degree(node: NodeSingular): any; + } + interface SearchDegreeCentralityNormalizedResultDirected { + /** the normalised indegree centrality of the specified node */ + indegree(node: NodeSingular): any; + + /** the normalised outdegree centrality of the specified node */ + outdegree(node: NodeSingular): any; + } + /** + * http://js.cytoscape.org/#eles.closenessCentrality + */ + interface SearchClosenessCentralityOptions { + /** The root node (selector or collection) for which the + * centrality calculation is made. + */ + root: NodeSingular | Selector; + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + + /** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + /** + * A boolean indicating whether the algorithm calculates the + * harmonic mean (true, default) or the arithmetic mean (false) of distances. + * The harmonic mean is very useful for graphs that are not strongly connected. + */ + harmonic?: boolean; + } + /** + * http://js.cytoscape.org/#eles.closenessCentrality + * trivial + */ + + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + */ + interface SearchClosenessCentralityNormalizedOptions { + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + directed?: boolean; + /** + * A boolean indicating whether the algorithm calculates the + * harmonic mean (true, default) or the arithmetic mean (false) of distances. + * The harmonic mean is very useful for graphs that are not strongly connected. + */ + harmonic?: boolean; + } + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + * trivial + */ + + /** + * http://js.cytoscape.org/#eles.betweennessCentrality + */ + interface SearchBetweennessOptions { + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + + /** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.betweennessCentrality + */ + interface SearchBetweennessResult { + /** returns the betweenness centrality of the specified node */ + betweenness(node: NodeSingular): number; + + /** returns the normalised betweenness centrality of the specified node */ + betweennessNormalized(node: NodeSingular): number; + betweennessNormalised(node: NodeSingular): number; + } + + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + */ + interface SearchClosenessCentralityNormalizedOptions { + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + directed?: boolean; + /** + * A boolean indicating whether the algorithm calculates the + * harmonic mean (true, default) or the arithmetic mean (false) of distances. + * The harmonic mean is very useful for graphs that are not strongly connected. + */ + harmonic?: boolean; + } + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + * trivial + */ + + interface CollectionAlgorithms { + /** + * Perform a breadth-first search within the elements in the collection. + * @param options + * http://js.cytoscape.org/#eles.breadthFirstSearch + */ + breadthFirstSearch(options: SearchFirstOptions): SearchFirstResult; + /** + * Perform a depth-first search within the elements in the collection. + * http://js.cytoscape.org/#eles.depthFirstSearch + */ + depthFirstSearch(options: SearchFirstOptions): SearchFirstResult; + + /** + * Perform Dijkstra's algorithm on the elements in the collection. + * This finds the shortest paths to all other nodes in the collection from the root node. + * http://js.cytoscape.org/#eles.dijkstra + */ + dijkstra(options: SearchDijkstraOptions): SearchDijkstraResult; + + /** + * Perform the A* search algorithm on the elements in the collection. + * This finds the shortest path from the root node to the goal node. + * http://js.cytoscape.org/#eles.aStar + */ + aStar(options: SearchAStarOptions): SearchAStarResult; + /** + * Perform the Floyd Warshall search algorithm on the elements in the collection. + * This finds the shortest path between all pairs of nodes. + * http://js.cytoscape.org/#eles.floydWarshall + */ + aStar(options: SearchFloydWarshallOptions): SearchFloydWarshallResult; + /** + * Perform the Bellman-Ford search algorithm on the elements in the collection. + * This finds the shortest path from the starting node to all other nodes in the collection. + * http://js.cytoscape.org/#eles.bellmanFord + */ + bellmanFort(options: SearchBellmanFordOptions): SearchBellmanFordResult; + /** + * Perform Kruskal's algorithm on the elements in the collection, + * returning the minimum spanning tree, assuming undirected edges. + * http://js.cytoscape.org/#eles.kruskal + */ + kruskal(handler: (edge: EdgeCollection) => number): void; + /** + * Finds the minimum cut in a graph using the Karger-Stein algorithm. + * The optimal result is found with a high probability, but without guarantee. + * http://js.cytoscape.org/#eles.kargerStein + */ + kargerStein(): { cut: EdgeCollection; partitionFirst: NodeCollection; partitionSecond: NodeCollection; }; + /** + * Rank the nodes in the collection using the Page Rank algorithm. + * http://js.cytoscape.org/#eles.pageRank + */ + pageRank(options: SearchPageRankOptions): SearchPageRankResult; + /** + * Considering only the elements in the calling collection, + * calculate the degree centrality of the specified root node. + * http://js.cytoscape.org/#eles.degreeCentrality + */ + degreeCentrality(options: SearchDegreeCentralityOptions): + SearchDegreeCentralityResultDirected | SearchDegreeCentralityResultUndirected; + + /** + * Considering only the elements in the calling collection, + * calculate the normalised degree centrality of the nodes. + * http://js.cytoscape.org/#eles.degreeCentralityNormalized + */ + degreeCentralityNormalized(options: SearchDegreeCentralityNormalizedOptions): + SearchDegreeCentralityNormalizedResultDirected | SearchDegreeCentralityNormalizedResultUndirected; + + /** + * Considering only the elements in the calling collection, + * calculate the closeness centrality of the specified root node. + * http://js.cytoscape.org/#eles.closenessCentrality + */ + closenessCentrality(options: SearchClosenessCentralityOptions): number; + /** + * Considering only the elements in the calling collection, + * calculate the closeness centrality of the nodes. + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + */ + closenessCentralityNormalized(options: SearchClosenessCentralityNormalizedOptions): + SearchDegreeCentralityNormalizedResultDirected | + SearchDegreeCentralityNormalizedResultUndirected; + /** + * Considering only the elements in the calling collection, + * calculate the betweenness centrality of the nodes. + * http://js.cytoscape.org/#eles.betweennessCentrality + */ + betweennessCentrality(options: SearchBetweennessOptions): SearchBetweennessResult; + } + + /** + * http://js.cytoscape.org/#collection/compound-nodes + */ + interface NodeSingularCompound { + /** + * Get whether the node is a compound parent + * (i.e. a node containing one or more child nodes) + * http://js.cytoscape.org/#node.isParent + */ + isParent(): boolean; + /** + * Get whether the node is childless (i.e. a node with no child nodes) + * http://js.cytoscape.org/#node.isChildless + */ + isChildless(): boolean; + /** + * Get whether the node is a compound child (i.e. contained within a node) + * http://js.cytoscape.org/#node.isChild + */ + isChild(): boolean; + /** + * Get whether the node is an orphan (i.e. a node with no parent) + * http://js.cytoscape.org/#node.isOrphan + */ + isOrphan(): boolean; + } + /** + * http://js.cytoscape.org/#collection/compound-nodes + */ + interface NodeCollectionCompound { + /** + * Get the compound parent node of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.parent + */ + parent(selector?: Selector): NodeCollection; + /** + * Get all compound ancestor nodes + * (i.e. parents, parents' parents, etc.) of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.ancestors + */ + ancestors(selector?: Selector): NodeCollection; + parents(selector?: Selector): NodeCollection; + /** + * Get all compound ancestors common to all the nodes in the collection, + * starting with the closest and getting progressively farther. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.commonAncestors + */ + commonAncestors(selector?: Selector): NodeCollection; + /** + * Get all orphan (i.e. has no compound parent) nodes in the calling collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.orphans + */ + orphans(selector?: Selector): NodeCollection; + /** + * Get all nonorphan (i.e. has a compound parent) nodes in the calling collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.nonorphans + */ + nonorphans(selector?: Selector): NodeCollection; + /** + * Get all compound child (i.e. direct descendant) nodes of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.children + */ + children(selector?: Selector): NodeCollection; + /** + * Get all compound descendant (i.e. children, children's children, etc.) + * nodes of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.descendants + */ + descendants(selector?: Selector): NodeCollection; + /** + * Get all sibling (i.e. same compound parent) + * nodes of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.siblings + */ + siblings(selector?: Selector): NodeCollection; + } + + /** + * A selector functions similar to a CSS selector on DOM elements, + * but selectors in Cytoscape.js instead work on + * collections of graph elements. + * Note that wherever a selector may be specified + * as the argument to a function, + * a eles.filter()-style filter function may be + * used in place of the selector. + * + * See http://js.cytoscape.org/#selectors for + * details about writing selectors. + * Selectors are an island grammar. + */ + type Selector = string; + + /** + * A space separated list of event names. + * http://js.cytoscape.org/#cy.promiseOn + */ + type EventNames = string; + + /** + * A string indicating the selection behaviour from user input. + * http://js.cytoscape.org/#core/initialisation + * + * 'additive' : a new selection made by the user adds to the set of currently selected elements. + * 'single' : a new selection made by the user becomes the entire set of currently + * selected elements (i.e. the previous elements are unselected) + */ + type SelectionType = "additive" | "single"; + + /** + * http://js.cytoscape.org/#ele.group + * http://js.cytoscape.org/#notation/elements-json + * + * 'nodes' + * 'edges' + */ + type ElementGroup = "nodes" | "edges"; + + /** + * 'x' : x coordinate + * 'y' : y coordinate + */ + type PositionDimension = "x" | "y"; + + /** + * Usually temp or nonserialisable data can be stored. + * http://js.cytoscape.org/#notation/elements-json + * http://js.cytoscape.org/#cy.scratch + * http://js.cytoscape.org/#ele.scratch + */ + type Scratchpad = any; + + /** + * Style in Cytoscape.js follows CSS conventions as closely as possible. + * In most cases, a property has the same name and behaviour as its corresponding CSS namesake. + * However, the properties in CSS are not sufficient to specify the style of some parts of the graph. + * In that case, additional properties are introduced that are unique to Cytoscape.js. + * + * For simplicity and ease of use, specificity rules are completely ignored in stylesheets. + * For a given style property for a given element, the last matching selector wins. + * + * http://js.cytoscape.org/#style + */ + namespace Css { + type Colour = string; + + /** + * The shape of the node’s body. + * Note that each shape fits within the specified width and height, + * and so you may have to adjust width and height + * if you desire an equilateral shape + * (i.e. width !== height for several equilateral shapes). + * 'polygon' is a custom polygon specified via shape-polygon-points. + */ + type NodeShape = 'rectangle' | 'roundrectangle' | 'ellipse' | 'triangle' + | "pentagon" | "hexagon" | "heptagon" | "octagon" | "star" + | "diamond" | "vee" | "rhomboid" | "polygon"; + + /** + * A space-separated list of numbers ranging on [-1, 1], + * representing alternating x and y values (i.e. x1 y1 x2 y2, x3 y3 ...). + * This represents the points in the polygon for the node’s shape. + * The bounding box of the node is given by (-1, -1), (1, -1), (1, 1), (-1, 1). + */ + type ShapePolygonPoints = string; + + /** + * The line style; may be solid, dotted, dashed, or double + */ + type LineStyle = "solid" | "dotted" | "dashed" | "double"; + + /** + * http://js.cytoscape.org/#style/node-body + */ + interface Node extends PaddingNode { + "label"?: string; + /** + * The width of the node’s body. + * This property can take on the special value label + * so the width is automatically based on the node’s label. + */ + "width"?: number | "label"; + /** + * The height of the node’s body. + * This property can take on the special value label + * so the height is automatically based on the node’s label. + */ + "height"?: number | "label"; + /** + * The shape of the node’s body. + */ + "shape"?: NodeShape; + "shape-polygon-points"?: ShapePolygonPoints; + + "opacity"?: number; + + "backgroundColor"?: Colour; + /** + * The colour of the node’s body. + */ + "background-color"?: Colour; + /** + * Blackens the node’s body for values from 0 to 1; + * whitens the node’s body for values from 0 to -1. + */ + "background-blacken"?: number; + /** + * The opacity level of the node’s background colour. + */ + "background-opacity"?: number; + /** + * The size of the node’s border. + */ + "border-width"?: number; + /** + * The style of the node’s border. + */ + "border-style"?: LineStyle; + /** + * The colour of the node’s border. + */ + "border-color"?: Colour; + /** + * The opacity of the node’s border. + * A value between [0 1]. + */ + "border-opacity"?: number; + + "text-opacity"?: number; + } + + /** + * A padding defines an addition to a node’s dimension. + * For example, padding-left adds to a node’s outer (i.e. total) width. + * This can be used to add spacing around the label of width: label; height: label; nodes, + * or it can be used to add spacing between a compound node parent and its children. + */ + interface PaddingNode { + "padding-left"?: string; + "padding-right"?: string; + "padding-top"?: string; + "padding-bottom"?: string; + } + + interface Dictionary { [key: string]: any; } + + // export interface ElementCss extends CSSStyleDeclaration { } + /** + * A background image may be applied to a node’s body: + * + * http://js.cytoscape.org/#style/background-image + */ + interface BackgroundImage { + /** + * The URL that points to the image that should be used as the node’s background. + * PNG, JPG, and SVG are supported formats. + * You may use a data URI to use embedded images, + * thereby saving a HTTP request. + */ + "background-image"?: string; + /** + * The opacity of the background image. [0 1] + */ + "background-image-opacity"?: number; + /** + * Specifies the width of the image. + * A percent value (e.g. 50%) may be used to set + * the image width relative to the node width. + * If used in combination with background- fit, + * then this value overrides the width of the image + * in calculating the fitting — thereby overriding the aspect ratio. + * The auto value is used by default, which uses the width of the image. + */ + "background-width"?: number | string; + /** + * Specifies the height of the image. + * A percent value (e.g. 50%) may be used to set the image + * height relative to the node height. + * If used in combination with background- fit, + * then this value overrides the height of the image in calculating + * the fitting — thereby overriding the aspect ratio. + * The auto value is used by default, which uses the height of the image. + */ + "background-height"?: number | string; + /** + * How the background image is fit to the node; + * may be none for original size, + * contain to fit inside node, + * or cover to cover the node. + */ + "background-fit"?: "none" | "contain" | "cover"; + /** + * Whether to repeat the background image; + * may be no-repeat, repeat-x, repeat-y, or repeat. + */ + "background-repeat"?: "no-repeat" | "repeat-x" | "repeat-y" | "repeat"; + /** + * The x position of the background image, + * measured in percent(e.g. 50%) or pixels (e.g. 10px). + */ + "background-position-x"?: number | string; + /** + * The y position of the background image, + * measured in percent(e.g. 50%) or pixels (e.g. 10px). + */ + "background-position-y"?: number | string; + /** + * How background image clipping is handled; + * may be node for clipped to node shape or none for no clipping. + */ + "background-clip"?: "clipped" | "none"; + } + + /** + * These properties allow you to create pie chart backgrounds on nodes. + * Note that 16 slices maximum are supported per node, + * so in the properties 1 <= i <= 16. + * Of course, you must specify a numerical value for each property in place of i. + * Each nonzero sized slice is placed in order of i, + * starting from the 12 o’clock position and working clockwise. + * + * You may find it useful to reserve a number to a particular + * colour for all nodes in your stylesheet. + * Then you can specify values for pie-i-background-size + * accordingly for each node via a mapper. + * This would allow you to create consistently coloured + * pie charts in each node of the graph based on element data. + * + * http://js.cytoscape.org/#style/pie-chart-background + */ + interface PieChartBackground { + /** + * The diameter of the pie, measured as a percent of node size (e.g. 100%) or an absolute length (e.g. 25px). + */ + "pie-size": string; + /** + * The colour of the node’s ith pie chart slice. + */ + "pie-i-background-color": Colour; + /** + * The size of the node’s ith pie chart slice, measured in percent (e.g. 25% or 25). + */ + "pie-i-background-size": number; + /** + * The opacity of the node’s ith pie chart slice. + */ + "pie-i-background-opacity": number; + } + + interface Edge extends EdgeLine, EdgeArror { } + + /** + * These properties affect the styling of an edge’s line: + * + * http://js.cytoscape.org/#style/edge-line + */ + interface EdgeLine { + /** + * The width of an edge’s line. + */ + "width"?: number | "label"; + /** + * The curving method used to separate two or more edges between two nodes; + * may be + * - haystack (default, very fast, bundled straight edges for which loops and compounds are unsupported), + * - bezier(bundled curved edges), + * - unbundled - bezier(curved edges for use with manual control points), or + * - segments (a series of straight lines). + * Note that haystack edges work best with ellipse, rectangle, or similar nodes. + * Smaller node shapes, like triangle, will not be as aesthetically pleasing. + * Also note that edge arrows are unsupported for haystack edges. + */ + "curve-style"?: "haystack" | "bezier" | "unbundled" | "segments"; + /** + * The colour of the edge’s line. + */ + "line-color"?: Colour; + /** + * The style of the edge’s line. + */ + "line-style"?: LineStyle; + } + + /** + * For automatic, bundled bezier edges (curve - style: bezier): + * + * http://js.cytoscape.org/#style/bezier-edges + */ + interface BezierEdges { + /** + * From the line perpendicular from source to target, + * this value specifies the distance between successive bezier edges. + */ + "control-point-step-size": number; + /** + * A single value that overrides "control-point-step-size" with a manual value. + * Because it overrides the step size, bezier edges with the same value will overlap. + * Thus, it’s best to use this as a one- off value for particular edges if need be. + */ + "control-point-distance": number; + /** + * A single value that weights control points along the line from source to target. + * The value usually ranges on [0, 1], with + * 0 towards the source node and + * 1 towards the target node — + * but larger or smaller values can also be used. + */ + "control-point-weight": number; + /** + * With value intersection (default), + * the line from source to target for "control-point-weight" is + * from the outside of the source node’s shape to the outside of + * the target node’s shape.With value node- position, + * the line is from the source position to the target position. + * The "node-position" option makes calculating edge points easier + * — but it should be used carefully because you can create invalid + * points that intersection would have automatically corrected. + */ + "edge-distances": number; + } + /** + * Unbundled bezier edges + * For bezier edges with manual control points (curve - style: unbundled - bezier): + * + * http://js.cytoscape.org/#style/unbundled-bezier-edges + */ + interface UnbundledBezierEdges { + /** + * A series of values that specify for each control point the + * distance perpendicular to a line formed + * from source to target, e.g. -20 20 - 20. + */ + "control-point-distances": string; + /** + * A series of values that weights control points along + * a line from source to target, e.g. 0.25 0.5 0.75. + * A value usually ranges on [0, 1], with + * 0 towards the source node and + * 1 towards the target node + * — but larger or smaller values can also be used. + */ + "control-point-weights": string; + /** + * With value intersection (default), + * the line from source to target for "control-point-weights" + * is from the outside of the source node’s shape to the + * outside of the target node’s shape. + * With value + * "node-position", the line is from the source position to the target position. + * The "node-position" option makes calculating edge points easier + * — but it should be used carefully because you can create + * invalid points that intersection would have automatically corrected. + */ + "edge-distances": number; + } + /** + * Haystack edges + * Loop edges and compound parent nodes are not supported by haystack edges. + * Haystack edges are a more performant replacement for plain, straight line edges. + * + * For fast, straight line edges (curve - style: haystack): + * http://js.cytoscape.org/#style/haystack-edges + */ + interface HaystackEdges { + /** + * A value between 0 and 1 inclusive that indicates the relative radius used to position haystack edges on their connected nodes. + * The outside of the node is at 1, and the centre of the node is at 0. + */ + "haystack-radius": number; + } + /** + * Segments edges + * For edges made of several straight lines (curve - style: segments): + * http://js.cytoscape.org/#style/segments-edges + */ + interface SegmentsEdges { + /** + * A series of values that specify for each segment point the distance perpendicular to a line formed from source to target, e.g. -20 20 - 20. + */ + "segment-distances": string; + /** + * A series of values that weights segment points along a line from source to target, + * e.g. 0.25 0.5 0.75.A value usually ranges on [0, 1], + * with 0 towards the source node and 1 towards the target node — but larger or smaller values can also be used. + */ + "segment-weights": string; + /** + * With value + * * "intersection" (default), the line from source to target + * * for "segment-weights" is from the outside of the source node’s shape to the outside of the target node’s shape. + * * With value "node-position", the line is from the source position to the target position. + * The "node-position" option makes calculating edge points easier + * — but it should be used carefully because you can create + * invalid points that intersection would have automatically corrected. + */ + "edge-distances": "intersection" | "segment-weights" | "node-position"; + } + type ArrowShape = "tee" | "triangle" | "triangle-tee" | "triangle-backcurve" | "square" | "circle" | "diamond" | "none"; + + type ArrowFill = "filled" | "hollow"; + + /** + * Edge arrow + * * -arrow-color : The colour of the edge’s source arrow. + * * -arrow-shape : The shape of the edge’s source arrow. + * * -arrow-fill : The fill state of the edge’s source arrow. + * + * For each edge arrow property above, replace with one of + * * source : Pointing towards the source node, at the end of the edge. + * * mid-source : Pointing towards the source node, at the middle of the edge. + * * target : Pointing towards the target node, at the end of the edge. + * * mid-target: Pointing towards the target node, at the middle of the edge. + * + * Only mid arrows are supported on haystack edges. + * http://js.cytoscape.org/#style/edge-arrow + */ + interface EdgeArror { + /** The colour of the edge’s source arrow. */ + "source-arrow-color"?: Colour; + /** The colour of the edge’s "mid-source" arrow. */ + "mid-source-arrow-color"?: Colour; + /** The colour of the edge’s target arrow. */ + "target-arrow-color"?: Colour; + /** The colour of the edge’s "mid-target" arrow. */ + "mid-target-arrow-color"?: Colour; + + /** The shape of the edge’s source arrow. */ + "source-arrow-shape"?: ArrowShape; + /** The shape of the edge’s mid-source arrow. */ + "mid-source-arrow-shape"?: ArrowShape; + /** The shape of the edge’s target arrow. */ + "target-arrow-shape"?: ArrowShape; + /** The shape of the edge’s mid-target arrow. */ + "mid-target-arrow-shape"?: ArrowShape; + + /** The fill state of the edge’s source arrow. */ + "source-arrow-fill"?: ArrowFill; + /** The fill state of the edge’s mid-source arrow. */ + "mid-source-arrow-fill"?: ArrowFill; + /** The fill state of the edge’s target arrow. */ + "target-arrow-fill"?: ArrowFill; + /** The fill state of the edge’s mid-target arrow. */ + "mid-target-arrow-fill"?: ArrowFill; + } + + /** + * http://js.cytoscape.org/#style/visibility + */ + interface Visibility { + /** + * Whether to display the element; may be element for displayed or none for not displayed. + * Note that a "display: none" bezier edge does not take up space in its bundle. + */ + "display": "none" | "displayed"; + /** + * Whether the element is visible; may be visible or hidden. + * Note that a "visibility : hidden" bezier edge still takes up space in its bundle. + */ + "visibility": "none" | "visible"; + /** + * The opacity of the element, ranging from 0 to 1. + * Note that the opacity of a compound node parent affects the effective opacity of its children. + */ + "opacity": number; + /** + * An integer value that affects the relative draw order of elements. + * In general, an element with a higher "z-index" will be drawn on top of an element with a lower "z-index". + * Note that edges are under nodes despite "z-index", except when necessary for compound nodes. + */ + "z-index": number; + } + + /** https://developer.mozilla.org/en-US/docs/Web/CSS/font-style */ + type FontStyle = "normal" | "italic" | "oblique"; + + /** https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight */ + type FontWeight = number | "normal" | "bold" | "lighter" | "bolder"; + + /** http://js.cytoscape.org/#style/labels */ + type TextTranformation = "none" | "uppercase" | "lowercase"; + + /** + * Labels + * Label text: + * + * http://js.cytoscape.org/#style/labels + */ + interface Labels { + /** + * The text to display for an element’s label. + */ + "label": string; + /** + * The text to display for an edge’s source label. + */ + "source-label": string; + /** + * The text to display for an edge’s target label. + */ + "target-label": string; + /** + * Basic font styling: + */ + /** + * The colour of the element’s label. + */ + "color": Colour; + /** + * The opacity of the label text, including its outline. + */ + "text-opacity": number; + /** + * A comma-separated list of font names to use on the label text. + */ + "font-family": string; + /** + * The size of the label text. + * https://developer.mozilla.org/en-US/docs/Web/CSS/font-family + */ + "font-size": number; + /** + * A CSS font style to be applied to the label text. + * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style + */ + "font-style": FontStyle; + /** + * A CSS font weight to be applied to the label text. + */ + "font-weight": FontWeight; + /** + * A transformation to apply to the label text. + */ + "text-transform": TextTranformation; + + /** + * Wrapping text: + */ + + /** + * A wrapping style to apply to the label text; may be + * * "none" for no wrapping (including manual newlines ) or + * * "wrap" for manual and/ or autowrapping. + */ + "text-wrap": "none" | "wrap"; + /** + * The maximum width for wrapped text, + * applied when "text-wrap" is set to wrap. + * For only manual newlines (i.e.\n), set a very large + * value like 1000px such that only your newline characters would apply. + */ + "text-max-width": string; + + /** + * Node label alignment: + */ + + /** + * The vertical alignment of a node’s label. + */ + "text-halign": "left" | "center" | "right"; + /** + * The vertical alignment of a node’s label. + */ + "text-valign": "top" | "center" | "bottom"; + + /** + * Edge label alignment: + */ + + /** + * For the source label of an edge, how far from the source node the label should be placed. + */ + "source-text-offset": number; + /** + * For the target label of an edge, how far from the target node the label should be placed. + */ + "target-text-offset": number; + /** + * Margins: + */ + + /** + * A margin that shifts the label along the x- axis. + */ + "text-margin-x": number; + /** + * A margin that shifts the label along the y- axis. + */ + "text-margin-y": number; + /** + * (For the source label of an edge.) + */ + "source-text-margin-x": number; + /** + * (For the source label of an edge.) + */ + "source-text-margin-y": number; + /** + * (For the target label of an edge.) + */ + "target-text-margin-x": number; + /** + * (For the target label of an edge.) + */ + "target-text-margin-y": number; + /** + * Rotating text: + */ + + /** + * A rotation angle that is applied to the label. + * * For edges, the special value autorotate can be used to align the label to the edge. + * * For nodes, the label is rotated along its anchor point on the node, so a label margin may help for some usecases. + * * The special value none can be used to denote 0deg. + * * Rotations works best with left- to - right text. + */ + "text-rotation": number; + + /** + * (For the source label of an edge.) + */ + "source-text-rotation": number; + /** + * (For the target label of an edge.) + */ + "target-text-rotation": number; + + /** + * Outline: + */ + + /** + * The colour of the outline around the element’s label text. + */ + "text-outline-color": Colour; + /** + * The opacity of the outline on label text. + */ + "text-outline-opacity": number; + /** + * The size of the outline on label text. + */ + "text-outline-width": number; + /** + * Shadow: + */ + /** + * The shadow blur distance. + */ + "text-shadow-blur": number; + /** + * The colour of the shadow. + */ + "text-shadow-color": Colour; + /** + * The x offset relative to the text where the shadow will be displayed, can be negative. + * If you set blur to 0, add an offset to view your shadow. + */ + "text-shadow-offset-x": number; + /** + * The y offset relative to the text where the shadow will be displayed, can be negative. + * If you set blur to 0, add an offset to view your shadow. + */ + "text-shadow-offset-y": number; + /** + * The opacity of the shadow on the text; the shadow is disabled for 0 (default value). + */ + "text-shadow-opacity": number; + + /** + * Background: + */ + + /** + * A colour to apply on the text background. + */ + "text-background-color": Colour; + /** + * The opacity of the label background; the background is disabled for 0 (default value). + */ + "text-background-opacity": number; + /** + * The shape to use for the label background. + */ + "text-background-shape": "ractangle" | "roundrectangle"; + + /** + * Border: + */ + + /** + * The width of the border around the label; the border is disabled for 0 (default value). + */ + "text-border-opacity": number; + /** + * The width of the border around the label. + */ + "text-border-width": number; + /** + * The style of the border around the label. + */ + "text-border-style": LineStyle; + /** + * The colour of the border around the label. + */ + "text-border-color": Colour; + + /** + * Interactivity: + */ + + /** + * If zooming makes the effective font size of the label smaller than this, + * then no label is shown.Note that because of performance optimisations, + * the label may be shown at font sizes slightly smaller than this value. + * + * This effect is more pronounced at larger screen pixel ratios.However, + * it is guaranteed that the label will be shown at sizes equal to or greater than the value specified. + */ + "min-zoomed-font-size": number; + /** + * Whether events should occur on an element if the label receives an event. + * You may want a style applied to the text onactive so you know the text is activatable. + */ + "text-events": "yes" | "no"; + } + + /** + * http://js.cytoscape.org/#style/events + */ + interface Events { + /** + * Whether events should occur on an element (e.g.tap, mouseover, etc.). + * * For "no", the element receives no events and events simply pass through to the core/viewport. + */ + "events": "yes" | "no"; + /** + * Whether events should occur on an element if the label receives an event. + * You may want a style applied to the text on active so you know the text is activatable. + */ + "text-events": "yes" | "no"; + } + + /** + * These properties allow for the creation of overlays on top of nodes or edges, + * and are often used in the :active state. + * http://js.cytoscape.org/#style/overlay + */ + interface Overlay { + /** + * The colour of the overlay. + */ + "overlay-color": Colour; + /** + * The area outside of the element within which the overlay is shown. + */ + "overlay-padding": number; + /** + * The opacity of the overlay. + */ + "overlay-opacity": number; + } + /** + * These properties allow for the creation of shadows on nodes or edges. + * Note that shadow-blur could seriously impact performance on large graph. + * http://js.cytoscape.org/#style/shadow + */ + interface Shadow { + /** + * The shadow blur, note that if greater than 0, this could impact performance. + */ + "shadow-blur": number; + /** + * The colour of the shadow. + */ + "shadow-color": Colour; + /** + * The x offset relative to the node/edge where the shadow will be displayed, can be negative. If you set blur to 0, add an offset to view your shadow. + */ + "shadow-offset-x": number; + /** + * The y offset relative to the node/edge where the shadow will be displayed, can be negative. If you set blur to 0, add an offset to view your shadow. + */ + "shadow-offset-y": number; + /** + * The opacity of the shadow. + */ + "shadow-opacity": number; + } + + /** + * Transition animation + */ + type TransitionTimingFunction = "linear" | "spring" | "cubic-bezier" | "ease" | "ease-in" | "ease-out" | + "ease-in-out" | "ease-in-sine" | "ease-out-sine" | "ease-in-out-sine" | "ease-in-quad" | + "ease-out-quad" | "ease-in-out-quad" | "ease-in-cubic" | "ease-out-cubic" | + "ease-in-out-cubic" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | + "ease-in-quint" | "ease-out-quint" | "ease-in-out-quint" | "ease-in-expo" | + "ease-out-expo" | "ease-in-out-expo" | "ease-in-circ" | "ease-out-circ" | "ease-in-out-circ"; + + /** + * http://js.cytoscape.org/#style/transition-animation + */ + interface TransitionAnimation { + /** + * A comma separated list of style properties to animate in this state. + */ + "transition-property": string; + /** + * The length of the transition in seconds(e.g. 0.5s). + */ + "transition-duration": number; + /** + * The length of the delay in seconds before the transition occurs (e.g. 250ms). + */ + "transition-delay": number; + /** + * An easing function that controls the animation progress curve (a visualisation of easings serves as a reference). + */ + "transition-timing-function": TransitionTimingFunction; + } + + /** + * Core + * These properties affect UI global to the graph, and apply only to the core. + * You can use the special core selector string to set these properties. + * http://js.cytoscape.org/#style/core + */ + interface Core { + /** + * Indicator: + */ + + /** + * The colour of the indicator shown when the background is grabbed by the user. + */ + "active-bg-color": Colour; + /** + * The opacity of the active background indicator. + */ + "active-bg-opacity": number; + /** + * The size of the active background indicator. + */ + "active-bg-size": number; + /** + * Selection box: + */ + /** + * The background colour of the selection box used for drag selection. + */ + "selection-box-color": Colour; + /** + * The colour of the border on the selection box. + */ + "selection-box-border-color": Colour; + /** + * The size of the border on the selection box. + */ + "selection-box-border-width": number; + /** + * The opacity of the selection box. + */ + "selection-box-opacity": number; + /** + * Texture during viewport gestures: + */ + /** + * The colour of the area outside the viewport texture when initOptions.textureOnViewport === true. + */ + "outside-texture-bg-color": Colour; + /** + * The opacity of the area outside the viewport texture. + */ + "outside-texture-bg-opacity": number; + } + } + + /** + * Events passed to handler callbacks are similar to + * jQuery event objects in that they wrap native event objects, + * mimicking their API. + * + * http://js.cytoscape.org/#events + */ + interface EventObject extends InputEventObject, LayoutEventObject { } + + /** + * http://js.cytoscape.org/#events/event-object + */ + interface AbstractEventObject { + /** a reference to the corresponding core Core */ + cy: any; + /** indicates the element or core that first caused the event */ + target?: any; + /** the event type string (e.g. "tap") */ + type: UserInputDeviceEventName | UserInputDeviceEventNameExt; + /** the event namespace string (e.g. "foo" for "foo.tap") */ + namespace: string; + /** Unix epoch time of event in milliseconds */ + timeStamp: number; + } + interface InputEventObject extends AbstractEventObject { + /** position : indicates the model position of the event */ + position: Position; + /** renderedPosition : indicates the rendered position of the event */ + renderedPosition: Position; + /** originalEvent : the original user input device event object */ + originalEvent: EventObject; + } + interface LayoutEventObject extends AbstractEventObject { + /** layout : indicates the corresponding layout that triggered the event + * (useful if running multiple layouts simultaneously) + */ + layout: any; + } + + /** + * These are normal browser events that you can bind to via Cytoscape.js. + * You can bind these events to the core and to collections. + * http://js.cytoscape.org/#events/user-input-device-events + */ + type UserInputDeviceEventName = + // when the mouse button is pressed + "mousedown" | + // when the mouse button is released + "mouseup" | + // after mousedown then mouseup + "click" | + // when the cursor is put on top of the target + "mouseover" | + // when the cursor is moved off of the target + "mouseout" | + // when the cursor is moved somewhere on top of the target + "mousemove" | + // when one or more fingers starts to touch the screen + "touchstart" | + // when one or more fingers are moved on the screen + "touchmove" | + // when one or more fingers are removed from the screen + "touchend"; + + /** + * There are also some higher level events that you can use + * so you don’t have to bind to different events for + * mouse-input devices and for touch devices. + * http://js.cytoscape.org/#events/user-input-device-events + */ + type UserInputDeviceEventNameExt = + // normalised tap start event (either mousedown or touchstart) + "tapstart" | "vmousedown" | + // normalised move event (either touchmove or mousemove) + "tapdrag" | "vmousemove" | + // normalised over element event (either touchmove or mousemove/mouseover) + "tapdragover" | + // normalised off of element event (either touchmove or mousemove/mouseout) + "tapdragout" | + // normalised tap end event (either mouseup or touchend) + "tapend" | "vmouseup" | + // normalised tap event (either click, or touchstart followed by touchend without touchmove) + "tap" | "vclick" | + // normalised tap hold event + "taphold" | + // normalised right-click mousedown or two-finger tapstart + "cxttapstart" | + // normalised right-click mouseup or two-finger tapend + "cxttapend" | + // normalised right-click or two-finger tap + "cxttap" | + // normalised mousemove or two-finger drag after cxttapstart but before cxttapend + "cxtdrag" | + // when going over a node via cxtdrag + "cxtdragover" | + // when going off a node via cxtdrag + "cxtdragout" | + // when starting box selection + "boxstart" | + // when ending box selection + "boxend" | + // triggered on elements when selected by box selection + "boxselect" | + // triggered on elements when inside the box on boxend + "box"; + + /** + * These events are custom to Cytoscape.js. You can bind to these events for collections. + * http://js.cytoscape.org/#events/collection-events + */ + type CollectionEventName = + // when an element is added to the graph + "add" | + // when an element is removed from the graph + "remove" | + // when an element is selected + "select" | + // when an element is unselected + "unselect" | + // when an element is locked + "lock" | + // when an element is unlocked + "unlock" | + // when an element is grabbed directly (including only the one node directly under the cursor or the user’s finger) + "grabon" | + // when an element is grabbed (including all elements that would be dragged) + "grab" | + // when an element is grabbed and then moved + "drag" | + // when an element is freed (i.e. let go from being grabbed) + "free" | + // when an element changes position + "position" | + // when an element’s data is changed + "data" | + // when an element’s scratchpad data is changed + "scratch" | + // when an element’s style is changed + "style"; + + /** + * These events are custom to Cytoscape.js, and they occur on the core. + * http://js.cytoscape.org/#events/graph-events + */ + type GraphEventName = + // when a layout starts running + "layoutstart" | + // when a layout has set initial positions for all the nodes (but perhaps not final positions) + "layoutready" | + // when a layout has finished running completely or otherwise stopped running + "layoutstop" | + // when a new Core of Cytoscape.js is ready to be interacted with + "ready" | + // when the Core of Cytoscape.js was explicitly destroyed by calling .destroy(). + "destroy" | + // when the viewport is (re)rendered + "render" | + // when the viewport is panned + "pan" | + // when the viewport is zoomed + "zoom" | + // when the viewport is resized (usually by calling cy.resize(), a window resize, or toggling a class on the Cytoscape.js div) + "resize"; + + /** + * Layouts + * http://js.cytoscape.org/#layouts + * + * The function of a layout is to set the positions on the nodes in the graph. + * Layouts are extensions of Cytoscape.js such that it is possible for + * anyone to write a layout without modifying the library itself. + * Several layouts are included with Cytoscape.js by default, + * and their options are described in the sections that follow + * with the default values specified. + * Note that you must set options.name to the name of the + * layout to specify which one you want to run. + * Each layout has its own algorithm for setting the position for each node. + * This algorithm influences the overall shape of the graph and the lengths of the edges. + * A layout’s algorithm can be customised by setting its options. + * Therefore, edge lengths can be controlled by setting the layout options appropriately. + * For force-directed (physics) layouts, + * there is generally an option to set a weight to each edge + * to affect the relative edge lengths. + * Edge length can also be affected by options like spacing + * factors, angles, and overlap avoidance. + * Setting edge length depends on the particular layout, + * and some layouts will allow for more precise edge lengths than others. + */ + + interface Layouts extends LayoutManipulation, LayoutEvents { } + + type LayoutOptions = + NullLayoutOptions | PresetLayoutOptions | GridLayoutOptions | + CircleLayoutOptions | ConcentricLayoutOptions | BreadthFirstLayoutOptions | + CoseLayoutOptions; + + type LayoutHandler = () => void; + + interface BaseLayoutOptions { + name: string; + // on layoutready event + ready?: LayoutHandler; + // on layoutstop event + stop?: LayoutHandler; + } + /** + * http://js.cytoscape.org/#layouts/null + */ + interface NullLayoutOptions { + name: "null"; + } + interface BoundingBox12 { + x1: number; + y1: number; + x2: number; + y2: number; + } + interface BoundingBoxWH { + x1: number; + y1: number; + w: number; + h: number; + } + interface AnimatedLayoutOptions { + // whether to transition the node positions + animate?: boolean; + // duration of animation in ms if enabled + animationDuration?: number; + // easing of animation if enabled + animationEasing?: boolean; + } + /** + * http://js.cytoscape.org/#layouts/random + */ + interface RandomLayoutOptions extends BaseLayoutOptions, AnimatedLayoutOptions { + name: "random"; + // whether to fit to viewport + fit: boolean; + // fit padding + padding?: number; + // constrain layout bounds + boundingBox: undefined | BoundingBox12 | BoundingBoxWH; + } + + /** + * http://js.cytoscape.org/#layouts/preset + */ + interface NodePositionMap { [nodeid: string]: Position; } + type NodePositionFunction = (nodeid: string) => Position; + interface PresetLayoutOptions extends BaseLayoutOptions, AnimatedLayoutOptions { + name: "preset"; + // map of (node id) => (position obj); or function(node){ return somPos; } + positions?: NodePositionMap | NodePositionFunction; + // the zoom level to set (prob want fit = false if set) + zoom?: number; + // the pan level to set (prob want fit = false if set) + pan?: number; + // whether to fit to viewport + fit?: boolean; + // padding on fit + padding?: number; + } + + interface SortableNode { + data: { weight: number; }; + } + + // function(a, b){ return a.data('weight') - b.data('weight') } + type SortingFunction = (a: SortableNode, b: SortableNode) => number; + + interface ShapedLayoutOptions extends BaseLayoutOptions, AnimatedLayoutOptions { + // whether to fit to viewport + fit: boolean; + // padding used on fit + padding?: number; + // constrain layout bounds + boundingBox?: BoundingBox12 | BoundingBoxWH; + + // prevents node overlap, may overflow boundingBox if not enough space + avoidOverlap?: boolean; + + // Excludes the label when calculating node bounding boxes for the layout algorithm + nodeDimensionsIncludeLabels: boolean; + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + spacingFactor?: number; + + // a sorting function to order the nodes + sort?: SortingFunction; + } + /** + * http://js.cytoscape.org/#layouts/grid + */ + interface GridLayoutOptions extends ShapedLayoutOptions { + name: "grid"; + + // extra spacing around nodes when avoidOverlap: true + avoidOverlapPadding?: number; + + // uses all available space on false, uses minimal space on true + condense: boolean; + // force num of rows in the grid + rows?: number; + // force num of columns in the grid + cols?: number; + // returns { row, col } for element + position(nodeid: string): { row: number; col: number; }; + } + + /** + * http://js.cytoscape.org/#layouts/circle + */ + interface CircleLayoutOptions extends ShapedLayoutOptions { + name: "circle"; + + // the radius of the circle + radius?: number; + + // where nodes start in radians, e.g. 3 / 2 * Math.PI, + startAngle: number; + // how many radians should be between the first and last node (defaults to full circle) + sweep?: number; + // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + clockwise?: boolean; + } + /** + * http://js.cytoscape.org/#layouts/concentric + */ + interface ConcentricLayoutOptions extends ShapedLayoutOptions { + name: "concentric"; + + // where nodes start in radians, e.g. 3 / 2 * Math.PI, + startAngle: number; + // how many radians should be between the first and last node (defaults to full circle) + sweep?: number; + // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + clockwise?: boolean; + + // whether levels have an equal radial distance betwen them, may cause bounding box overflow + equidistant: false; + minNodeSpacing: 10; // min spacing between outside of nodes (used for radius adjustment) + // height of layout area (overrides container height) + height: undefined; + // width of layout area (overrides container width) + width: undefined; + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + spacingFactor: undefined; + // returns numeric value for each node, placing higher nodes in levels towards the centre + concentric(node: { degree(): number; }): number; + // the variation of concentric values in each level + levelWidth(node: { maxDegree(): number; }): number; + } + + /** + * http://js.cytoscape.org/#layouts/breadthfirst + */ + interface BreadthFirstLayoutOptions extends ShapedLayoutOptions { + name: "breadthfirst"; + + // whether the tree is directed downwards (or edges can point in any direction if false) + directed: boolean; + // put depths in concentric circles if true, put depths top down if false + circle: boolean; + // the roots of the trees + roots?: string; + // how many times to try to position the nodes in a maximal way (i.e. no backtracking) + maximalAdjustments: number; + } + + /** + * http://js.cytoscape.org/#layouts/cose + */ + interface CoseLayoutOptions extends ShapedLayoutOptions { + name: "cose"; + + // Number of iterations between consecutive screen positions update + // (0 -> only updated on the end) + refresh: number; + // Randomize the initial positions of the nodes (true) or use existing positions (false) + randomize: boolean; + // Extra spacing between components in non-compound graphs + componentSpacing: number; + // Node repulsion (non overlapping) multiplier + nodeRepulsion(node: any): number; + + // Node repulsion (overlapping) multiplier + nodeOverlap: number; + // Ideal edge (non nested) length + idealEdgeLength(edge: any): number; + // Divisor to compute edge forces + edgeElasticity(edge: any): number; + + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: number; + // Gravity force (constant) + gravity: number; + // Maximum number of iterations to perform + numIter: number; + // Initial temperature (maximum node displacement) + initialTemp: number; + // Cooling factor (how the temperature is reduced between consecutive iterations + coolingFactor: number; + // Lower temperature threshold (below this point the layout will end) + minTemp: number; + // Pass a reference to weaver to use threads for calculations + weaver: boolean; + } + + /** + * http://js.cytoscape.org/#layouts/layout-manipulation + * Layouts have a set of functions available to them, + * which allow for more complex behaviour than the primary run-one-layout-at-a-time usecase. + * A new, developer accessible layout can be made via cy.makeLayout(). + */ + interface LayoutManipulation { + /** Start running the layout + * http://js.cytoscape.org/#layout.run + */ + run(): void; + start(): void; + /** Stop running the (asynchronous/discrete) layout + * http://js.cytoscape.org/#layout.stop + */ + stop(): void; + } + interface LayoutEvents { + /** + * http://js.cytoscape.org/#layouts/layout-events + */ + /** + * @param events A space separated list of event names. + * @param data [optional] A plain object which is passed to the + * handler in the event object argument. + * @param handler The handler function that is called + * when one of the specified events occurs. + */ + on(events: EventNames, data: any, handler: EventHandler): void; + bind(events: EventNames, data: any, handler: EventHandler): void; + listen(events: EventNames, data: any, handler: EventHandler): void; + addListener(events: EventNames, data: any, handler: EventHandler): void; + + /** + * Get a promise that is resolved with the first of any of + * the specified events triggered on the layout. + * http://js.cytoscape.org/#layout.promiseOn + */ + promiseOn(events: EventNames): Promise; + pon(events: EventNames): Promise; + + /** + * Bind to events that are emitted by the layout, and trigger the handler only once. + * @param events A space separated list of event names. + * @param data [optional] A plain object which is passed to the handler in the event object argument. + * @param handler The handler function that is called when one of the specified events occurs. + */ + one(events: EventNames, handler: EventHandler): void; + one(events: EventNames, data: any, handler: EventHandler): void; + + /** + * Remove event handlers on the layout. + * http://js.cytoscape.org/#layout.off + * + * @param events A space separated list of event names. + * @param handler [optional] A reference to the handler function to remove. + */ + off(events: EventNames, handler?: EventHandler): void; + unbind(events: EventNames, handler?: EventHandler): void; + unlisten(events: EventNames, handler?: EventHandler): void; + removeListener(events: EventNames, handler?: EventHandler): void; + + /** + * Trigger one or more events on the layout. + * http://js.cytoscape.org/#layout.trigger + * @param events A space separated list of event names to trigger. + * @param extraParams [optional] An array of additional parameters to pass to the handler. + */ + trigger(events: EventNames, extraParams?: any[]): void; + } + + /** + * An animation represents a visible change in state over + * a duration of time for a single element. + * Animations can be generated via cy.animation() + * (for animations on the viewport) and ele.animation() + * (for animations on graph elements). + * http://js.cytoscape.org/#animations + */ + + /** + * http://js.cytoscape.org/#animations/animation-manipulation + */ + interface AnimationManipulation { + /** + * Requests that the animation be played, starting on the next frame. + * If the animation is complete, it restarts from the beginning. + * http://js.cytoscape.org/#ani.play + */ + play(): void; + /** + * Get whether the animation is currently playing. + * http://js.cytoscape.org/#ani.playing + */ + playing(): boolean; + /** + * Get or set how far along the animation has progressed. + * http://js.cytoscape.org/#ani.progress + */ + /** + * Get the progress of the animation in percent. + */ + progress(): number; + /** + * Set the progress of the animation in percent. + * @param progress The progress in percent (i.e. between 0 and 1 inclusive) to set to the animation. + */ + progress(progress: number): AnimationManipulation; + /** + * Get the progress of the animation in milliseconds. + */ + time(): number; + /** + * Set the progress of the animation in milliseconds. + * @param time The progress in milliseconds + * (i.e. between 0 and the duration inclusive) to set to the animation. + */ + time(time: number): AnimationManipulation; + /** + * Rewind the animation to the beginning. + */ + rewind(): AnimationManipulation; + /** + * Fastforward the animation to the end. + */ + fastforward(): AnimationManipulation; + + /** + * Pause the animation, maintaining the current progress. + * http://js.cytoscape.org/#ani.pause + */ + pause(): AnimationManipulation; + /** + * Stop the animation, maintaining the current progress + * and removing the animation from any associated queues. + * http://js.cytoscape.org/#ani.stop + */ + stop(): AnimationManipulation; + /** + * Get whether the animation has progressed to the end. + * http://js.cytoscape.org/#ani.completed + */ + completed(): AnimationManipulation; + complete(): AnimationManipulation; + /** + * Apply the animation at its current progress. + * http://js.cytoscape.org/#ani.apply + */ + apply(): AnimationManipulation; + /** + * Get whether the animation is currently applying. + * http://js.cytoscape.org/#ani.applying + */ + applying(): AnimationManipulation; + /** + * Reverse the animation such that its starting + * conditions and ending conditions are reversed. + * http://js.cytoscape.org/#ani.reverse + */ + reverse(): AnimationManipulation; + /** + * Get a promise that is fulfilled with the specified animation event. + * @param animationEvent A string for the event name; completed or complete for + * completing the animation or frame for the next frame of the animation. + * http://js.cytoscape.org/#ani.promise + */ + promise(animationEvent?: "completed" | "complete" | "frame"): Promise; + } +} diff --git a/types/cytoscape/tsconfig.json b/types/cytoscape/tsconfig.json new file mode 100644 index 0000000000..348734c733 --- /dev/null +++ b/types/cytoscape/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cytoscape-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cytoscape/tslint.json b/types/cytoscape/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cytoscape/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/d3-array/tsconfig.json b/types/d3-array/tsconfig.json index b70f6aed80..a1dbb238ee 100644 --- a/types/d3-array/tsconfig.json +++ b/types/d3-array/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-axis/tsconfig.json b/types/d3-axis/tsconfig.json index 5a9af63a15..5b54d1f622 100644 --- a/types/d3-axis/tsconfig.json +++ b/types/d3-axis/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-box/tsconfig.json b/types/d3-box/tsconfig.json index 57c83445a9..d6411b9a05 100644 --- a/types/d3-box/tsconfig.json +++ b/types/d3-box/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/d3-brush/tsconfig.json b/types/d3-brush/tsconfig.json index 017b6001da..2aeb012361 100644 --- a/types/d3-brush/tsconfig.json +++ b/types/d3-brush/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-chord/tsconfig.json b/types/d3-chord/tsconfig.json index bac0f16968..eff4938f78 100644 --- a/types/d3-chord/tsconfig.json +++ b/types/d3-chord/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-collection/tsconfig.json b/types/d3-collection/tsconfig.json index e4870c413c..c2ae30cdbd 100644 --- a/types/d3-collection/tsconfig.json +++ b/types/d3-collection/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-color/tsconfig.json b/types/d3-color/tsconfig.json index 7237aab597..d783922755 100644 --- a/types/d3-color/tsconfig.json +++ b/types/d3-color/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-contour/d3-contour-tests.ts b/types/d3-contour/d3-contour-tests.ts index 588750bf29..2a7444ab19 100644 --- a/types/d3-contour/d3-contour-tests.ts +++ b/types/d3-contour/d3-contour-tests.ts @@ -38,7 +38,7 @@ function goldsteinPrice(x: number, y: number) { let size: [number, number]; let boolFlag: boolean; -const thresholdArrayGen: ThresholdArrayGenerator = (values: number[], min: number, max: number) => { +const thresholdArrayGen: ThresholdArrayGenerator = (values: ArrayLike, min?: number, max?: number) => { let thresholds: number[]; thresholds = [values[1], values[2], values[4]]; return thresholds; diff --git a/types/d3-contour/tsconfig.json b/types/d3-contour/tsconfig.json index 4f9d0a8284..345a064caa 100644 --- a/types/d3-contour/tsconfig.json +++ b/types/d3-contour/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "d3-contour-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-dispatch/tsconfig.json b/types/d3-dispatch/tsconfig.json index 236dac7276..b270a9c1a0 100644 --- a/types/d3-dispatch/tsconfig.json +++ b/types/d3-dispatch/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-drag/d3-drag-tests.ts b/types/d3-drag/d3-drag-tests.ts index 581b757717..848e3d1256 100644 --- a/types/d3-drag/d3-drag-tests.ts +++ b/types/d3-drag/d3-drag-tests.ts @@ -110,6 +110,24 @@ circleDrag = circleDrag.filter(function(d, i, group) { // getter filterFn = circleDrag.filter(); +// set and get touchable --------------------------------------------------------- + +let touchableFn: (this: SVGCircleElement, datum: CircleDatum, index: number, group: SVGCircleElement[] | NodeListOf) => boolean; + +// chainable + +circleDrag = circleDrag.touchable(true); + +circleDrag = circleDrag.touchable(function(d, i, group) { + const that: SVGCircleElement = this; + const datum: CircleDatum = d; + const g: SVGCircleElement[] | NodeListOf = group; + return "ontouchstart" in this && datum.color === 'green'; +}); + +// getter +touchableFn = circleDrag.touchable(); + // set and get subject --------------------------------------------------------- circleCustomDrag.subject(function(d, i, g) { diff --git a/types/d3-drag/index.d.ts b/types/d3-drag/index.d.ts index 7105bd4e4d..b930081d15 100644 --- a/types/d3-drag/index.d.ts +++ b/types/d3-drag/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for D3JS d3-drag module 1.1 +// Type definitions for D3JS d3-drag module 1.2 // Project: https://github.com/d3/d3-drag/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.1.0 +// Last module patch version validated against: 1.2.1 import { ArrayLike, Selection, ValueFn } from 'd3-selection'; @@ -126,6 +126,34 @@ export interface DragBehavior): this; + /** + * Returns the current touch support detector, which defaults to a function returning true, + * if the "ontouchstart" event is supported on the current element. + */ + touchable(): ValueFn; + /** + * Sets the touch support detector to the specified boolean value and returns the drag behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false. + */ + touchable(touchable: boolean): this; + /** + * Sets the touch support detector to the specified function and returns the drag behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element. + * The function is evaluated for each selected element to which the drag behavior was applied, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value. + */ + touchable(touchable: ValueFn): this; + /** * Returns the current subject accessor functions. */ diff --git a/types/d3-drag/tsconfig.json b/types/d3-drag/tsconfig.json index 5974212b94..cb6cab8ba0 100644 --- a/types/d3-drag/tsconfig.json +++ b/types/d3-drag/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-dsv/tsconfig.json b/types/d3-dsv/tsconfig.json index 48d5f2eac6..82e3ef399f 100644 --- a/types/d3-dsv/tsconfig.json +++ b/types/d3-dsv/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-dsv/v0/tsconfig.json b/types/d3-dsv/v0/tsconfig.json index 87a2df205f..e0ae8b7a42 100644 --- a/types/d3-dsv/v0/tsconfig.json +++ b/types/d3-dsv/v0/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/d3-ease/tsconfig.json b/types/d3-ease/tsconfig.json index 9e26ce19f5..6d0831f1a5 100644 --- a/types/d3-ease/tsconfig.json +++ b/types/d3-ease/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-force/d3-force-tests.ts b/types/d3-force/d3-force-tests.ts index c08e1b5cee..6b73a1dbf4 100644 --- a/types/d3-force/d3-force-tests.ts +++ b/types/d3-force/d3-force-tests.ts @@ -370,6 +370,168 @@ simNodeNumberAccessor = forcePosY.y(); forcePosY.initialize(graph.nodes); forcePosY(0.1); // alpha +// ForceRadial ============================================================================== + +// create ForceRadial force -------------------------------------------------------------- + +let forceRadial: d3Force.ForceRadial; + +// Radius set only +forceRadial = d3Force.forceRadial(50); +forceRadial = d3Force.forceRadial((node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 50 * n.group; +}); + +// Radius and x-coordinate of center set only +forceRadial = d3Force.forceRadial(50, 10); +forceRadial = d3Force.forceRadial( + 50, // radius + (node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 10 * n.group; + } // center-x +); + +// Radius and center set +forceRadial = d3Force.forceRadial(50, 10, 10); +forceRadial = d3Force.forceRadial( + 50, // radius + 10, // center-x + (node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 10 * n.group; + } // center-y +); + +forceRadial = d3Force.forceRadial( + (node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 50 * n.group; + }, // radius + (node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 10 * n.group; + }, // center-x + (node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 10 * n.group; + } // center-y +); +// Configure ForceRadial force ----------------------------------------------------------- + +// strength + +forceRadial = forceRadial.strength(0.2); +forceRadial = forceRadial.strength((node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + return 0.1 * n.group; +}); +simNodeNumberAccessor = forceRadial.strength(); + +// radius + +forceRadial = forceRadial.radius(100); +forceRadial = forceRadial.radius((node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + let target: number; + switch (n.group) { + case 1: + target = 100; + break; + case 2: + target = 200; + break; + case 3: + target = 300; + break; + default: + target = 0; + break; + } + + return target; +}); + +simNodeNumberAccessor = forceRadial.radius(); + +// x + +forceRadial = forceRadial.x(100); +forceRadial = forceRadial.x((node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + let target: number; + switch (n.group) { + case 1: + target = 100; + break; + case 2: + target = 200; + break; + case 3: + target = 300; + break; + default: + target = 0; + break; + } + + return target; +}); + +simNodeNumberAccessor = forceRadial.x(); + +// y + +forceRadial = forceRadial.y(100); +forceRadial = forceRadial.y((node, index, nodes) => { + const n: SimNode = node; + const i: number = index; + const ns: SimNode[] = nodes; + let target: number; + switch (n.group) { + case 1: + target = 100; + break; + case 2: + target = 200; + break; + case 3: + target = 300; + break; + default: + target = 0; + break; + } + + return target; +}); + +simNodeNumberAccessor = forceRadial.y(); + +// Use ForceRadial force ----------------------------------------------------------------- + +forceRadial.initialize(graph.nodes); +forceRadial(0.1); // alpha + // ------------------------------------------------------------------------------------- // Test Force Simulation // ------------------------------------------------------------------------------------- diff --git a/types/d3-force/index.d.ts b/types/d3-force/index.d.ts index 23f83c7ea3..1736a1ac78 100644 --- a/types/d3-force/index.d.ts +++ b/types/d3-force/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for D3JS d3-force module 1.0 +// Type definitions for D3JS d3-force module 1.1 // Project: https://github.com/d3/d3-force/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.0.4 +// Last module patch version validated against: 1.1.0 // ----------------------------------------------------------------------- // Force Simulation @@ -66,14 +66,18 @@ export interface SimulationNodeDatum { export interface SimulationLinkDatum { /** * Link’s source node. - * For convenience, a link’s source property may be initialized using numeric or string identifiers rather than object references; see link.id. + * For convenience, a link’s source and target properties may be initialized using numeric or string identifiers rather than object references; see link.id. + * When the link force is initialized (or re-initialized, as when the nodes or links change), any link.source or link.target property which is not an object + * is replaced by an object reference to the corresponding node with the given identifier. * After initialization, the source property represents the source node object. */ source: NodeDatum | string | number; /** * Link’s source link - * For convenience, a link’s target property may be initialized using numeric or string identifiers rather than object references; see link.id. - * After initialization, the target property represents the source node object. + * For convenience, a link’s source and target properties may be initialized using numeric or string identifiers rather than object references; see link.id. + * When the link force is initialized (or re-initialized, as when the nodes or links change), any link.source or link.target property which is not an object + * is replaced by an object reference to the corresponding node with the given identifier. + * After initialization, the target property represents the target node object. */ target: NodeDatum | string | number; /** @@ -565,6 +569,8 @@ export interface ForceLink(y: number): ForceY * The function returns the y-coordinate. */ export function forceY(y: (d: NodeDatum, i: number, data: NodeDatum[]) => number): ForceY; + +/** + * The radial force is similar to the x- and y-positioning forces, except it pushes nodes towards the closest point on a given circle. + * The circle is of the specified radius centered at ⟨x,yâź©. If x and y are not specified, they default to ⟨0,0âź©. + * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. + * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. + * + * The generic refers to the type of data for a node. + */ +export interface ForceRadial extends Force { + /** + * Assign the array of nodes to this force. This method is called when a force is bound to a simulation via simulation.force + * and when the simulation’s nodes change via simulation.nodes. + * + * A force may perform necessary work during initialization, such as evaluating per-node parameters, to avoid repeatedly performing work during each application of the force. + */ + initialize(nodes: NodeDatum[]): void; + + /** + * Returns the current strength accessor, which defaults to a constant strength for all nodes of 0.1. + */ + strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; + /** + * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and returns this force. + * + * The strength determines how much to increment the node’s x-velocity: (x - node.x) Ă— strength. + * + * For example, a value of 0.1 indicates that the node should move a tenth of the way from its current x-position to the target x-position with each application. + * Higher values moves nodes more quickly to the target position, often at the expense of other forces or constraints. + * + * A value outside the range [0,1] is not recommended. + * + * The constant is internally wrapped into a strength accessor function. + * + * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or + * when this method is called with a new strength, and not on every application of the force. + * + * @param strength Constant value of strength to be used for all nodes. + */ + strength(strength: number): this; + /** + * Set the strength accessor to the specified function, re-evaluates the strength accessor for each node, and returns this force. + * + * The strength determines how much to increment the node’s x-velocity: (x - node.x) Ă— strength. + * + * For example, a value of 0.1 indicates that the node should move a tenth of the way from its current x-position to the target x-position with each application. + * Higher values moves nodes more quickly to the target position, often at the expense of other forces or constraints. + * + * A value outside the range [0,1] is not recommended. + * + * The strength accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that the strength of each node is only recomputed when the force is initialized or + * when this method is called with a new strength, and not on every application of the force. + * + * @param strength A strength accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The function returns the strength. + */ + strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; + + /** + * Return the current radius accessor for the circle. + */ + radius(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; + /** + * Set the radius accessor for the circle to the specified number, re-evaluates the radius accessor for each node, + * and returns this force. + * + * The constant is internally wrapped into a radius accessor function. + * + * The radius accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that radius of the circle for each node is only recomputed when the force is initialized or + * when this method is called with a new radius, and not on every application of the force. + * + * @param radius Constant radius of the circle to be used for all nodes. + */ + radius(radius: number): this; + /** + * Set the radius accessor for the circle to the specified function, re-evaluates the radius accessor for each node, + * and returns this force. + * + * The radius accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that radius of the circle for each node is only recomputed when the force is initialized or + * when this method is called with a new radius, and not on every application of the force. + * + * @param radius A radius accessor function for the circle which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The function returns the radius of the circle. + */ + radius(radius: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; + + /** + * Return the current x-accessor for the circle center, which defaults to a function returning 0 for all nodes. + */ + x(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; + /** + * Set the x-coordinate accessor for the circle center to the specified number, re-evaluates the x-accessor for each node, + * and returns this force. + * + * The constant is internally wrapped into an x-coordinate accessor function. + * + * The x-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that the x-coordinate of the circle center for each node is only recomputed when the force is initialized or + * when this method is called with a new x, and not on every application of the force. + * + * @param x Constant x-coordinate of the circle center to be used for all nodes. + */ + x(x: number): this; + /** + * Set the x-coordinate accessor to the specified function, re-evaluates the x-accessor for each node, + * and returns this force. + * + * The x-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that the x-coordinate of the circle center for each node is only recomputed when the force is initialized or + * when this method is called with a new x, and not on every application of the force. + * + * @param x A x-coordinate accessor function for the circle center which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The function returns the x-coordinate of the circle center. + */ + x(x: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; + + /** + * Return the current y-accessor for the circle center, which defaults to a function returning 0 for all nodes. + */ + y(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; + /** + * Set the y-coordinate accessor for the circle center to the specified number, re-evaluates the y-accessor for each node, + * and returns this force. + * + * The constant is internally wrapped into an y-coordinate accessor function. + * + * The y-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that the y-coordinate of the circle center for each node is only recomputed when the force is initialized or + * when this method is called with a new y, and not on every application of the force. + * + * @param y Constant y-coordinate of the circle center to be used for all nodes. + */ + y(y: number): this; + /** + * Set the y-coordinate accessor to the specified function, re-evaluates the y-accessor for each node, + * and returns this force. + * + * The y-accessor is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The resulting number is then stored internally, such that the y-coordinate of the circle center for each node is only recomputed when the force is initialized or + * when this method is called with a new y, and not on every application of the force. + * + * @param y A y-coordinate accessor function for the circle center which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. + * The function returns the y-coordinate of the circle center. + */ + y(y: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; +} + +/** + * Create a new radial positioning force towards a circle of the specified radius centered at ⟨x,yâź©. + * If x and y are not specified, they default to ⟨0,0âź©. + * + * The strength of the force is proportional to the one-dimensional distance between the node’s position and the target position. + * While this force can be used to position individual nodes, it is intended primarily for global forces that apply to all (or most) nodes. + * + * The generic refers to the type of data for a node. + */ +export function forceRadial(radius: number | ((d: NodeDatum, i: number, data: NodeDatum[]) => number), + x?: number | ((d: NodeDatum, i: number, data: NodeDatum[]) => number), y?: number | ((d: NodeDatum, i: number, data: NodeDatum[]) => number)): ForceRadial; diff --git a/types/d3-force/tsconfig.json b/types/d3-force/tsconfig.json index 699078ccdc..3d407406eb 100644 --- a/types/d3-force/tsconfig.json +++ b/types/d3-force/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-format/tsconfig.json b/types/d3-format/tsconfig.json index 8572936846..6017e0916f 100644 --- a/types/d3-format/tsconfig.json +++ b/types/d3-format/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index e4b242d856..876461e3e9 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -371,6 +371,13 @@ const inverted2: [number, number] = constructedProjection.invert([54, 2]); // TODO ????? // let stream: d3Geo.Stream = constructedProjection.stream([54, 2]); +const preClip: (stream: d3Geo.GeoStream) => d3Geo.GeoStream = constructedProjection.preclip(); +constructedProjection = constructedProjection.preclip(d3Geo.geoClipAntimeridian); +constructedProjection = constructedProjection.preclip(d3Geo.geoClipCircle(45)); + +const postClip: (stream: d3Geo.GeoStream) => d3Geo.GeoStream = constructedProjection.postclip(); +constructedProjection = constructedProjection.postclip(d3Geo.geoClipRectangle(0, 0, 1, 1)); + const clipAngle: number = constructedProjection.clipAngle(); constructedProjection = constructedProjection.clipAngle(null); constructedProjection = constructedProjection.clipAngle(45); @@ -415,6 +422,26 @@ constructedProjection = constructedProjection.fitSize([960, 500], sampleExtended constructedProjection = constructedProjection.fitSize([960, 500], sampleFeatureCollection); constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeatureCollection); +constructedProjection = constructedProjection.fitWidth(960, samplePolygon); +constructedProjection = constructedProjection.fitWidth(960, sampleSphere); +constructedProjection = constructedProjection.fitWidth(960, sampleGeometryCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedGeometryCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleFeature); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeature1); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeature2); +constructedProjection = constructedProjection.fitWidth(960, sampleFeatureCollection); +constructedProjection = constructedProjection.fitWidth(960, sampleExtendedFeatureCollection); + +constructedProjection = constructedProjection.fitHeight(500, samplePolygon); +constructedProjection = constructedProjection.fitHeight(500, sampleSphere); +constructedProjection = constructedProjection.fitHeight(500, sampleGeometryCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedGeometryCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleFeature); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeature1); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeature2); +constructedProjection = constructedProjection.fitHeight(500, sampleFeatureCollection); +constructedProjection = constructedProjection.fitHeight(500, sampleExtendedFeatureCollection); + // ---------------------------------------------------------------------- // GeoConicProjection interface // ---------------------------------------------------------------------- @@ -686,3 +713,13 @@ d3Geo.geoStream(sampleExtendedFeature1, stream); d3Geo.geoStream(sampleExtendedFeature2, stream); d3Geo.geoStream(sampleFeatureCollection, stream); d3Geo.geoStream(sampleExtendedFeatureCollection, stream); + +// ---------------------------------------------------------------------- +// Clipping Function +// ---------------------------------------------------------------------- + +let clippingFunction: (stream: d3Geo.GeoStream) => d3Geo.GeoStream; + +clippingFunction = d3Geo.geoClipAntimeridian; +clippingFunction = d3Geo.geoClipCircle(45); +clippingFunction = d3Geo.geoClipRectangle(0, 0, 1, 1); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 42a8af43af..231a2b3fe4 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for D3JS d3-geo module 1.7 +// Type definitions for D3JS d3-geo module 1.9 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.7.1 +// Last module patch version validated against: 1.9.0 import * as GeoJSON from 'geojson'; @@ -46,7 +46,7 @@ export interface ExtendedGeometryCollection extends GeoJSON.GeoJsonObject { geometry: GeometryType; properties: Properties; - id?: string; + id?: string | number; } /** @@ -645,6 +645,34 @@ export interface GeoProjection extends GeoStreamWrapper { */ center(point: [number, number]): this; + /** + * Returns the current spherical clipping function. + * Pre-clipping occurs in geographic coordinates. Cutting along the antimeridian line, + * or clipping along a small circle are the most common strategies. + */ + preclip(): (stream: GeoStream) => GeoStream; + /** + * Sets the projection’s spherical clipping to the specified function and returns the projection. + * Pre-clipping occurs in geographic coordinates. Cutting along the antimeridian line, or clipping along a small circle are the most common strategies. + * + * @param preclip A spherical clipping function. Clipping functions are implemented as transformations of a projection stream. + * Pre-clipping operates on spherical coordinates, in radians. + */ + preclip(preclip: (stream: GeoStream) => GeoStream): this; + + /** + * Returns the current cartesian clipping function. + * Post-clipping occurs on the plane, when a projection is bounded to a certain extent such as a rectangle. + */ + postclip(): (stream: GeoStream) => GeoStream; + /** + * Sets the projection’s cartesian clipping to the specified function and returns the projection. + * + * @param postclip A cartesian clipping function. Clipping functions are implemented as transformations of a projection stream. + * Post-clipping operates on planar coordinates, in pixels. + */ + postclip(postclip: (stream: GeoStream) => GeoStream): this; + /** * Returns the current clip angle which defaults to null. * @@ -653,6 +681,7 @@ export interface GeoProjection extends GeoStreamWrapper { clipAngle(): number | null; /** * Switches to antimeridian cutting rather than small-circle clipping. + * See also projection.preclip, d3.geoClipAntimeridian, d3.geoClipCircle. * * @param angle Set to null to switch to antimeridian cutting. */ @@ -661,6 +690,8 @@ export interface GeoProjection extends GeoStreamWrapper { * Sets the projection’s clipping circle radius to the specified angle in degrees and returns the projection. * Small-circle clipping is independent of viewport clipping via projection.clipExtent. * + * See also projection.preclip, d3.geoClipAntimeridian, d3.geoClipCircle. + * * @param angle Angle in degrees. */ clipAngle(angle: number): this; @@ -675,6 +706,8 @@ export interface GeoProjection extends GeoStreamWrapper { * * Viewport clipping is independent of small-circle clipping via projection.clipAngle. * + * See also projection.postclip, d3.geoClipRectangle. + * * @param extent Set to null to disable viewport clipping. */ clipExtent(extent: null): this; @@ -684,6 +717,8 @@ export interface GeoProjection extends GeoStreamWrapper { * * Viewport clipping is independent of small-circle clipping via projection.clipAngle. * + * See also projection.postclip, d3.geoClipRectangle. + * * @param extent The extent bounds are specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left-side of the viewport, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. */ clipExtent(extent: [[number, number], [number, number]]): this; @@ -770,6 +805,64 @@ export interface GeoProjection extends GeoStreamWrapper { */ fitSize(size: [number, number], object: ExtendedGeometryCollection): this; + /** + * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. + * + * @param width The width of the extent. + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). + */ + fitWidth(width: number, object: ExtendedFeature): this; + /** + * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. + * + * @param width The width of the extent. + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + */ + fitWidth(width: number, object: ExtendedFeatureCollection>): this; + /** + * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. + * + * @param width The width of the extent. + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). + */ + fitWidth(width: number, object: GeoGeometryObjects): this; + /** + * A convenience method for projection.fitSize where the height is automatically chosen from the aspect ratio of object and the given constraint on width. + * + * @param width The width of the extent. + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + */ + fitWidth(width: number, object: ExtendedGeometryCollection): this; + + /** + * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. + * + * @param height The height of the extent. + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). + */ + fitHeight(height: number, object: ExtendedFeature): this; + /** + * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. + * + * @param height The height of the extent. + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + */ + fitHeight(height: number, object: ExtendedFeatureCollection>): this; + /** + * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. + * + * @param height The height of the extent. + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). + */ + fitHeight(height: number, object: GeoGeometryObjects): this; + /** + * A convenience method for projection.fitSize where the width is automatically chosen from the aspect ratio of object and the given constraint on height. + * + * @param height The height of the extent. + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + */ + fitHeight(height: number, object: ExtendedGeometryCollection): this; + /** * Returns a new array [longitude, latitude] in degrees representing the unprojected point of the given projected point. * May return null if the specified point has no defined projected position, such as when the point is outside the clipping bounds of the projection. @@ -1551,3 +1644,32 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * Returns the identity transform which can be used to scale, translate and clip planar geometry. */ export function geoIdentity(): GeoIdentityTranform; + +// ---------------------------------------------------------------------- +// Clipping Functions +// ---------------------------------------------------------------------- + +/** + * A clipping function transforming a stream such that geometries (lines or polygons) that cross the antimeridian line are cut in two, one on each side. + * Typically used for pre-clipping. + */ +export const geoClipAntimeridian: ((stream: GeoStream) => GeoStream); + +/** + * Generates a clipping function transforming a stream such that geometries are bounded by a small circle of radius angle around the projection’s center. + * Typically used for pre-clipping. + * + * @param angle + */ +export function geoClipCircle(angle: number): (stream: GeoStream) => GeoStream; + +/** + * Generates a clipping function transforming a stream such that geometries are bounded by a rectangle of coordinates [[x0, y0], [x1, y1]]. + * Typically used for post-clipping. + * + * @param x0 x0 coordinate. + * @param y0 y0 coordinate. + * @param x1 x1 coordinate. + * @param y1 y1 coordinate. + */ +export function geoClipRectangle(x0: number, y0: number, x1: number, y1: number): (stream: GeoStream) => GeoStream; diff --git a/types/d3-geo/tsconfig.json b/types/d3-geo/tsconfig.json index e342102139..f3661c3ad2 100644 --- a/types/d3-geo/tsconfig.json +++ b/types/d3-geo/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-hexbin/tsconfig.json b/types/d3-hexbin/tsconfig.json index f46c9e304b..773221263b 100644 --- a/types/d3-hexbin/tsconfig.json +++ b/types/d3-hexbin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-hierarchy/tsconfig.json b/types/d3-hierarchy/tsconfig.json index 93d3ad11b7..7fbc1fb5df 100644 --- a/types/d3-hierarchy/tsconfig.json +++ b/types/d3-hierarchy/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-hsv/tsconfig.json b/types/d3-hsv/tsconfig.json index 0f872942fe..c92ce346b2 100644 --- a/types/d3-hsv/tsconfig.json +++ b/types/d3-hsv/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-interpolate/tsconfig.json b/types/d3-interpolate/tsconfig.json index bc1aa2f903..14435aff3d 100644 --- a/types/d3-interpolate/tsconfig.json +++ b/types/d3-interpolate/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-path/tsconfig.json b/types/d3-path/tsconfig.json index f9a1e4e0b9..5f3fa1ca3e 100644 --- a/types/d3-path/tsconfig.json +++ b/types/d3-path/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-polygon/tsconfig.json b/types/d3-polygon/tsconfig.json index 2a955a7956..79bd8a43b8 100644 --- a/types/d3-polygon/tsconfig.json +++ b/types/d3-polygon/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-quadtree/tsconfig.json b/types/d3-quadtree/tsconfig.json index ee764403c4..cbbb70a658 100644 --- a/types/d3-quadtree/tsconfig.json +++ b/types/d3-quadtree/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-queue/tsconfig.json b/types/d3-queue/tsconfig.json index a565283a30..72f00c11e5 100644 --- a/types/d3-queue/tsconfig.json +++ b/types/d3-queue/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-random/tsconfig.json b/types/d3-random/tsconfig.json index f9544a0527..a8db248667 100644 --- a/types/d3-random/tsconfig.json +++ b/types/d3-random/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "d3-random-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-request/tsconfig.json b/types/d3-request/tsconfig.json index c82a674e44..a52d00ffaa 100644 --- a/types/d3-request/tsconfig.json +++ b/types/d3-request/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-sankey/tsconfig.json b/types/d3-sankey/tsconfig.json index bd11293dc2..503145683b 100644 --- a/types/d3-sankey/tsconfig.json +++ b/types/d3-sankey/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "d3-sankey-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-scale-chromatic/tsconfig.json b/types/d3-scale-chromatic/tsconfig.json index 090fd4f242..6dda07c981 100644 --- a/types/d3-scale-chromatic/tsconfig.json +++ b/types/d3-scale-chromatic/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-scale/tsconfig.json b/types/d3-scale/tsconfig.json index d6361411a4..4fb09e2d39 100644 --- a/types/d3-scale/tsconfig.json +++ b/types/d3-scale/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-selection-multi/tsconfig.json b/types/d3-selection-multi/tsconfig.json index b5ef37ac44..7344010335 100644 --- a/types/d3-selection-multi/tsconfig.json +++ b/types/d3-selection-multi/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-selection/tsconfig.json b/types/d3-selection/tsconfig.json index 0b437cdda7..9dea0e1226 100644 --- a/types/d3-selection/tsconfig.json +++ b/types/d3-selection/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-shape/tsconfig.json b/types/d3-shape/tsconfig.json index d80ba9d5f0..0436aafd66 100644 --- a/types/d3-shape/tsconfig.json +++ b/types/d3-shape/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-time-format/d3-time-format-tests.ts b/types/d3-time-format/d3-time-format-tests.ts index eb569dd779..723f035cc0 100644 --- a/types/d3-time-format/d3-time-format-tests.ts +++ b/types/d3-time-format/d3-time-format-tests.ts @@ -37,21 +37,12 @@ parseFn = d3TimeFormat.utcParse('.%L'); // iso ------------------------------------------------------------------ const dateString: string = d3TimeFormat.isoFormat(new Date(2016, 6, 6)); -const date: Date = d3TimeFormat.isoParse('2016-07-08T14:06:41.386Z'); +const date: Date | null = d3TimeFormat.isoParse('2016-07-08T14:06:41.386Z'); // ---------------------------------------------------------------------- // Test Locale Definition // ---------------------------------------------------------------------- -const dateTimeSpecifier: string = localeDef.dateTime; -const dateSpecifier: string = localeDef.date; -const timeSpecifier: string = localeDef.time; -const periods: [string, string] = localeDef.periods; -const days: [string, string, string, string, string, string, string] = localeDef.days; -const shortDays: [string, string, string, string, string, string, string] = localeDef.shortDays; -const months: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.months; -const shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.shortMonths; - localeDef = { dateTime: '%a %b %e %X %Y', date: '%m/%d/%Y', @@ -63,12 +54,21 @@ localeDef = { shortMonths: ['Jan', 'Feb', 'Mrz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'] }; +const dateTimeSpecifier: string = localeDef.dateTime; +const dateSpecifier: string = localeDef.date; +const timeSpecifier: string = localeDef.time; +const periods: [string, string] = localeDef.periods; +const days: [string, string, string, string, string, string, string] = localeDef.days; +const shortDays: [string, string, string, string, string, string, string] = localeDef.shortDays; +const months: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.months; +const shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.shortMonths; + localeObj = d3TimeFormat.timeFormatLocale(localeDef); localeObj = d3TimeFormat.timeFormatDefaultLocale(localeDef); let formatFactory: (specifier: string) => ((date: Date) => string) = localeObj.format; -let parseFactory: (specifier: string) => ((dateString: string) => Date) = localeObj.parse; +let parseFactory: (specifier: string) => ((dateString: string) => Date | null) = localeObj.parse; formatFactory = localeObj.utcFormat; parseFactory = localeObj.utcParse; diff --git a/types/d3-time-format/index.d.ts b/types/d3-time-format/index.d.ts index 3d1cecf221..4ac6fc8469 100644 --- a/types/d3-time-format/index.d.ts +++ b/types/d3-time-format/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for d3JS d3-time-format module 2.0 +// Type definitions for d3JS d3-time-format module 2.1 // Project: https://github.com/d3/d3-time-format/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 2.0.2 +// Last module patch version validated against: 2.1.0 /** * Specification of time locale to use when creating a new TimeLocaleObject @@ -43,16 +43,103 @@ export interface TimeLocaleDefinition { shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string]; } +/** + * Interface describing a time-locale-based object which exposes time-formatting/parsing + * methods for a specified locale definition. + */ export interface TimeLocaleObject { + /** + * Returns a new formatter for the given string specifier. The specifier string may contain the following directives: + * - %a - abbreviated weekday name.* + * - %A - full weekday name.* + * - %b - abbreviated month name.* + * - %B - full month name.* + * - %c - the locale’s date and time, such as %x, %X.* + * - %d - zero-padded day of the month as a decimal number [01,31]. + * - %e - space-padded day of the month as a decimal number [ 1,31]; equivalent to %_d. + * - %f - microseconds as a decimal number [000000, 999999]. + * - %H - hour (24-hour clock) as a decimal number [00,23]. + * - %I - hour (12-hour clock) as a decimal number [01,12]. + * - %j - day of the year as a decimal number [001,366]. + * - %m - month as a decimal number [01,12]. + * - %M - minute as a decimal number [00,59]. + * - %L - milliseconds as a decimal number [000, 999]. + * - %p - either AM or PM.* + * - %Q - milliseconds since UNIX epoch. + * - %s - seconds since UNIX epoch. + * - %S - second as a decimal number [00,61]. + * - %u - Monday-based (ISO) weekday as a decimal number [1,7]. + * - %U - Sunday-based week of the year as a decimal number [00,53]. + * - %V - ISO 8601 week number of the year as a decimal number [01, 53]. + * - %w - Sunday-based weekday as a decimal number [0,6]. + * - %W - Monday-based week of the year as a decimal number [00,53]. + * - %x - the locale’s date, such as %-m/%-d/%Y.* + * - %X - the locale’s time, such as %-I:%M:%S %p.* + * - %y - year without century as a decimal number [00,99]. + * - %Y - year with century as a decimal number. + * - %Z - time zone offset, such as -0700, -07:00, -07, or Z. + * - %% - a literal percent sign (%). + * + * Directives marked with an asterisk (*) may be affected by the locale definition. + * + * For %U, all days in a new year preceding the first Sunday are considered to be in week 0. + * For %W, all days in a new year preceding the first Monday are considered to be in week 0. + * Week numbers are computed using interval.count. For example, 2015-52 and 2016-00 represent Monday, December 28, 2015, while 2015-53 and 2016-01 represent Monday, January 4, 2016. + * This differs from the ISO week date specification (%V), which uses a more complicated definition! + * + * For %V, per the strftime man page: + * + * In this system, weeks start on a Monday, and are numbered from 01, for the first week, up to 52 or 53, for the last week. + * Week 1 is the first week where four or more days fall within the new year (or, synonymously, week 01 is: the first week of the year that contains a Thursday; + * or, the week that has 4 January in it). + * + * The % sign indicating a directive may be immediately followed by a padding modifier: + * + * 1) 0 - zero-padding + * 2) _ - space-padding + * 3) - disable padding + * + * If no padding modifier is specified, the default is 0 for all directives except %e, which defaults to _. + * (In some implementations of strftime and strptime, a directive may include an optional field width or precision; this feature is not yet implemented.) + * + * The returned function formats a specified date, returning the corresponding string. + * + * @param specifier A specifier string for the date format. + */ format(specifier: string): (date: Date) => string; + /** + * Returns a new parser for the given string specifier. The specifier string may contain the same directives as locale.format (TimeLocaleObject.format). + * The %d and %e directives are considered equivalent for parsing. + * + * The returned function parses a specified string, returning the corresponding date or null if the string could not be parsed according to this format’s specifier. + * Parsing is strict: if the specified string does not exactly match the associated specifier, this method returns null. + * + * For example, if the associated specifier is %Y-%m-%dT%H:%M:%SZ, then the string "2011-07-01T19:15:28Z" will be parsed as expected, + * but "2011-07-01T19:15:28", "2011-07-01 19:15:28" and "2011-07-01" will return null. (Note that the literal Z here is different from the time zone offset directive %Z.) + * If a more flexible parser is desired, try multiple formats sequentially until one returns non-null. + * + * @param specifier A specifier string for the date format. + */ parse(specifier: string): (dateString: string) => (Date | null); + /** + * Equivalent to locale.format (TimeLocaleObject.format), except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * @param specifier A specifier string for the date format. + */ utcFormat(specifier: string): (date: Date) => string; + /** + * Equivalent to locale.parse (TimeLocaleObject.parse), except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * @param specifier A specifier string for the date format. + */ utcParse(specifier: string): (dateString: string) => (Date | null); } /** * Create a new time-locale-based object which exposes time-formatting * methods for the specified locale definition. + * + * @param timeLocale A time locale definition. */ export function timeFormatLocale(timeLocale: TimeLocaleDefinition): TimeLocaleObject; @@ -60,17 +147,58 @@ export function timeFormatLocale(timeLocale: TimeLocaleDefinition): TimeLocaleOb * Create a new time-locale-based object which exposes time-formatting * methods for the specified locale definition. The new time locale definition * will be set as the new default time locale. + * + * @param timeLocale A time locale definition. */ export function timeFormatDefaultLocale(defaultTimeLocale: TimeLocaleDefinition): TimeLocaleObject; +/** + * Returns a new formatter for the given string specifier. The returned function formats a specified date, returning the corresponding string. + * + * An alias for locale.format (TimeLocaleObject.format) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function timeFormat(specifier: string): (date: Date) => string; +/** + * Returns a new parser for the given string specifier. + * + * An alias for locale.parse (TimeLocaleObject.parse) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function timeParse(specifier: string): (dateString: string) => (Date | null); +/** + * Equivalent to timeFormat, except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * An alias for locale.utcFormat (TimeLocaleObject.utcFormat) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function utcFormat(specifier: string): (date: Date) => string; +/** + * Equivalent to timeParse, except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * An alias for locale.utcParse (TimeLocaleObject.utcParse) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function utcParse(specifier: string): (dateString: string) => (Date | null); +/** + * The full ISO 8601 UTC time formatter. Where available, this method will use Date.toISOString to format. + * + * @param date A date to format. + */ export function isoFormat(date: Date): string; -export function isoParse(dateString: string): Date; +/** + * The full ISO 8601 UTC time parser. Where available, this method will use the Date constructor to parse strings. + * If you depend on strict validation of the input format according to ISO 8601, you should construct a UTC parser function using utcParse. + * + * @param dateString A string encoded date to parse. + */ +export function isoParse(dateString: string): Date | null; diff --git a/types/d3-time-format/tsconfig.json b/types/d3-time-format/tsconfig.json index 2f6f2ab56a..782a3ab291 100644 --- a/types/d3-time-format/tsconfig.json +++ b/types/d3-time-format/tsconfig.json @@ -6,7 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "d3-time-format-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/d3-time/tsconfig.json b/types/d3-time/tsconfig.json index 37ad648870..963c0df157 100644 --- a/types/d3-time/tsconfig.json +++ b/types/d3-time/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-timer/tsconfig.json b/types/d3-timer/tsconfig.json index bd1369fa5d..f3af0c7d8e 100644 --- a/types/d3-timer/tsconfig.json +++ b/types/d3-timer/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-tip/tsconfig.json b/types/d3-tip/tsconfig.json index 8ac2d487e9..8bd5f064c9 100644 --- a/types/d3-tip/tsconfig.json +++ b/types/d3-tip/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/d3-transition/tsconfig.json b/types/d3-transition/tsconfig.json index ae927077dc..f23a386a94 100644 --- a/types/d3-transition/tsconfig.json +++ b/types/d3-transition/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-voronoi/tsconfig.json b/types/d3-voronoi/tsconfig.json index 473b2a139d..ada834dec3 100644 --- a/types/d3-voronoi/tsconfig.json +++ b/types/d3-voronoi/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index 02f7120e79..8ff3f566f5 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -135,6 +135,24 @@ svgZoom = svgZoom.filter(function(d, i, group) { let filterFn: (this: SVGRectElement, d: SVGDatum, index: number, group: SVGRectElement[]) => boolean; filterFn = svgZoom.filter(); +// set and get touchable --------------------------------------------------------- + +let touchableFn: (this: SVGRectElement, d: SVGDatum, index: number, group: SVGRectElement[]) => boolean; + +// chainable + +svgZoom = svgZoom.touchable(true); + +svgZoom = svgZoom.touchable(function(d, i, group) { + const that: SVGRectElement = this; + const datum: SVGDatum = d; + const g: SVGRectElement[] | NodeListOf = group; + return "ontouchstart" in this && datum.height > 0; +}); + +// getter +touchableFn = svgZoom.touchable(); + // wheelDelta() ---------------------------------------------------------------- // chainable diff --git a/types/d3-zoom/index.d.ts b/types/d3-zoom/index.d.ts index a633644ded..1ca39261a5 100644 --- a/types/d3-zoom/index.d.ts +++ b/types/d3-zoom/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for d3JS d3-zoom module 1.5 +// Type definitions for d3JS d3-zoom module 1.6 // Project: https://github.com/d3/d3-zoom/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.5.0 +// Last module patch version validated against: 1.6.0 import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; import { ZoomView, ZoomInterpolator } from 'd3-interpolate'; @@ -517,6 +517,34 @@ export interface ZoomBehavior): this; + /** + * Returns the current touch support detector, which defaults to a function returning true, + * if the "ontouchstart" event is supported on the current element. + */ + touchable(): ValueFn; + /** + * Sets the touch support detector to the specified boolean value and returns the zoom behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false. + */ + touchable(touchable: boolean): this; + /** + * Sets the touch support detector to the specified function and returns the zoom behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element. + * The function is evaluated for each selected element to which the zoom behavior was applied, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value. + */ + touchable(touchable: ValueFn): this; + /** * Returns the current wheelDelta function. */ diff --git a/types/d3-zoom/tsconfig.json b/types/d3-zoom/tsconfig.json index 5513e1328f..ed184bf861 100644 --- a/types/d3-zoom/tsconfig.json +++ b/types/d3-zoom/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3.cloud.layout/tsconfig.json b/types/d3.cloud.layout/tsconfig.json index 39eb337ea0..ffb26214cc 100644 --- a/types/d3.cloud.layout/tsconfig.json +++ b/types/d3.cloud.layout/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/d3.slider/tsconfig.json b/types/d3.slider/tsconfig.json index 48b49c9a2d..a2a0a2c0c7 100644 --- a/types/d3.slider/tsconfig.json +++ b/types/d3.slider/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/d3/index.d.ts b/types/d3/index.d.ts index 1a17c3acca..6cfb1aa493 100644 --- a/types/d3/index.d.ts +++ b/types/d3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3 standard bundle 4.10 +// Type definitions for D3JS d3 standard bundle 4.11 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/d3/tsconfig.json b/types/d3/tsconfig.json index 03db6e8b39..8ec0a8e64e 100644 --- a/types/d3/tsconfig.json +++ b/types/d3/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3/v3/tsconfig.json b/types/d3/v3/tsconfig.json index b6c46bd8cf..dd4cea8078 100644 --- a/types/d3/v3/tsconfig.json +++ b/types/d3/v3/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/d3kit/tsconfig.json b/types/d3kit/tsconfig.json index e1c744e180..40e266f6f9 100644 --- a/types/d3kit/tsconfig.json +++ b/types/d3kit/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3kit/v1/tsconfig.json b/types/d3kit/v1/tsconfig.json index b44561f414..f2112d2661 100644 --- a/types/d3kit/v1/tsconfig.json +++ b/types/d3kit/v1/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/d3pie/tsconfig.json b/types/d3pie/tsconfig.json index 1861cb7f31..c654f02557 100644 --- a/types/d3pie/tsconfig.json +++ b/types/d3pie/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dagre-d3/tsconfig.json b/types/dagre-d3/tsconfig.json index 438fca5ff3..584a8cc848 100644 --- a/types/dagre-d3/tsconfig.json +++ b/types/dagre-d3/tsconfig.json @@ -8,13 +8,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/dagre-layout/dagre-layout-tests.ts b/types/dagre-layout/dagre-layout-tests.ts new file mode 100644 index 0000000000..4a6e787496 --- /dev/null +++ b/types/dagre-layout/dagre-layout-tests.ts @@ -0,0 +1,10 @@ +import * as dagre from "dagre-layout"; + +const graph = new dagre.graphlib.Graph(); +graph.setGraph({}) + .setDefaultEdgeLabel(() => ({})) + .setNode("a", {}) + .setEdge("b", "c") + .setEdge("c", "d", {class: "class"}); + +dagre.layout(graph); diff --git a/types/dagre-layout/index.d.ts b/types/dagre-layout/index.d.ts new file mode 100644 index 0000000000..71361331de --- /dev/null +++ b/types/dagre-layout/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for dagre-layout 0.8 +// Project: https://github.com/tylingsoft/dagre-layout#readme +// Definitions by: Qinfeng Chen +// Lisa Vallfors +// Pete Vilter +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +// copied from definitions for dagre, since dagre-layout is a drop-in replacement + +export namespace graphlib { + class Graph { + edges(): Edge[]; + edge(id: any): any; + nodes(): string[]; + node(id: any): any; + setDefaultEdgeLabel(callback: string|(() => string|object)): Graph; + setDefaultNodeLabel(callback: string|(() => string|object)): Graph; + setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }, value?: string): Graph; + setEdge(params: {v: string, w: string, name?: string}, value?: string): Graph; + setGraph(label: GraphLabel): Graph; + setNode(id: string, node: { [key: string]: any }): Graph; + graph(): GraphLabel; + + constructor(opt?: {directed?: boolean, multigraph?: boolean, compound?: boolean}); + setParent(name: string, parentName: string): void; + hasNode(name: string): boolean; + } +} + +export interface GraphLabel { + width?: number; + height?: number; + compound?: boolean; + rankdir?: string; + align?: string; + nodesep?: number; + edgesep?: number; + ranksep?: number; + marginx?: number; + marginy?: number; + acyclicer?: string; + ranker?: string; +} + +export function layout(graph: graphlib.Graph): void; + +export interface Edge { + v: string; + w: string; + name?: string; +} diff --git a/types/dagre-layout/tsconfig.json b/types/dagre-layout/tsconfig.json new file mode 100644 index 0000000000..12bfb07f57 --- /dev/null +++ b/types/dagre-layout/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dagre-layout-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dagre-layout/tslint.json b/types/dagre-layout/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dagre-layout/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dagre/tsconfig.json b/types/dagre/tsconfig.json index 1a54cc4b6b..b5802bd42e 100644 --- a/types/dagre/tsconfig.json +++ b/types/dagre/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dargs/tsconfig.json b/types/dargs/tsconfig.json index fd5bee5051..88aef9d923 100644 --- a/types/dargs/tsconfig.json +++ b/types/dargs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "dargs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dat-gui/tsconfig.json b/types/dat-gui/tsconfig.json index 038e9528ad..4961272694 100644 --- a/types/dat-gui/tsconfig.json +++ b/types/dat-gui/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/data-driven/tsconfig.json b/types/data-driven/tsconfig.json index 1215731ac2..7e3cb6a15c 100644 --- a/types/data-driven/tsconfig.json +++ b/types/data-driven/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/datadog-metrics/tsconfig.json b/types/datadog-metrics/tsconfig.json index fa2f86a32e..ca3613429a 100644 --- a/types/datadog-metrics/tsconfig.json +++ b/types/datadog-metrics/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "datadog-metrics-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/datatables.net-buttons/tsconfig.json b/types/datatables.net-buttons/tsconfig.json index 5e407ab2d8..3e8d4ce82c 100644 --- a/types/datatables.net-buttons/tsconfig.json +++ b/types/datatables.net-buttons/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/datatables.net-fixedheader/tsconfig.json b/types/datatables.net-fixedheader/tsconfig.json index e681e2d722..5c747aa854 100644 --- a/types/datatables.net-fixedheader/tsconfig.json +++ b/types/datatables.net-fixedheader/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/datatables.net-rowreorder/tsconfig.json b/types/datatables.net-rowreorder/tsconfig.json index c0b35cadfe..c16752cd22 100644 --- a/types/datatables.net-rowreorder/tsconfig.json +++ b/types/datatables.net-rowreorder/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/datatables.net-select/tsconfig.json b/types/datatables.net-select/tsconfig.json index 927e663144..50398d173e 100644 --- a/types/datatables.net-select/tsconfig.json +++ b/types/datatables.net-select/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/datatables.net/tsconfig.json b/types/datatables.net/tsconfig.json index b48881c33b..04972add17 100644 --- a/types/datatables.net/tsconfig.json +++ b/types/datatables.net/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/date-arithmetic/date-arithmetic-tests.ts b/types/date-arithmetic/date-arithmetic-tests.ts new file mode 100644 index 0000000000..509551dd92 --- /dev/null +++ b/types/date-arithmetic/date-arithmetic-tests.ts @@ -0,0 +1,21 @@ +import dateArithmetic = require('dateArithmetic'); + +dateArithmetic.add(new Date(2010, 7, 23), 2, 'second'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'minutes'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'hours'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'day'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'week'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'month'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'year'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'decade'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'century'); + +dateArithmetic.subtract(new Date(2010, 7, 30), 1, 'second'); +dateArithmetic.subtract(new Date(2010, 7, 29), 2, 'minutes'); +dateArithmetic.subtract(new Date(2010, 7, 28), 3, 'hours'); +dateArithmetic.subtract(new Date(2010, 7, 27), 4, 'day'); +dateArithmetic.subtract(new Date(2010, 7, 26), 5, 'week'); +dateArithmetic.subtract(new Date(2010, 7, 24), 6, 'month'); +dateArithmetic.subtract(new Date(2010, 7, 23), 7, 'year'); +dateArithmetic.subtract(new Date(2010, 7, 22), 8, 'decade'); +dateArithmetic.subtract(new Date(2010, 7, 21), 9, 'century'); diff --git a/types/date-arithmetic/index.d.ts b/types/date-arithmetic/index.d.ts new file mode 100644 index 0000000000..ad669fd523 --- /dev/null +++ b/types/date-arithmetic/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for date-arithmetic v3.1.0 +// Project: https://github.com/jquense/date-math +// Definitions by: Sergii Paryzhskyi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Unit = 'second' | 'minutes' | 'hours' | 'day' | 'week' | 'month' | 'year' | 'decade' | 'century'; + +/** dateArithmetic Public Instance Methods */ +interface dateArithmeticStatic { + /** Add specified amount of units to a provided date and return new date as a result */ + add(date: Date, num: number, unit: Unit): Date; + + /** Subtract specified amount of units from a provided date and return new date as a result */ + subtract(date: Date, num: number, unit: Unit): Date; +} + +declare module 'dateArithmetic' { + const dateArithmetic: dateArithmeticStatic; + export = dateArithmetic; +} diff --git a/types/mqtt/tsconfig.json b/types/date-arithmetic/tsconfig.json similarity index 85% rename from types/mqtt/tsconfig.json rename to types/date-arithmetic/tsconfig.json index 4d8e6cef5d..d8942e343c 100644 --- a/types/mqtt/tsconfig.json +++ b/types/date-arithmetic/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -17,6 +18,6 @@ }, "files": [ "index.d.ts", - "mqtt-tests.ts" + "date-arithmetic-tests.ts" ] } \ No newline at end of file diff --git a/types/date.format.js/tsconfig.json b/types/date.format.js/tsconfig.json index 934970a7d4..a7a5e7f404 100644 --- a/types/date.format.js/tsconfig.json +++ b/types/date.format.js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dateformat/tsconfig.json b/types/dateformat/tsconfig.json index afd0e9fcaa..1c5fc06611 100644 --- a/types/dateformat/tsconfig.json +++ b/types/dateformat/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/datejs/tsconfig.json b/types/datejs/tsconfig.json index 853a92665e..5d17ca2da9 100644 --- a/types/datejs/tsconfig.json +++ b/types/datejs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/daterangepicker/tsconfig.json b/types/daterangepicker/tsconfig.json index 51177c8463..1ed4157bc7 100644 --- a/types/daterangepicker/tsconfig.json +++ b/types/daterangepicker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/db-migrate-base/tsconfig.json b/types/db-migrate-base/tsconfig.json index 1460e014b5..f4c835bb88 100644 --- a/types/db-migrate-base/tsconfig.json +++ b/types/db-migrate-base/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/db-migrate-pg/tsconfig.json b/types/db-migrate-pg/tsconfig.json index edf3e0d8c1..c63efcd105 100644 --- a/types/db-migrate-pg/tsconfig.json +++ b/types/db-migrate-pg/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/db.js/tsconfig.json b/types/db.js/tsconfig.json index 456eee6635..75989af0b3 100644 --- a/types/db.js/tsconfig.json +++ b/types/db.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dc/tsconfig.json b/types/dc/tsconfig.json index d9a65d56dd..863d600736 100644 --- a/types/dc/tsconfig.json +++ b/types/dc/tsconfig.json @@ -12,13 +12,16 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "paths": { - "d3": ["d3/v3"] + "d3": [ + "d3/v3" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/deasync/tsconfig.json b/types/deasync/tsconfig.json index 5b96318954..d61004bac3 100644 --- a/types/deasync/tsconfig.json +++ b/types/deasync/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "deasync-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/debessmann/tsconfig.json b/types/debessmann/tsconfig.json index 745457f1b5..b8b4c01d06 100644 --- a/types/debessmann/tsconfig.json +++ b/types/debessmann/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "debessmann-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/debounce/tsconfig.json b/types/debounce/tsconfig.json index 729b1c0024..bf08d46e44 100644 --- a/types/debounce/tsconfig.json +++ b/types/debounce/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/debug/tsconfig.json b/types/debug/tsconfig.json index 5788679d0f..7caca45f35 100644 --- a/types/debug/tsconfig.json +++ b/types/debug/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/decamelize/tsconfig.json b/types/decamelize/tsconfig.json index 31205a3949..54bea1b020 100644 --- a/types/decamelize/tsconfig.json +++ b/types/decamelize/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "decamelize-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/decay/tsconfig.json b/types/decay/tsconfig.json index 6169ec4e18..d35511f505 100644 --- a/types/decay/tsconfig.json +++ b/types/decay/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "decay-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/decimal.js/tsconfig.json b/types/decimal.js/tsconfig.json index dd07e5cf8b..e2474fecd5 100644 --- a/types/decimal.js/tsconfig.json +++ b/types/decimal.js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/decompress/decompress-tests.ts b/types/decompress/decompress-tests.ts new file mode 100644 index 0000000000..3df7df0219 --- /dev/null +++ b/types/decompress/decompress-tests.ts @@ -0,0 +1,21 @@ +import decompress = require('decompress'); +import * as path from "path"; + +decompress('unicorn.zip', 'dist').then(files => { + console.log('done!'); +}); + +decompress('unicorn.zip', 'dist', { + filter: file => path.extname(file.path) !== '.exe' +}).then(files => { + console.log('done!'); +}); + +decompress('unicorn.zip', 'dist', { + map: file => { + file.path = `unicorn-${file.path}`; + return file; + } +}).then(files => { + console.log('done!'); +}); diff --git a/types/decompress/index.d.ts b/types/decompress/index.d.ts new file mode 100644 index 0000000000..c2211b3434 --- /dev/null +++ b/types/decompress/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for decompress 4.2 +// Project: https://github.com/kevva/decompress#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = decompress; + +declare function decompress(input: string | Buffer, output: string, opts?: Options): Promise; + +interface File { + data: Buffer; + mode: number; + mtime: string; + path: string; + type: string; +} + +interface Options { + /** + * Filter out files before extracting + */ + filter?(file: File): boolean; + /** + * Map files before extracting + */ + map?(file: File): File; + /** + * Array of plugins to use. + * Default: [decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()] + */ + plugins?: any[]; + /** + * Remove leading directory components from extracted files. + * Default: 0 + */ + strip?: number; +} diff --git a/types/decompress/tsconfig.json b/types/decompress/tsconfig.json new file mode 100644 index 0000000000..33c7a8c5e8 --- /dev/null +++ b/types/decompress/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "decompress-tests.ts" + ] +} diff --git a/types/decompress/tslint.json b/types/decompress/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/decompress/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/decorum/tsconfig.json b/types/decorum/tsconfig.json index d8af61c395..82792e10c5 100644 --- a/types/decorum/tsconfig.json +++ b/types/decorum/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "experimentalDecorators": true, "typeRoots": [ diff --git a/types/dedent/tsconfig.json b/types/dedent/tsconfig.json index 29eb7040b0..30c39b0a23 100644 --- a/types/dedent/tsconfig.json +++ b/types/dedent/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "dedent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/deep-assign/tsconfig.json b/types/deep-assign/tsconfig.json index 6ad0581691..76d4b1b23e 100644 --- a/types/deep-assign/tsconfig.json +++ b/types/deep-assign/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deep-diff/tsconfig.json b/types/deep-diff/tsconfig.json index 9548124d65..95cd2d22ac 100644 --- a/types/deep-diff/tsconfig.json +++ b/types/deep-diff/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deep-equal/tsconfig.json b/types/deep-equal/tsconfig.json index 6d21a4a7e6..e5c20aa772 100644 --- a/types/deep-equal/tsconfig.json +++ b/types/deep-equal/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deep-extend/tsconfig.json b/types/deep-extend/tsconfig.json index 9b7dc83a56..c41646d000 100644 --- a/types/deep-extend/tsconfig.json +++ b/types/deep-extend/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deep-freeze-es6/tsconfig.json b/types/deep-freeze-es6/tsconfig.json index ba72d75a31..cf9a3b32f5 100644 --- a/types/deep-freeze-es6/tsconfig.json +++ b/types/deep-freeze-es6/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "deep-freeze-es6-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/deep-freeze-strict/tsconfig.json b/types/deep-freeze-strict/tsconfig.json index 3bc13b0278..abf333c6bf 100644 --- a/types/deep-freeze-strict/tsconfig.json +++ b/types/deep-freeze-strict/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deep-freeze/tsconfig.json b/types/deep-freeze/tsconfig.json index 5ade4f533c..3fe6438f96 100644 --- a/types/deep-freeze/tsconfig.json +++ b/types/deep-freeze/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deepmerge/tsconfig.json b/types/deepmerge/tsconfig.json index 587ab97438..b863d1bcb9 100644 --- a/types/deepmerge/tsconfig.json +++ b/types/deepmerge/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/defaults/tsconfig.json b/types/defaults/tsconfig.json index 3c689ee2fd..4a66176c28 100644 --- a/types/defaults/tsconfig.json +++ b/types/defaults/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/define-lazy-prop/tsconfig.json b/types/define-lazy-prop/tsconfig.json index 3a5611afb1..e72c943c52 100644 --- a/types/define-lazy-prop/tsconfig.json +++ b/types/define-lazy-prop/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "define-lazy-prop-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/defined/tsconfig.json b/types/defined/tsconfig.json index 63c6202b4c..35b5bb7c83 100644 --- a/types/defined/tsconfig.json +++ b/types/defined/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "defined-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/deku/tsconfig.json b/types/deku/tsconfig.json index 44bbb18182..ad8473665d 100644 --- a/types/deku/tsconfig.json +++ b/types/deku/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/del/tsconfig.json b/types/del/tsconfig.json index ba10982e67..6143d08346 100644 --- a/types/del/tsconfig.json +++ b/types/del/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "del-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/del/v2/tsconfig.json b/types/del/v2/tsconfig.json index 4ec5576309..568d1a8a21 100644 --- a/types/del/v2/tsconfig.json +++ b/types/del/v2/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "del": ["del/v2"] + "del": [ + "del/v2" + ] }, "types": [], "noEmit": true, @@ -22,4 +25,4 @@ "index.d.ts", "del-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/delaunator/tsconfig.json b/types/delaunator/tsconfig.json index 438b1c53af..a9c94600d8 100644 --- a/types/delaunator/tsconfig.json +++ b/types/delaunator/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "delaunator-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/delay/tsconfig.json b/types/delay/tsconfig.json index 2004ba50ba..cb0da53652 100644 --- a/types/delay/tsconfig.json +++ b/types/delay/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "delay-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/denodeify/tsconfig.json b/types/denodeify/tsconfig.json index 39e2a69ba3..04d0008cd5 100644 --- a/types/denodeify/tsconfig.json +++ b/types/denodeify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/deoxxa-content-type/tsconfig.json b/types/deoxxa-content-type/tsconfig.json index 31d7604887..5f50fa4676 100644 --- a/types/deoxxa-content-type/tsconfig.json +++ b/types/deoxxa-content-type/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/depd/tsconfig.json b/types/depd/tsconfig.json index 23aa25d9e0..cea39d4996 100644 --- a/types/depd/tsconfig.json +++ b/types/depd/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "depd-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/deployjava/tsconfig.json b/types/deployjava/tsconfig.json index e0a37b8c86..934531a4ee 100644 --- a/types/deployjava/tsconfig.json +++ b/types/deployjava/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/destroy-on-hwm/tsconfig.json b/types/destroy-on-hwm/tsconfig.json index 9bcad7ee9b..8f77b1b9a4 100644 --- a/types/destroy-on-hwm/tsconfig.json +++ b/types/destroy-on-hwm/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "destroy-on-hwm-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/destroy/tsconfig.json b/types/destroy/tsconfig.json index 197ac0c669..d3c5ca771d 100644 --- a/types/destroy/tsconfig.json +++ b/types/destroy/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "destroy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-browser/tsconfig.json b/types/detect-browser/tsconfig.json index 300222b307..076582077e 100644 --- a/types/detect-browser/tsconfig.json +++ b/types/detect-browser/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/detect-hover/tsconfig.json b/types/detect-hover/tsconfig.json index d971a2660d..69abd062cd 100644 --- a/types/detect-hover/tsconfig.json +++ b/types/detect-hover/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-hover-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-indent/tsconfig.json b/types/detect-indent/tsconfig.json index 07d6d5adc2..3119632150 100644 --- a/types/detect-indent/tsconfig.json +++ b/types/detect-indent/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-indent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-indent/v0/tsconfig.json b/types/detect-indent/v0/tsconfig.json index f80769f598..6fb921c298 100644 --- a/types/detect-indent/v0/tsconfig.json +++ b/types/detect-indent/v0/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "detect-indent": ["detect-indent/v0"] + "detect-indent": [ + "detect-indent/v0" + ] }, "types": [], "noEmit": true, @@ -22,4 +25,4 @@ "index.d.ts", "detect-indent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-it/tsconfig.json b/types/detect-it/tsconfig.json index 16c8ccd62b..28787b09b8 100644 --- a/types/detect-it/tsconfig.json +++ b/types/detect-it/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-it-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-newline/tsconfig.json b/types/detect-newline/tsconfig.json index bbb57f1823..a94c517f93 100644 --- a/types/detect-newline/tsconfig.json +++ b/types/detect-newline/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-newline-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-passive-events/tsconfig.json b/types/detect-passive-events/tsconfig.json index c79e68ee75..83ddf05856 100644 --- a/types/detect-passive-events/tsconfig.json +++ b/types/detect-passive-events/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-passive-events-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-pointer/tsconfig.json b/types/detect-pointer/tsconfig.json index 96115ec503..50b7d6cb7d 100644 --- a/types/detect-pointer/tsconfig.json +++ b/types/detect-pointer/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-pointer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/detect-port/tsconfig.json b/types/detect-port/tsconfig.json index dde5cf6683..9d400580a4 100644 --- a/types/detect-port/tsconfig.json +++ b/types/detect-port/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/detect-touch-events/tsconfig.json b/types/detect-touch-events/tsconfig.json index 018928fa50..03b3cc49cb 100644 --- a/types/detect-touch-events/tsconfig.json +++ b/types/detect-touch-events/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "detect-touch-events-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/devexpress-web/tsconfig.json b/types/devexpress-web/tsconfig.json index e879af1e9e..3510853ddd 100644 --- a/types/devexpress-web/tsconfig.json +++ b/types/devexpress-web/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/devexpress-web/v161/tsconfig.json b/types/devexpress-web/v161/tsconfig.json index a64418f9b0..0c6ad80e42 100644 --- a/types/devexpress-web/v161/tsconfig.json +++ b/types/devexpress-web/v161/tsconfig.json @@ -8,14 +8,19 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "types": [], "paths": { - "devexpress-web": ["devexpress-web/v161"], - "devexpress-web/*": ["devexpress-web/v161/*"] + "devexpress-web": [ + "devexpress-web/v161" + ], + "devexpress-web/*": [ + "devexpress-web/v161/*" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/devexpress-web/v162/tsconfig.json b/types/devexpress-web/v162/tsconfig.json index 7014b0435c..0878906afb 100644 --- a/types/devexpress-web/v162/tsconfig.json +++ b/types/devexpress-web/v162/tsconfig.json @@ -8,14 +8,19 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "types": [], "paths": { - "devexpress-web": ["devexpress-web/v162"], - "devexpress-web/*": ["devexpress-web/v162/*"] + "devexpress-web": [ + "devexpress-web/v162" + ], + "devexpress-web/*": [ + "devexpress-web/v162/*" + ] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/devtools-detect/tsconfig.json b/types/devtools-detect/tsconfig.json index b19e809c08..8ab64cb68c 100644 --- a/types/devtools-detect/tsconfig.json +++ b/types/devtools-detect/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/df-visible/tsconfig.json b/types/df-visible/tsconfig.json index 6f73878f77..ca15676b02 100644 --- a/types/df-visible/tsconfig.json +++ b/types/df-visible/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dhtmlxgantt/tsconfig.json b/types/dhtmlxgantt/tsconfig.json index da8ed7891b..f897e58d02 100644 --- a/types/dhtmlxgantt/tsconfig.json +++ b/types/dhtmlxgantt/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dhtmlxscheduler/tsconfig.json b/types/dhtmlxscheduler/tsconfig.json index cd3877fced..8d145fb613 100644 --- a/types/dhtmlxscheduler/tsconfig.json +++ b/types/dhtmlxscheduler/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/di-lite/tsconfig.json b/types/di-lite/tsconfig.json index 7ec26b6dde..7f10ef8967 100644 --- a/types/di-lite/tsconfig.json +++ b/types/di-lite/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/diacritics/tsconfig.json b/types/diacritics/tsconfig.json index c5df557fe5..03b49dbe95 100644 --- a/types/diacritics/tsconfig.json +++ b/types/diacritics/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/diff-match-patch/diff-match-patch-tests.ts b/types/diff-match-patch/diff-match-patch-tests.ts index 9226d7be4a..0f2af4451a 100644 --- a/types/diff-match-patch/diff-match-patch-tests.ts +++ b/types/diff-match-patch/diff-match-patch-tests.ts @@ -1,31 +1,261 @@ +import * as DiffMatchPatch from 'diff-match-patch'; -import DiffMatchPatch = require("diff-match-patch"); +function testDiffMainEach() { + const oldValue = "hello world, how are you?"; + const newValue = "hello again world. how have you been?"; -var oldValue = "hello world, how are you?"; -var newValue = "hello again world. how have you been?"; + const diffEngine = new DiffMatchPatch.diff_match_patch(); + const diffs = diffEngine.diff_main(oldValue, newValue); + diffEngine.diff_cleanupSemantic(diffs); -var diffEngine = new DiffMatchPatch.diff_match_patch(); -var diffs = diffEngine.diff_main(oldValue, newValue); -diffEngine.diff_cleanupSemantic(diffs); + let changes = ""; + let pattern = ""; -var changes = ""; -var pattern = ""; + diffs.forEach((diff) => { + const operation = diff[0]; // Operation (insert, delete, equal) + const text = diff[1]; // Text of change -diffs.forEach(function(diff) { - var operation = diff[0]; // Operation (insert, delete, equal) - var text = diff[1]; // Text of change - - switch (operation) { - case DiffMatchPatch.DIFF_INSERT: - pattern += "I"; - break; - case DiffMatchPatch.DIFF_DELETE: - pattern += "D"; - break; - case DiffMatchPatch.DIFF_EQUAL: - pattern += "E"; - break; - } + switch (operation) { + case DiffMatchPatch.DIFF_INSERT: + pattern += "I"; + break; + case DiffMatchPatch.DIFF_DELETE: + pattern += "D"; + break; + case DiffMatchPatch.DIFF_EQUAL: + pattern += "E"; + break; + } - changes += text; -}); + changes += text; + }); +} + +const DIFF_DELETE: number = DiffMatchPatch.DIFF_DELETE; +const DIFF_INSERT: number = DiffMatchPatch.DIFF_INSERT; +const DIFF_EQUAL: number = DiffMatchPatch.DIFF_EQUAL; +const dmp = new DiffMatchPatch.diff_match_patch(); + +// DIFF TEST FUNCTIONS + +function testDiffCommonPrefix() { + assertEquals(0, dmp.diff_commonPrefix('abc', 'xyz')); +} + +function testDiffCommonSuffix() { + assertEquals(0, dmp.diff_commonSuffix('abc', 'xyz')); +} + +function testDiffCommonOverlap() { + assertEquals(0, dmp.diff_commonOverlap_('', 'abcd')); +} + +function testDiffHalfMatch() { + dmp.Diff_Timeout = 1; + + assertEquals(null, dmp.diff_halfMatch_('1234567890', 'abcdef')); + + assertEquivalent(['12', '90', 'a', 'z', '345678'], dmp.diff_halfMatch_('1234567890', 'a345678z')); + + assertEquivalent(['12123', '123121', 'a', 'z', '1234123451234'], dmp.diff_halfMatch_('121231234123451234123121', 'a1234123451234z')); +} + +function testDiffLinesToChars() { + assertLinesToCharsResultEquals({chars1: '\x01\x02\x01', chars2: '\x02\x01\x02', lineArray: ['', 'alpha\n', 'beta\n']}, dmp.diff_linesToChars_('alpha\nbeta\nalpha\n', 'beta\nalpha\nbeta\n')); +} + +function testDiffCharsToLines() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, '\x01\x02\x01'], [DIFF_INSERT, '\x02\x01\x02']]; + dmp.diff_charsToLines_(diffs, ['', 'alpha\n', 'beta\n']); + assertEquivalent([[DIFF_EQUAL, 'alpha\nbeta\nalpha\n'], [DIFF_INSERT, 'beta\nalpha\nbeta\n']], diffs); +} + +function testDiffCleanupMerge() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'a'], [DIFF_DELETE, 'b'], [DIFF_INSERT, 'c']]; + dmp.diff_cleanupMerge(diffs); + assertEquivalent([[DIFF_EQUAL, 'a'], [DIFF_DELETE, 'b'], [DIFF_INSERT, 'c']], diffs); +} + +function testDiffCleanupSemanticLossless() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'AAA\r\n\r\nBBB'], [DIFF_INSERT, '\r\nDDD\r\n\r\nBBB'], [DIFF_EQUAL, '\r\nEEE']]; + dmp.diff_cleanupSemanticLossless(diffs); + assertEquivalent([[DIFF_EQUAL, 'AAA\r\n\r\n'], [DIFF_INSERT, 'BBB\r\nDDD\r\n\r\n'], [DIFF_EQUAL, 'BBB\r\nEEE']], diffs); +} + +function testDiffCleanupSemantic() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_DELETE, 'ab'], [DIFF_INSERT, 'cd'], [DIFF_EQUAL, '12'], [DIFF_DELETE, 'e']]; + dmp.diff_cleanupSemantic(diffs); + assertEquivalent([[DIFF_DELETE, 'ab'], [DIFF_INSERT, 'cd'], [DIFF_EQUAL, '12'], [DIFF_DELETE, 'e']], diffs); +} + +function testDiffCleanupEfficiency() { + dmp.Diff_EditCost = 4; + + const diffs: DiffMatchPatch.Diff[] = [[DIFF_DELETE, 'ab'], [DIFF_INSERT, '12'], [DIFF_EQUAL, 'wxyz'], [DIFF_DELETE, 'cd'], [DIFF_INSERT, '34']]; + dmp.diff_cleanupEfficiency(diffs); + assertEquivalent([[DIFF_DELETE, 'ab'], [DIFF_INSERT, '12'], [DIFF_EQUAL, 'wxyz'], [DIFF_DELETE, 'cd'], [DIFF_INSERT, '34']], diffs); +} + +function testDiffPrettyHtml() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'a\n'], [DIFF_DELETE, 'b'], [DIFF_INSERT, 'c&d']]; + assertEquals('
<B>b</B>c&d', dmp.diff_prettyHtml(diffs)); +} + +function testDiffText() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'jump'], [DIFF_DELETE, 's'], [DIFF_INSERT, 'ed'], [DIFF_EQUAL, ' over '], [DIFF_DELETE, 'the'], [DIFF_INSERT, 'a'], [DIFF_EQUAL, ' lazy']]; + assertEquals('jumps over the lazy', dmp.diff_text1(diffs)); + + assertEquals('jumped over a lazy', dmp.diff_text2(diffs)); +} + +function testDiffDelta() { + const diffs: DiffMatchPatch.Diff[] = + [[DIFF_EQUAL, 'jump'], [DIFF_DELETE, 's'], [DIFF_INSERT, 'ed'], [DIFF_EQUAL, ' over '], [DIFF_DELETE, 'the'], [DIFF_INSERT, 'a'], [DIFF_EQUAL, ' lazy'], [DIFF_INSERT, 'old dog']]; + const text1 = dmp.diff_text1(diffs); + assertEquals('jumps over the lazy', text1); + + const delta = dmp.diff_toDelta(diffs); + assertEquals('=4\t-1\t+ed\t=6\t-3\t+a\t=5\t+old dog', delta); + + assertEquivalent(diffs, dmp.diff_fromDelta(text1, delta)); +} + +function testDiffXIndex() { + assertEquals(5, dmp.diff_xIndex([[DIFF_DELETE, 'a'], [DIFF_INSERT, '1234'], [DIFF_EQUAL, 'xyz']], 2)); +} + +function testDiffLevenshtein() { + assertEquals(4, dmp.diff_levenshtein([[DIFF_DELETE, 'abc'], [DIFF_INSERT, '1234'], [DIFF_EQUAL, 'xyz']])); +} + +function testDiffBisect() { + const a = 'cat'; + const b = 'map'; + assertEquivalent([[DIFF_DELETE, 'c'], [DIFF_INSERT, 'm'], [DIFF_EQUAL, 'a'], [DIFF_DELETE, 't'], [DIFF_INSERT, 'p']], dmp.diff_bisect_(a, b, Number.MAX_VALUE)); +} + +function testDiffMain() { + assertEquivalent([], dmp.diff_main('', '', false)); + + dmp.Diff_Timeout = 0; + // Simple cases. + assertEquivalent([[DIFF_DELETE, 'a'], [DIFF_INSERT, 'b']], dmp.diff_main('a', 'b', false)); +} + +// MATCH TEST FUNCTIONS + +function testMatchAlphabet() { + const expected: {[char: string]: number} = {}; + expected['a'] = 4; + expected['b'] = 2; + expected['c'] = 1; + assertEquivalent(expected, dmp.match_alphabet_('abc')); +} + +function testMatchBitap() { + dmp.Match_Distance = 100; + dmp.Match_Threshold = 0.5; + + assertEquals(5, dmp.match_bitap_('abcdefghijk', 'fgh', 5)); +} + +function testMatchMain() { + assertEquals(0, dmp.match_main('abcdef', 'abcdef', 1000)); +} + +// PATCH TEST FUNCTIONS + +function testPatchObj() { + // Patch Object. + const p = new DiffMatchPatch.patch_obj(); + assertEquals(null, p.start1); + assertEquals(null, p.start2); + + p.start1 = 20; + p.start2 = 21; + p.length1 = 18; + p.length2 = 17; + p.diffs = [[DIFF_EQUAL, 'jump'], [DIFF_DELETE, 's'], [DIFF_INSERT, 'ed'], [DIFF_EQUAL, ' over '], [DIFF_DELETE, 'the'], [DIFF_INSERT, 'a'], [DIFF_EQUAL, '\nlaz']]; + const strp = p.toString(); + assertEquals('@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n %0Alaz\n', strp); +} + +function testPatchFromText() { + const strp = '@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n %0Alaz\n'; + assertEquals(strp, dmp.patch_fromText(strp)[0].toString()); +} + +function testPatchToText() { + const strp = '@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n'; + const p = dmp.patch_fromText(strp); + assertEquals(strp, dmp.patch_toText(p)); +} + +function testPatchAddContext() { + dmp.Patch_Margin = 4; + const p = dmp.patch_fromText('@@ -21,4 +21,10 @@\n-jump\n+somersault\n')[0]; + dmp.patch_addContext_(p, 'The quick brown fox jumps over the lazy dog.'); + assertEquals('@@ -17,12 +17,18 @@\n fox \n-jump\n+somersault\n s ov\n', p.toString()); +} + +function testPatchMake() { + const text1 = 'The quick brown fox jumps over the lazy dog.'; + const text2 = 'That quick brown fox jumped over a lazy dog.'; + let expectedPatch = '@@ -1,8 +1,7 @@\n Th\n-at\n+e\n qui\n@@ -21,17 +21,18 @@\n jump\n-ed\n+s\n over \n-a\n+the\n laz\n'; + let patches = dmp.patch_make(text2, text1); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 1 + expectedPatch = '@@ -1,11 +1,12 @@\n Th\n-e\n+at\n quick b\n@@ -22,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n'; + patches = dmp.patch_make(text1, text2); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 2 + const diffs = dmp.diff_main(text1, text2, false); + patches = dmp.patch_make(diffs); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 3 + patches = dmp.patch_make(text1, diffs); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 4 + patches = dmp.patch_make(text1, text2, diffs); + assertEquals(expectedPatch, dmp.patch_toText(patches)); +} + +function testPatchSplitMax() { + const patches = dmp.patch_make('abcdefghijklmnopqrstuvwxyz01234567890', 'XabXcdXefXghXijXklXmnXopXqrXstXuvXwxXyzX01X23X45X67X89X0'); + dmp.patch_splitMax(patches); + assertEquals( + [ + '@@ -1,32 +1,46 @@\n', + '+X\n ab\n+X\n cd\n+X\n ef\n+X\n gh\n+X\n ij\n+X\n kl\n+X\n mn\n+X\n op\n+X\n qr\n+X\n st\n+X\nuv\n+X\n wx\n+X\n yz\n+X\n 012345\n', + '@@ -25,13 +39,18 @@', + '\n zX01\n+X\n 23\n+X\n 45\n+X\n 67\n+X\n 89\n+X\n 0\n' + ].join(''), + dmp.patch_toText(patches)); +} + +function testPatchAddPadding() { + const patches = dmp.patch_make('', 'test'); + assertEquals('@@ -0,0 +1,4 @@\n+test\n', dmp.patch_toText(patches)); + dmp.patch_addPadding(patches); + assertEquals('@@ -1,8 +1,12 @@\n %01%02%03%04\n+test\n %01%02%03%04\n', dmp.patch_toText(patches)); +} + +function testPatchApply() { + dmp.Match_Distance = 1000; + dmp.Match_Threshold = 0.5; + dmp.Patch_DeleteThreshold = 0.5; + const patches = dmp.patch_make('The quick brown fox jumps over the lazy dog.', 'That quick brown fox jumped over a lazy dog.'); + const results = dmp.patch_apply(patches, 'The quick brown fox jumps over the lazy dog.'); + assertEquivalent(['That quick brown fox jumped over a lazy dog.', [true, true]], results); +} + +declare function assertEquals(expected: T, actual: T): void; + +declare function assertEquivalent(expected: T[], actual: T[]): void; +declare function assertEquivalent(expected: T, actual: T): void; + +declare function assertLinesToCharsResultEquals(expected: {chars1: string, chars2: string, lineArray: string[]}, actual: {chars1: string, chars2: string, lineArray: string[]}): void; diff --git a/types/diff-match-patch/index.d.ts b/types/diff-match-patch/index.d.ts index cfaeace764..9d27016691 100644 --- a/types/diff-match-patch/index.d.ts +++ b/types/diff-match-patch/index.d.ts @@ -1,22 +1,19 @@ -// Type definitions for diff-match-patch v1.0.0 +// Type definitions for diff-match-patch 1.0 // Project: https://www.npmjs.com/package/diff-match-patch // Definitions by: Asana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type Diff = [number, string]; -type Diff = [number, string]; - -export declare class Patch { +export class patch_obj { diffs: Diff[]; - start1: number; - start2: number; + start1: number | null; + start2: number | null; length1: number; length2: number; } -export declare class diff_match_patch { - static new(): diff_match_patch; - +export class diff_match_patch { Diff_Timeout: number; Diff_EditCost: number; Match_Threshold: number; @@ -26,8 +23,13 @@ export declare class diff_match_patch { Match_MaxBits: number; diff_main(text1: string, text2: string, opt_checklines?: boolean, opt_deadline?: number): Diff[]; + diff_bisect_(text1: string, text2: string, deadline: number): Diff[]; + diff_linesToChars_(text1: string, text2: string): { chars1: string; chars2: string; lineArray: string[]; }; + diff_charsToLines_(diffs: Diff[], lineArray: string[]): void; diff_commonPrefix(text1: string, text2: string): number; diff_commonSuffix(text1: string, text2: string): number; + diff_commonOverlap_(text1: string, text2: string): number; + diff_halfMatch_(text1: string, text2: string): string[]; diff_cleanupSemantic(diffs: Diff[]): void; diff_cleanupSemanticLossless(diffs: Diff[]): void; diff_cleanupEfficiency(diffs: Diff[]): void; @@ -40,13 +42,22 @@ export declare class diff_match_patch { diff_toDelta(diffs: Diff[]): string; diff_fromDelta(text1: string, delta: string): Diff[]; - patch_make(text1: any, text2?: string): Patch[]; - patch_deepCopy(patches: Patch[]): Patch[]; - patch_apply(patches: Patch[], text: string): [string, boolean[]]; - patch_fromText(text: string): Patch[]; - patch_toText(patches: Patch[]): string; + match_main(text: string, pattern: string, loc: number): number; + match_bitap_(text: string, pattern: string, loc: number): number; + match_alphabet_(pattern: string): {[char: string]: number}; + + patch_addContext_(patch: patch_obj, text: string): void; + patch_make(a: string, opt_b: string | Diff[]): patch_obj[]; + patch_make(a: Diff[]): patch_obj[]; + patch_make(a: string, opt_b: string, opt_c: Diff[]): patch_obj[]; + patch_deepCopy(patches: patch_obj[]): patch_obj[]; + patch_apply(patches: patch_obj[], text: string): [string, boolean[]]; + patch_addPadding(patches: patch_obj[]): string; + patch_splitMax(patches: patch_obj[]): void; + patch_fromText(text: string): patch_obj[]; + patch_toText(patches: patch_obj[]): string; } -export declare var DIFF_DELETE: number; -export declare var DIFF_INSERT: number; -export declare var DIFF_EQUAL: number; +export const DIFF_DELETE: number; +export const DIFF_INSERT: number; +export const DIFF_EQUAL: number; diff --git a/types/diff-match-patch/tsconfig.json b/types/diff-match-patch/tsconfig.json index 275bed6723..11f60e2489 100644 --- a/types/diff-match-patch/tsconfig.json +++ b/types/diff-match-patch/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/diff-match-patch/tslint.json b/types/diff-match-patch/tslint.json new file mode 100644 index 0000000000..65c83fb1e3 --- /dev/null +++ b/types/diff-match-patch/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "dt-header": false + } +} diff --git a/types/diff/tsconfig.json b/types/diff/tsconfig.json index 96385c4e2a..9a1fdba840 100644 --- a/types/diff/tsconfig.json +++ b/types/diff/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/diff2html/tsconfig.json b/types/diff2html/tsconfig.json index 177597e8cd..bb9662b5b6 100644 --- a/types/diff2html/tsconfig.json +++ b/types/diff2html/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dir-resolve/tsconfig.json b/types/dir-resolve/tsconfig.json index 1748792b1d..129d8a0aa9 100644 --- a/types/dir-resolve/tsconfig.json +++ b/types/dir-resolve/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/discontinuous-range/tsconfig.json b/types/discontinuous-range/tsconfig.json index 9aa84910b6..26c43bf7f0 100644 --- a/types/discontinuous-range/tsconfig.json +++ b/types/discontinuous-range/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/disposable-email-domains/tsconfig.json b/types/disposable-email-domains/tsconfig.json index eb54d0c49f..70b9e249d1 100644 --- a/types/disposable-email-domains/tsconfig.json +++ b/types/disposable-email-domains/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/doccookies/tsconfig.json b/types/doccookies/tsconfig.json index f8dcf939f1..e4de927a2f 100644 --- a/types/doccookies/tsconfig.json +++ b/types/doccookies/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dock-spawn/tsconfig.json b/types/dock-spawn/tsconfig.json index 92eac29967..a5c6c7b144 100644 --- a/types/dock-spawn/tsconfig.json +++ b/types/dock-spawn/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 42657744d3..ac569b2d32 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -4,6 +4,7 @@ // Nicolas Laplante // ByeongHun Yoo // Ray Fang +// Marius Meisenzahl // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -444,6 +445,7 @@ declare namespace Dockerode { } interface HostConfig { + AutoRemove: boolean; Binds: string[]; ContainerIDFile: string; LogConfig: { @@ -593,6 +595,7 @@ declare namespace Dockerode { ExposedPorts?: { [port: string]: {} }; StopSignal?: string; HostConfig?: { + AutoRemove?: boolean; Binds?: string[]; Links?: string[]; Memory?: number; diff --git a/types/dockerode/tsconfig.json b/types/dockerode/tsconfig.json index 8f360ab29a..3334b9b296 100644 --- a/types/dockerode/tsconfig.json +++ b/types/dockerode/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/docopt/tsconfig.json b/types/docopt/tsconfig.json index 60b0174d95..bc71021fcd 100644 --- a/types/docopt/tsconfig.json +++ b/types/docopt/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/doctrine/tsconfig.json b/types/doctrine/tsconfig.json index d7d81a7c16..1b9e7702c2 100644 --- a/types/doctrine/tsconfig.json +++ b/types/doctrine/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/documentdb-server/tsconfig.json b/types/documentdb-server/tsconfig.json index 7c96754e6c..98dcf6bf5c 100644 --- a/types/documentdb-server/tsconfig.json +++ b/types/documentdb-server/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/documentdb-session/tsconfig.json b/types/documentdb-session/tsconfig.json index 478f009cc6..40ab7520b7 100644 --- a/types/documentdb-session/tsconfig.json +++ b/types/documentdb-session/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "documentdb-session-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/documentdb/tsconfig.json b/types/documentdb/tsconfig.json index 0f1d4e70e9..48c13eac51 100644 --- a/types/documentdb/tsconfig.json +++ b/types/documentdb/tsconfig.json @@ -8,11 +8,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" - ], - "types": [ ], + ], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/dojo/dijit.d.ts b/types/dojo/dijit.d.ts index 3c2d892471..b22742b85d 100644 --- a/types/dojo/dijit.d.ts +++ b/types/dojo/dijit.d.ts @@ -29946,7 +29946,7 @@ declare module dijit { * * @param aroundNode */ - hide(aroundNode: any): any; + static hide(aroundNode: any): any; /** * Return true if this widget can currently be focused * and false if not @@ -30107,7 +30107,7 @@ declare module dijit { * @param rtl OptionalCorresponds to WidgetBase.dir attribute, where false means "ltr" and truemeans "rtl"; specifies GUI direction, not text direction. * @param textDir OptionalCorresponds to WidgetBase.textdir attribute; specifies direction of text. */ - show(innerHTML: String, aroundNode: Object, position: String[], rtl: boolean, textDir: String): any; + static show(innerHTML: String, aroundNode: Object, position?: String[], rtl?: boolean, textDir?: String): any; /** * */ @@ -106941,4 +106941,4 @@ declare module "dijit/ConfirmDialog" { declare module "dijit/_ConfirmDialogMixin" { var exp: typeof dijit._ConfirmDialogMixin; export=exp; -} \ No newline at end of file +} diff --git a/types/dojo/dojox.charting.d.ts b/types/dojo/dojox.charting.d.ts index 0f69eee3d4..d3336effd1 100644 --- a/types/dojo/dojox.charting.d.ts +++ b/types/dojo/dojox.charting.d.ts @@ -1,6 +1,7 @@ // Type definitions for Dojo v1.9 // Project: http://dojotoolkit.org // Definitions by: Michael Van Sickle +// Don Waldo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13132,326 +13133,326 @@ declare namespace dojox { } declare module "dojox/charting/Chart3D" { - var exp: dojox.charting.Chart3D + import exp = dojox.charting.Chart3D export=exp; } declare module "dojox/charting/Chart2D" { - var exp: dojox.charting.Chart2D + import exp = dojox.charting.Chart2D export=exp; } declare module "dojox/charting/DataSeries" { - var exp: dojox.charting.DataSeries + import exp = dojox.charting.DataSeries export=exp; } declare module "dojox/charting/Chart" { - var exp: dojox.charting.Chart + import exp = dojox.charting.Chart export=exp; } declare module "dojox/charting/DataChart" { - var exp: dojox.charting.DataChart + import exp = dojox.charting.DataChart export=exp; } declare module "dojox/charting/Element" { - var exp: dojox.charting.Element + import exp = dojox.charting.Element export=exp; } declare module "dojox/charting/Series" { - var exp: dojox.charting.Series + import exp = dojox.charting.Series export=exp; } declare module "dojox/charting/StoreSeries" { - var exp: dojox.charting.StoreSeries + import exp = dojox.charting.StoreSeries export=exp; } declare module "dojox/charting/SimpleTheme" { - var exp: dojox.charting.SimpleTheme + import exp = dojox.charting.SimpleTheme export=exp; } declare module "dojox/charting/SimpleTheme.defaultMarkers" { - var exp: dojox.charting.SimpleTheme.defaultMarkers + import exp = dojox.charting.SimpleTheme.defaultMarkers export=exp; } declare module "dojox/charting/SimpleTheme.defaultTheme" { - var exp: dojox.charting.SimpleTheme.defaultTheme + import exp = dojox.charting.SimpleTheme.defaultTheme export=exp; } declare module "dojox/charting/Theme" { - var exp: dojox.charting.Theme + import exp = dojox.charting.Theme export=exp; } declare module "dojox/charting/Theme.defaultMarkers" { - var exp: dojox.charting.Theme.defaultMarkers + import exp = dojox.charting.Theme.defaultMarkers export=exp; } declare module "dojox/charting/Theme.defaultTheme" { - var exp: dojox.charting.Theme.defaultTheme + import exp = dojox.charting.Theme.defaultTheme export=exp; } declare module "dojox/charting/action2d/Base" { - var exp: dojox.charting.action2d.Base + import exp = dojox.charting.action2d.Base export=exp; } declare module "dojox/charting/action2d/ChartAction" { - var exp: dojox.charting.action2d.ChartAction + import exp = dojox.charting.action2d.ChartAction export=exp; } declare module "dojox/charting/action2d/_IndicatorElement" { - var exp: dojox.charting.action2d._IndicatorElement + import exp = dojox.charting.action2d._IndicatorElement export=exp; } declare module "dojox/charting/action2d/Highlight" { - var exp: dojox.charting.action2d.Highlight + import exp = dojox.charting.action2d.Highlight export=exp; } declare module "dojox/charting/action2d/Magnify" { - var exp: dojox.charting.action2d.Magnify + import exp = dojox.charting.action2d.Magnify export=exp; } declare module "dojox/charting/action2d/MouseZoomAndPan" { - var exp: dojox.charting.action2d.MouseZoomAndPan + import exp = dojox.charting.action2d.MouseZoomAndPan export=exp; } declare module "dojox/charting/action2d/MouseIndicator" { - var exp: dojox.charting.action2d.MouseIndicator + import exp = dojox.charting.action2d.MouseIndicator export=exp; } declare module "dojox/charting/action2d/MoveSlice" { - var exp: dojox.charting.action2d.MoveSlice + import exp = dojox.charting.action2d.MoveSlice export=exp; } declare module "dojox/charting/action2d/PlotAction" { - var exp: dojox.charting.action2d.PlotAction + import exp = dojox.charting.action2d.PlotAction export=exp; } declare module "dojox/charting/action2d/Tooltip" { - var exp: dojox.charting.action2d.Tooltip + import exp = dojox.charting.action2d.Tooltip export=exp; } declare module "dojox/charting/action2d/Shake" { - var exp: dojox.charting.action2d.Shake + import exp = dojox.charting.action2d.Shake export=exp; } declare module "dojox/charting/action2d/TouchZoomAndPan" { - var exp: dojox.charting.action2d.TouchZoomAndPan + import exp = dojox.charting.action2d.TouchZoomAndPan export=exp; } declare module "dojox/charting/action2d/TouchIndicator" { - var exp: dojox.charting.action2d.TouchIndicator + import exp = dojox.charting.action2d.TouchIndicator export=exp; } declare module "dojox/charting/axis2d/common" { - var exp: dojox.charting.axis2d.common + import exp = dojox.charting.axis2d.common export=exp; } declare module "dojox/charting/axis2d/common.createText" { - var exp: dojox.charting.axis2d.common.createText + import exp = dojox.charting.axis2d.common.createText export=exp; } declare module "dojox/charting/axis2d/Base" { - var exp: dojox.charting.axis2d.Base + import exp = dojox.charting.axis2d.Base export=exp; } declare module "dojox/charting/axis2d/Invisible" { - var exp: dojox.charting.axis2d.Invisible + import exp = dojox.charting.axis2d.Invisible export=exp; } declare module "dojox/charting/axis2d/Default" { - var exp: dojox.charting.axis2d.Default + import exp = dojox.charting.axis2d.Default export=exp; } declare module "dojox/charting/bidi/_bidiutils" { - var exp: dojox.charting.bidi._bidiutils + import exp = dojox.charting.bidi._bidiutils export=exp; } declare module "dojox/charting/bidi/Chart" { - var exp: dojox.charting.bidi.Chart + import exp = dojox.charting.bidi.Chart export=exp; } declare module "dojox/charting/bidi/Chart3D" { - var exp: dojox.charting.bidi.Chart3D + import exp = dojox.charting.bidi.Chart3D export=exp; } declare module "dojox/charting/bidi/action2d/Tooltip" { - var exp: dojox.charting.bidi.action2d.Tooltip + import exp = dojox.charting.bidi.action2d.Tooltip export=exp; } declare module "dojox/charting/bidi/action2d/ZoomAndPan" { - var exp: dojox.charting.bidi.action2d.ZoomAndPan + import exp = dojox.charting.bidi.action2d.ZoomAndPan export=exp; } declare module "dojox/charting/bidi/axis2d/Default" { - var exp: dojox.charting.bidi.axis2d.Default + import exp = dojox.charting.bidi.axis2d.Default export=exp; } declare module "dojox/charting/bidi/widget/Chart" { - var exp: dojox.charting.bidi.widget.Chart + import exp = dojox.charting.bidi.widget.Chart export=exp; } declare module "dojox/charting/bidi/widget/Legend" { - var exp: dojox.charting.bidi.widget.Legend + import exp = dojox.charting.bidi.widget.Legend export=exp; } declare module "dojox/charting/plot2d/common" { - var exp: dojox.charting.plot2d.common + import exp = dojox.charting.plot2d.common export=exp; } declare module "dojox/charting/plot2d/common.defaultStats" { - var exp: dojox.charting.plot2d.common.defaultStats + import exp = dojox.charting.plot2d.common.defaultStats export=exp; } declare module "dojox/charting/plot2d/commonStacked" { - var exp: dojox.charting.plot2d.commonStacked + import exp = dojox.charting.plot2d.commonStacked export=exp; } declare module "dojox/charting/plot2d/_PlotEvents" { - var exp: dojox.charting.plot2d._PlotEvents + import exp = dojox.charting.plot2d._PlotEvents export=exp; } declare module "dojox/charting/plot2d/Areas" { - var exp: dojox.charting.plot2d.Areas + import exp = dojox.charting.plot2d.Areas export=exp; } declare module "dojox/charting/plot2d/Bars" { - var exp: dojox.charting.plot2d.Bars + import exp = dojox.charting.plot2d.Bars export=exp; } declare module "dojox/charting/plot2d/Base" { - var exp: dojox.charting.plot2d.Base + import exp = dojox.charting.plot2d.Base export=exp; } declare module "dojox/charting/plot2d/Bubble" { - var exp: dojox.charting.plot2d.Bubble + import exp = dojox.charting.plot2d.Bubble export=exp; } declare module "dojox/charting/plot2d/CartesianBase" { - var exp: dojox.charting.plot2d.CartesianBase + import exp = dojox.charting.plot2d.CartesianBase export=exp; } declare module "dojox/charting/plot2d/Candlesticks" { - var exp: dojox.charting.plot2d.Candlesticks + import exp = dojox.charting.plot2d.Candlesticks export=exp; } declare module "dojox/charting/plot2d/ClusteredBars" { - var exp: dojox.charting.plot2d.ClusteredBars + import exp = dojox.charting.plot2d.ClusteredBars export=exp; } declare module "dojox/charting/plot2d/ClusteredColumns" { - var exp: dojox.charting.plot2d.ClusteredColumns + import exp = dojox.charting.plot2d.ClusteredColumns export=exp; } declare module "dojox/charting/plot2d/Columns" { - var exp: dojox.charting.plot2d.Columns + import exp = dojox.charting.plot2d.Columns export=exp; } declare module "dojox/charting/plot2d/Grid" { - var exp: dojox.charting.plot2d.Grid + import exp = dojox.charting.plot2d.Grid export=exp; } declare module "dojox/charting/plot2d/Default" { - var exp: dojox.charting.plot2d.Default + import exp = dojox.charting.plot2d.Default export=exp; } declare module "dojox/charting/plot2d/Indicator" { - var exp: dojox.charting.plot2d.Indicator + import exp = dojox.charting.plot2d.Indicator export=exp; } declare module "dojox/charting/plot2d/Lines" { - var exp: dojox.charting.plot2d.Lines + import exp = dojox.charting.plot2d.Lines export=exp; } declare module "dojox/charting/plot2d/Markers" { - var exp: dojox.charting.plot2d.Markers + import exp = dojox.charting.plot2d.Markers export=exp; } declare module "dojox/charting/plot2d/Pie" { - var exp: dojox.charting.plot2d.Pie + import exp = dojox.charting.plot2d.Pie export=exp; } declare module "dojox/charting/plot2d/MarkersOnly" { - var exp: dojox.charting.plot2d.MarkersOnly + import exp = dojox.charting.plot2d.MarkersOnly export=exp; } declare module "dojox/charting/plot2d/OHLC" { - var exp: dojox.charting.plot2d.OHLC + import exp = dojox.charting.plot2d.OHLC export=exp; } declare module "dojox/charting/plot2d/Scatter" { - var exp: dojox.charting.plot2d.Scatter + import exp = dojox.charting.plot2d.Scatter export=exp; } declare module "dojox/charting/plot2d/Stacked" { - var exp: dojox.charting.plot2d.Stacked + import exp = dojox.charting.plot2d.Stacked export=exp; } declare module "dojox/charting/plot2d/Spider" { - var exp: dojox.charting.plot2d.Spider + import exp = dojox.charting.plot2d.Spider export=exp; } declare module "dojox/charting/plot2d/StackedAreas" { - var exp: dojox.charting.plot2d.StackedAreas + import exp = dojox.charting.plot2d.StackedAreas export=exp; } declare module "dojox/charting/plot2d/StackedBars" { - var exp: dojox.charting.plot2d.StackedBars + import exp = dojox.charting.plot2d.StackedBars export=exp; } declare module "dojox/charting/plot2d/StackedColumns" { - var exp: dojox.charting.plot2d.StackedColumns + import exp = dojox.charting.plot2d.StackedColumns export=exp; } declare module "dojox/charting/plot2d/StackedLines" { - var exp: dojox.charting.plot2d.StackedLines + import exp = dojox.charting.plot2d.StackedLines export=exp; } declare module "dojox/charting/plot3d/Bars" { - var exp: dojox.charting.plot3d.Bars + import exp = dojox.charting.plot3d.Bars export=exp; } declare module "dojox/charting/plot3d/Base" { - var exp: dojox.charting.plot3d.Base + import exp = dojox.charting.plot3d.Base export=exp; } declare module "dojox/charting/plot3d/Cylinders" { - var exp: dojox.charting.plot3d.Cylinders + import exp = dojox.charting.plot3d.Cylinders export=exp; } declare module "dojox/charting/scaler/common" { - var exp: dojox.charting.scaler.common + import exp = dojox.charting.scaler.common export=exp; } declare module "dojox/charting/scaler/primitive" { - var exp: dojox.charting.scaler.primitive + import exp = dojox.charting.scaler.primitive export=exp; } declare module "dojox/charting/scaler/linear" { - var exp: dojox.charting.scaler.linear + import exp = dojox.charting.scaler.linear export=exp; } declare module "dojox/charting/themes/common" { - var exp: dojox.charting.themes.common + import exp = dojox.charting.themes.common export=exp; } declare module "dojox/charting/themes/gradientGenerator" { - var exp: dojox.charting.themes.gradientGenerator + import exp = dojox.charting.themes.gradientGenerator export=exp; } declare module "dojox/charting/themes/PlotKit/base" { - var exp: dojox.charting.themes.PlotKit.base + import exp = dojox.charting.themes.PlotKit.base export=exp; } declare module "dojox/charting/widget/Chart2D" { - var exp: dojox.charting.widget.Chart2D + import exp = dojox.charting.widget.Chart2D export=exp; } declare module "dojox/charting/widget/Chart" { - var exp: dojox.charting.widget.Chart + import exp = dojox.charting.widget.Chart export=exp; } declare module "dojox/charting/widget/Legend" { - var exp: dojox.charting.widget.Legend + import exp = dojox.charting.widget.Legend export=exp; } declare module "dojox/charting/widget/SelectableLegend" { - var exp: dojox.charting.widget.SelectableLegend + import exp = dojox.charting.widget.SelectableLegend export=exp; } diff --git a/types/dojo/tsconfig.json b/types/dojo/tsconfig.json index d20f843c14..140f764554 100644 --- a/types/dojo/tsconfig.json +++ b/types/dojo/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -82,4 +83,5 @@ "dojox.widget.d.ts", "dojox.xml.d.ts" ] -} \ No newline at end of file +} + diff --git a/types/dom-inputevent/tsconfig.json b/types/dom-inputevent/tsconfig.json index 1577efb197..a309b9ec2e 100644 --- a/types/dom-inputevent/tsconfig.json +++ b/types/dom-inputevent/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "dom-inputevent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dom4/tsconfig.json b/types/dom4/tsconfig.json index c10c96f75a..3db581ed36 100644 --- a/types/dom4/tsconfig.json +++ b/types/dom4/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/domo/tsconfig.json b/types/domo/tsconfig.json index ca34816a7d..1700042ecc 100644 --- a/types/domo/tsconfig.json +++ b/types/domo/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dompurify/tsconfig.json b/types/dompurify/tsconfig.json index 34d380baf0..f10fdda910 100644 --- a/types/dompurify/tsconfig.json +++ b/types/dompurify/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/domready/tsconfig.json b/types/domready/tsconfig.json index 54d5225b58..1495d185a6 100644 --- a/types/domready/tsconfig.json +++ b/types/domready/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/domurl/tsconfig.json b/types/domurl/tsconfig.json index 86a6ff8fb7..c678dbc069 100644 --- a/types/domurl/tsconfig.json +++ b/types/domurl/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/donna/tsconfig.json b/types/donna/tsconfig.json index 5df1095e12..6e06e71c36 100644 --- a/types/donna/tsconfig.json +++ b/types/donna/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dookie/tsconfig.json b/types/dookie/tsconfig.json index 0c926cf7ff..a788cba5bc 100644 --- a/types/dookie/tsconfig.json +++ b/types/dookie/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dot-object/tsconfig.json b/types/dot-object/tsconfig.json index 505abd7f41..f58205cdaf 100644 --- a/types/dot-object/tsconfig.json +++ b/types/dot-object/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dot-prop/tsconfig.json b/types/dot-prop/tsconfig.json index 9569bb6470..cbacf32b41 100644 --- a/types/dot-prop/tsconfig.json +++ b/types/dot-prop/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "dot-prop-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dot-prop/v2/tsconfig.json b/types/dot-prop/v2/tsconfig.json index 2e274e84da..f5770f3083 100644 --- a/types/dot-prop/v2/tsconfig.json +++ b/types/dot-prop/v2/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "dot-prop": ["dot-prop/v2"] + "dot-prop": [ + "dot-prop/v2" + ] }, "types": [], "noEmit": true, @@ -22,4 +25,4 @@ "index.d.ts", "dot-prop-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dot/tsconfig.json b/types/dot/tsconfig.json index 90dfddee0a..2c1a595ac6 100644 --- a/types/dot/tsconfig.json +++ b/types/dot/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dotdotdot/tsconfig.json b/types/dotdotdot/tsconfig.json index 01346ccccc..8be8dc5245 100644 --- a/types/dotdotdot/tsconfig.json +++ b/types/dotdotdot/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dotenv-safe/tsconfig.json b/types/dotenv-safe/tsconfig.json index 6c134db7bf..46b51afc29 100644 --- a/types/dotenv-safe/tsconfig.json +++ b/types/dotenv-safe/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es5" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "dotenv-safe-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dotenv-safe-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dotenv/tsconfig.json b/types/dotenv/tsconfig.json index 1f7cfcfcca..5c51b4d698 100644 --- a/types/dotenv/tsconfig.json +++ b/types/dotenv/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dotenv/v2/tsconfig.json b/types/dotenv/v2/tsconfig.json index efaf5860d4..facb307571 100644 --- a/types/dotenv/v2/tsconfig.json +++ b/types/dotenv/v2/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "dotenv": [ "dotenv/v2" ] + "dotenv": [ + "dotenv/v2" + ] }, "types": [], "noEmit": true, @@ -22,4 +25,4 @@ "index.d.ts", "dotenv-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dottie/tsconfig.json b/types/dottie/tsconfig.json index 03af0fda9b..f770bbf57d 100644 --- a/types/dottie/tsconfig.json +++ b/types/dottie/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "dottie-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/doublearray/tsconfig.json b/types/doublearray/tsconfig.json index c82acdd4e0..fbc5ab9e55 100644 --- a/types/doublearray/tsconfig.json +++ b/types/doublearray/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/doubleclick-gpt/tsconfig.json b/types/doubleclick-gpt/tsconfig.json index c06fe9ff3c..d240d560ce 100644 --- a/types/doubleclick-gpt/tsconfig.json +++ b/types/doubleclick-gpt/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/downloadjs/tsconfig.json b/types/downloadjs/tsconfig.json index 5ce76596d5..15703cf41a 100644 --- a/types/downloadjs/tsconfig.json +++ b/types/downloadjs/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "downloadjs-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "downloadjs-tests.ts" + ] +} \ No newline at end of file diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 6420669a3a..088d083a7f 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Draft.js v0.10.1 +// Type definitions for Draft.js v0.10.3 // Project: https://facebook.github.io/draft-js/ // Definitions by: Dmitry Rogozhny // Eelco Lempsink @@ -111,11 +111,11 @@ declare namespace Draft { ariaActiveDescendantID?: string; ariaAutoComplete?: string; + ariaControls?: string; ariaDescribedBy?: string; ariaExpanded?: boolean; - ariaHasPopup?: boolean; ariaLabel?: string; - ariaOwneeID?: string; + ariaMultiline?: boolean; webDriverTestID?: string; @@ -320,6 +320,12 @@ declare namespace Draft { * to indicate whether an event was handled or not. */ type DraftHandleValue = "handled" | "not-handled"; + + /** + * A type that defines if an fragment shall be inserted before or after + * another fragment or if the selected fragment shall be replaced + */ + type DraftInsertionType = "replace" | "before" | "after"; } namespace Decorators { @@ -828,6 +834,7 @@ declare namespace Draft { class AtomicBlockUtils { static insertAtomicBlock(editorState: EditorState, entityKey: string, character: string): EditorState; + static moveAtomicBlock(editorState: EditorState, atomicBlock: ContentBlock, targetRange: SelectionState, insertionMode?: DraftInsertionType): EditorState; } /** @@ -938,6 +945,13 @@ import genKey = Draft.Model.Keys.generateRandomKey; import getDefaultKeyBinding = Draft.Component.Utils.getDefaultKeyBinding; import getVisibleSelectionRect = Draft.Component.Selection.getVisibleSelectionRect; +import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; +import DraftDragType = Draft.Model.Constants.DraftDragType; +import DraftBlockType = Draft.Model.Constants.DraftBlockType; +import DraftRemovalDirection = Draft.Model.Constants.DraftRemovalDirection; +import DraftHandleValue = Draft.Model.Constants.DraftHandleValue; +import DraftInsertionType = Draft.Model.Constants.DraftInsertionType; + export { Editor, EditorProps, @@ -970,5 +984,12 @@ export { genKey, getDefaultKeyBinding, - getVisibleSelectionRect + getVisibleSelectionRect, + + DraftEditorCommand, + DraftDragType, + DraftBlockType, + DraftRemovalDirection, + DraftHandleValue, + DraftInsertionType, }; diff --git a/types/draft-js/tsconfig.json b/types/draft-js/tsconfig.json index 2b3ffe8ec7..58fc6cd302 100644 --- a/types/draft-js/tsconfig.json +++ b/types/draft-js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ diff --git a/types/drag-timetable/tsconfig.json b/types/drag-timetable/tsconfig.json index f704c30147..875c35f69a 100644 --- a/types/drag-timetable/tsconfig.json +++ b/types/drag-timetable/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "drag-timetable-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/draggabilly/tsconfig.json b/types/draggabilly/tsconfig.json index 32cc6ee235..d34c51c338 100644 --- a/types/draggabilly/tsconfig.json +++ b/types/draggabilly/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "draggabilly-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dragster/tsconfig.json b/types/dragster/tsconfig.json index 9740d729a0..c415da2b1a 100644 --- a/types/dragster/tsconfig.json +++ b/types/dragster/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dragula/tsconfig.json b/types/dragula/tsconfig.json index 33f4e1e247..8179057247 100644 --- a/types/dragula/tsconfig.json +++ b/types/dragula/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dropboxjs/tsconfig.json b/types/dropboxjs/tsconfig.json index 3e55f0136c..c1c700cf02 100644 --- a/types/dropboxjs/tsconfig.json +++ b/types/dropboxjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dropkickjs/tsconfig.json b/types/dropkickjs/tsconfig.json index 07855ffa97..31076fcede 100644 --- a/types/dropkickjs/tsconfig.json +++ b/types/dropkickjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dropzone/tsconfig.json b/types/dropzone/tsconfig.json index ff427c95f0..552b864cb7 100644 --- a/types/dropzone/tsconfig.json +++ b/types/dropzone/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dropzone/v4/tsconfig.json b/types/dropzone/v4/tsconfig.json index 36eb5f0aef..d88ab721fd 100644 --- a/types/dropzone/v4/tsconfig.json +++ b/types/dropzone/v4/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" @@ -16,7 +17,9 @@ "noEmit": true, "forceConsistentCasingInFileNames": true, "paths": { - "dropzone": ["dropzone/v4"] + "dropzone": [ + "dropzone/v4" + ] } }, "files": [ diff --git a/types/dsv/tsconfig.json b/types/dsv/tsconfig.json index e5f4e1b7c3..ba47a0e093 100644 --- a/types/dsv/tsconfig.json +++ b/types/dsv/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dts-bundle/tsconfig.json b/types/dts-bundle/tsconfig.json index 8e871ab4a2..a380447ece 100644 --- a/types/dts-bundle/tsconfig.json +++ b/types/dts-bundle/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dts-generator/dts-generator-tests.ts b/types/dts-generator/dts-generator-tests.ts new file mode 100644 index 0000000000..76e37dc802 --- /dev/null +++ b/types/dts-generator/dts-generator-tests.ts @@ -0,0 +1,3 @@ +import dtsGenerator = require('dts-generator'); + +dtsGenerator({name: 'foo', out: 'bar'}); diff --git a/types/dts-generator/index.d.ts b/types/dts-generator/index.d.ts new file mode 100644 index 0000000000..9de25e1f91 --- /dev/null +++ b/types/dts-generator/index.d.ts @@ -0,0 +1,86 @@ +// Type definitions for dts-generator 2.1 +// Project: https://github.com/SitePen/dts-generator#readme +// Definitions by: Matt Traynham +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import ts = require('typescript'); +import Bluebird = require('bluebird'); + +export = dtsGenerator; + +declare function dtsGenerator(options: dtsGenerator.DtsGeneratorOptions): Bluebird; + +declare namespace dtsGenerator { + interface ResolveModuleIdParams { + /** The identifier of the module being declared in the generated d.ts */ + currentModuleId: string; + } + + interface ResolveModuleImportParams { + /** The identifier of the module currently being imported in the generated d.ts */ + importedModuleId: string; + + /** The identifier of the enclosing module currently being declared in the generated d.ts */ + currentModuleId: string; + + /** True if the imported module id is declared as a module in the input files. */ + isDeclaredExternalModule: boolean; + } + + interface DtsGeneratorOptions { + /** + * The base directory for the package being bundled. Any dependencies discovered outside this directory will be excluded + * from the bundle. + * Note this is no longer the preferred way to configure dts-generator, please see project. + */ + baseDir?: string; + /** + * A list of glob patterns, relative to baseDir, that should be excluded from the bundle. + * Use the --exclude flag one or more times on the command-line. Defaults to [ "node_modules\/**\/*.d.ts" ]. + */ + exclude?: string[]; + /** + * A list of external module reference paths that should be inserted as reference comments. + * Use the --extern flag one or more times on the command-line. + */ + externs?: string[]; + /** + * A list of external @types package dependencies that should be inserted as reference comments. + * Use the --types flag one or more times on the command-line. + */ + types?: string[]; + /** A list of files from the baseDir to bundle. */ + files?: string[]; + /** The end-of-line character that should be used when outputting code. Defaults to os.EOL. */ + eol?: string; + /** The character(s) that should be used to indent the declarations in the output. Defaults to \t. */ + indent?: string; + /** The module ID that should be used as the exported value of the package’s “main” module. */ + main?: string; + /** The type of module resolution to use when generating the bundle. */ + moduleResolution?: ts.ModuleResolutionKind; + /** The name of the package. Used to determine the correct exported package name for modules. */ + name: string; + /** The filename where the generated bundle will be created. */ + out: string; + /** + * The base directory for the project being bundled. It is assumed that this directory contains a + * tsconfig.json which will be parsed to determine the files that should be bundled as well as + * other configuration information like target + */ + project?: string; + /** The target environment for generated code. Defaults to ts.ScriptTarget.Latest. */ + target?: ts.ScriptTarget; + /** + * An optional callback provided by the invoker to customize the declared module ids the output d.ts files. + * @see {@link https://github.com/SitePen/dts-generator/blob/master/docs/resolving-module-ids.md Resolving Module Ids} + */ + resolveModuleId?(params: ResolveModuleIdParams): string; + /** + * An optional callback provided by the invoker to customize the imported module ids in the output d.ts files. + * @see {@link https://github.com/SitePen/dts-generator/blob/master/docs/resolving-module-ids.md Resolving Module Ids} + */ + resolveModuleImport?(params: ResolveModuleImportParams): string; + } +} diff --git a/types/dts-generator/tsconfig.json b/types/dts-generator/tsconfig.json new file mode 100644 index 0000000000..97bc3726f6 --- /dev/null +++ b/types/dts-generator/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dts-generator-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dts-generator/tslint.json b/types/dts-generator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dts-generator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/duplexer2/tsconfig.json b/types/duplexer2/tsconfig.json index 08cf6d3426..90332a13a9 100644 --- a/types/duplexer2/tsconfig.json +++ b/types/duplexer2/tsconfig.json @@ -10,6 +10,7 @@ ], "noImplicitAny": true, "strictNullChecks": false, + "strictFunctionTypes": true, "noImplicitThis": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/duplexer3/duplexer3-tests.ts b/types/duplexer3/duplexer3-tests.ts index 557437597c..c540828d5d 100644 --- a/types/duplexer3/duplexer3-tests.ts +++ b/types/duplexer3/duplexer3-tests.ts @@ -6,7 +6,7 @@ const readable = new stream.Readable({objectMode: true}); writable._write = (input, encoding, done) => { if (readable.push(input)) { - return done(); + done(); } else { readable.once('drain', <(...args: any[]) => void> done); } diff --git a/types/duplexer3/tsconfig.json b/types/duplexer3/tsconfig.json index 36ac16d2c7..1b3e73cc33 100644 --- a/types/duplexer3/tsconfig.json +++ b/types/duplexer3/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "duplexer3-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/duplexify/duplexify-tests.ts b/types/duplexify/duplexify-tests.ts new file mode 100644 index 0000000000..11d33d7303 --- /dev/null +++ b/types/duplexify/duplexify-tests.ts @@ -0,0 +1,16 @@ +import duplexify = require("duplexify"); +import { Readable, Writable, Duplex } from "stream"; + +declare var readable: Readable; +declare var writable: Writable; + +duplexify(writable, readable); +duplexify(writable); +duplexify(undefined, readable); + +const d: duplexify.Duplexify = duplexify(); +d.setReadable(readable); +d.setReadable(); // $ExpectError +d.setWritable(writable); +d.setWritable(); // $ExpectError +const f: Duplex = d; diff --git a/types/duplexify/index.d.ts b/types/duplexify/index.d.ts new file mode 100644 index 0000000000..791a000f8b --- /dev/null +++ b/types/duplexify/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for duplexify 3.5 +// Project: https://github.com/mafintosh/duplexify +// Definitions by: Sami Kukkonen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +import * as stream from "stream"; + +export = duplexify; + +interface DuplexifyConstructor { + (writable?: stream.Writable, readable?: stream.Readable, streamOptions?: stream.DuplexOptions): duplexify.Duplexify; + new (writable?: stream.Writable, readable?: stream.Readable, streamOptions?: stream.DuplexOptions): duplexify.Duplexify; +} +declare var duplexify: DuplexifyConstructor; +declare namespace duplexify { + interface Duplexify extends stream.Duplex { + setWritable(writable: stream.Writable): void; + setReadable(readable: stream.Readable): void; + } +} diff --git a/types/duplexify/tsconfig.json b/types/duplexify/tsconfig.json new file mode 100644 index 0000000000..72c801f5ab --- /dev/null +++ b/types/duplexify/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "duplexify-tests.ts" + ] +} \ No newline at end of file diff --git a/types/duplexify/tslint.json b/types/duplexify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/duplexify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts b/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts new file mode 100644 index 0000000000..0552f0e7c4 --- /dev/null +++ b/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts @@ -0,0 +1,24 @@ +import webpack = require('webpack'); +import DuplicatePackageCheckerWebpackPlugin = require('duplicate-package-checker-webpack-plugin'); + +const a: webpack.Configuration = { + entry: 'test.js', + plugins: [ + new DuplicatePackageCheckerWebpackPlugin() + ] +}; +const b: webpack.Configuration = { + entry: 'test.js', + plugins: [ + new DuplicatePackageCheckerWebpackPlugin({}) + ] +}; +const c: webpack.Configuration = { + entry: 'test.js', + plugins: [ + new DuplicatePackageCheckerWebpackPlugin({ + verbose: true, + emitError: true + }) + ] +}; diff --git a/types/duplicate-package-checker-webpack-plugin/index.d.ts b/types/duplicate-package-checker-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..88d8ccd54c --- /dev/null +++ b/types/duplicate-package-checker-webpack-plugin/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for duplicate-package-checker-webpack-plugin 1.2 +// Project: https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#readme +// Definitions by: Matt Traynham +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import webpack = require('webpack'); + +export = DuplicatePackageCheckerWebpackPlugin; + +declare class DuplicatePackageCheckerWebpackPlugin extends webpack.Plugin { + constructor(options?: DuplicatePackageCheckerWebpackPlugin.Options); +} + +declare namespace DuplicatePackageCheckerWebpackPlugin { + interface Options { + // Also show module that is requiring each duplicate package + verbose?: boolean; + // Emit errors instead of warnings + emitError?: boolean; + } +} diff --git a/types/duplicate-package-checker-webpack-plugin/tsconfig.json b/types/duplicate-package-checker-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..7174bf68ea --- /dev/null +++ b/types/duplicate-package-checker-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "duplicate-package-checker-webpack-plugin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/duplicate-package-checker-webpack-plugin/tslint.json b/types/duplicate-package-checker-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/duplicate-package-checker-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/durandal/tsconfig.json b/types/durandal/tsconfig.json index 1401eeeedb..d34d6a1d77 100644 --- a/types/durandal/tsconfig.json +++ b/types/durandal/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/durandal/v1/tsconfig.json b/types/durandal/v1/tsconfig.json index 72d8336896..d39bcbc18d 100644 --- a/types/durandal/v1/tsconfig.json +++ b/types/durandal/v1/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/dustjs-linkedin/tsconfig.json b/types/dustjs-linkedin/tsconfig.json index 73305e5459..36a7497468 100644 --- a/types/dustjs-linkedin/tsconfig.json +++ b/types/dustjs-linkedin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dw-bxslider-4/tsconfig.json b/types/dw-bxslider-4/tsconfig.json index 4686df733a..64526359b3 100644 --- a/types/dw-bxslider-4/tsconfig.json +++ b/types/dw-bxslider-4/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index cad6825c27..d72fab058f 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -21,9 +21,11 @@ declare namespace Dynamsoft { namespace WebTwainEnv { function GetWebTwain (cid: string): WebTwain; - function RegisterEvent(event: string, fn: () => void): void; + function RegisterEvent(event: string, fn: (...args: any[]) => void): void; function Load(): void; + function Unload(): void; let AutoLoad: boolean; + let Containers: Container[]; } } @@ -1253,6 +1255,12 @@ declare enum EnumDWT_MouseShape { Zoom = 3 } +interface Container { + ContainerId: string; + Width: string | number; + Height: string | number; +} + /** * @class */ diff --git a/types/dwt/tsconfig.json b/types/dwt/tsconfig.json index 5ff27b3787..db2ac6bbf4 100644 --- a/types/dwt/tsconfig.json +++ b/types/dwt/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dwt/v12/tsconfig.json b/types/dwt/v12/tsconfig.json index 0681765aaf..f856dd2657 100644 --- a/types/dwt/v12/tsconfig.json +++ b/types/dwt/v12/tsconfig.json @@ -7,19 +7,22 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "dwt": [ "dwt/v12" ] + "dwt": [ + "dwt/v12" + ] }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts", + "index.d.ts", "dwt-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dygraphs/index.d.ts b/types/dygraphs/index.d.ts index 33db704b3b..c8617b18fc 100644 --- a/types/dygraphs/index.d.ts +++ b/types/dygraphs/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for dygraphs 1.1.2 +// Type definitions for dygraphs 1.1.3 // Project: http://dygraphs.com -// Definitions by: Dan Vanderkam +// Definitions by: Dan Vanderkam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -595,9 +595,9 @@ declare namespace dygraphs { /** * When to display the legend. By default, it only appears when a user mouses over the chart. * Set it to "always" to always display a legend of some sort. When set to "follow", legend - * follows highlighted points. + * follows highlighted points. If set to 'never' then it will not appear at all. */ - legend?: 'always' | 'follow' | 'onmouseover'; + legend?: 'always' | 'follow' | 'onmouseover' | 'never'; /** * for details see https://github.com/danvk/dygraphs/pull/683 diff --git a/types/dygraphs/tsconfig.json b/types/dygraphs/tsconfig.json index cd2465aaad..c3ff239b4b 100644 --- a/types/dygraphs/tsconfig.json +++ b/types/dygraphs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dymo-label-framework/tsconfig.json b/types/dymo-label-framework/tsconfig.json index 70192c3366..23ac4038d1 100644 --- a/types/dymo-label-framework/tsconfig.json +++ b/types/dymo-label-framework/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/dynatable/tsconfig.json b/types/dynatable/tsconfig.json index 6d37ddabf5..04ffb1120a 100644 --- a/types/dynatable/tsconfig.json +++ b/types/dynatable/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/each/tsconfig.json b/types/each/tsconfig.json index 99df044c84..4b80cb809d 100644 --- a/types/each/tsconfig.json +++ b/types/each/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easeljs/tsconfig.json b/types/easeljs/tsconfig.json index 106e84b3dc..1925fa9a78 100644 --- a/types/easeljs/tsconfig.json +++ b/types/easeljs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-api-request/tsconfig.json b/types/easy-api-request/tsconfig.json index 0f8b3873e0..8cc26d7811 100644 --- a/types/easy-api-request/tsconfig.json +++ b/types/easy-api-request/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "paths": { - "q": [ "q/v0" ] + "q": [ + "q/v0" + ] }, "types": [], "noEmit": true, diff --git a/types/easy-jsend/tsconfig.json b/types/easy-jsend/tsconfig.json index d3fae576d7..3efc497aaf 100644 --- a/types/easy-jsend/tsconfig.json +++ b/types/easy-jsend/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-session/tsconfig.json b/types/easy-session/tsconfig.json index 55a2221348..99d70bf37b 100644 --- a/types/easy-session/tsconfig.json +++ b/types/easy-session/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-table/tsconfig.json b/types/easy-table/tsconfig.json index 6e1d6842b5..4013bbca85 100644 --- a/types/easy-table/tsconfig.json +++ b/types/easy-table/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-x-headers/tsconfig.json b/types/easy-x-headers/tsconfig.json index 21fd3e6cda..e2b2378af6 100644 --- a/types/easy-x-headers/tsconfig.json +++ b/types/easy-x-headers/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-xapi-supertest/tsconfig.json b/types/easy-xapi-supertest/tsconfig.json index ff088ea5e3..91c132409e 100644 --- a/types/easy-xapi-supertest/tsconfig.json +++ b/types/easy-xapi-supertest/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-xapi-utils/tsconfig.json b/types/easy-xapi-utils/tsconfig.json index 5a38347e84..6cd04a79b9 100644 --- a/types/easy-xapi-utils/tsconfig.json +++ b/types/easy-xapi-utils/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easy-xapi/tsconfig.json b/types/easy-xapi/tsconfig.json index b995d431ae..fa0e8da402 100644 --- a/types/easy-xapi/tsconfig.json +++ b/types/easy-xapi/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/easystarjs/tsconfig.json b/types/easystarjs/tsconfig.json index 9c5d14bf1d..0f36761c26 100644 --- a/types/easystarjs/tsconfig.json +++ b/types/easystarjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ebongarde-root/tsconfig.json b/types/ebongarde-root/tsconfig.json index f34a4dc97f..4765268055 100644 --- a/types/ebongarde-root/tsconfig.json +++ b/types/ebongarde-root/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "ebongarde-root-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/echarts/tsconfig.json b/types/echarts/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/echarts/tsconfig.json +++ b/types/echarts/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ecurve/tsconfig.json b/types/ecurve/tsconfig.json index e1fbd679a4..b3d1d586fe 100644 --- a/types/ecurve/tsconfig.json +++ b/types/ecurve/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/egg-mock/tsconfig.json b/types/egg-mock/tsconfig.json index 9313ec5190..86b33fc149 100644 --- a/types/egg-mock/tsconfig.json +++ b/types/egg-mock/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/egg.js/tsconfig.json b/types/egg.js/tsconfig.json index 00ca6481ae..c7364d3f99 100644 --- a/types/egg.js/tsconfig.json +++ b/types/egg.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/egg/tsconfig.json b/types/egg/tsconfig.json index d2369bc5bf..3c2ca61db1 100644 --- a/types/egg/tsconfig.json +++ b/types/egg/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/egjs__axes/tsconfig.json b/types/egjs__axes/tsconfig.json index 7d20117cc0..3086687bc3 100644 --- a/types/egjs__axes/tsconfig.json +++ b/types/egjs__axes/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -14,13 +15,17 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "paths":{ - "@egjs/component": ["egjs__component"], - "@egjs/axes": ["egjs__axes"] + "paths": { + "@egjs/component": [ + "egjs__component" + ], + "@egjs/axes": [ + "egjs__axes" + ] } }, "files": [ "index.d.ts", "egjs__axes-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/egjs__component/tsconfig.json b/types/egjs__component/tsconfig.json index b010a23eed..778e5a9f16 100644 --- a/types/egjs__component/tsconfig.json +++ b/types/egjs__component/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -14,12 +15,14 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "paths":{ - "@egjs/component": ["egjs__component"] + "paths": { + "@egjs/component": [ + "egjs__component" + ] } }, "files": [ "index.d.ts", "egjs__component-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 9332c9bf1f..d1d67be14c 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -20,7 +20,7 @@ module AccordionComponent { }); } - + module AutocompleteComponent{ var carList = [ @@ -44,15 +44,15 @@ module AutocompleteComponent{ "Triumph Spitfire", "Toyota 2000GT", "Volvo P1800", "Volkswagen Shirako" ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -166,7 +166,7 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: { @@ -181,28 +181,28 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: + border : {width: 2} + }, + series: [ { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], name: 'India' - }, + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], name: 'Germany' }, { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], name: 'England' - }, + }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], name: 'France' } ], @@ -290,7 +290,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -387,7 +387,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -412,7 +412,7 @@ function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -462,7 +462,7 @@ module digitalgaugecomponent { } - + @@ -482,12 +482,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -523,7 +523,7 @@ module GanttComponent { dataSource: (window).projectData, allowColumnResize: true, allowSorting: true, - allowSelection: true, + allowSelection: true, enableContextMenu: true, taskIdMapping: "taskID", allowDragAndDrop: true, @@ -564,7 +564,7 @@ module GanttComponent { treeColumnIndex: 1, isResponsive: true, }); -}); +}); } @@ -606,7 +606,7 @@ module GridComponent { -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Flďż˝temysost"] +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Flřtemysost"] var itemSource: any[] = []; for (var i = 0; i < columns.length; i++) { for (var j = 0; j < 6; j++) { @@ -680,7 +680,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -706,14 +706,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } + - - + module ListBoxComponent { $(function () { @@ -723,12 +723,12 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, + enableCheckMark: true, width: 400 }); }); @@ -770,7 +770,7 @@ var world_map= { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Cďż˝te d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, @@ -993,7 +993,7 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { @@ -1033,7 +1033,7 @@ module PivotChartOlap { $(function () { var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", + data: "http://bi.syncfusion.com/olap/msmdpump.dll", catalog: "Adventure Works DW 2008 SE", cube: "Adventure Works", rows: [ @@ -1201,7 +1201,7 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1230,7 +1230,7 @@ module PivotGaugeOlap { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1248,7 +1248,7 @@ module PivotGaugeOlap { }] }] }); - }); + }); } @@ -1322,7 +1322,7 @@ module PivotGaugeRelational { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1351,7 +1351,7 @@ module PivotGaugeRelational { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1369,7 +1369,7 @@ module PivotGaugeRelational { }] }] }); - }); + }); } @@ -1404,7 +1404,7 @@ module PivotGridOlap { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); @@ -1455,7 +1455,7 @@ module PivotGridRelational { fieldCaption: "State" } ], - columns: + columns: [{ fieldName: "Product", fieldCaption: "Product" @@ -1473,10 +1473,10 @@ module PivotGridRelational { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1617,7 +1617,7 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { @@ -1650,7 +1650,7 @@ module rangecomponent { fill: '#69D2E7' } ]; - } + } }); }); @@ -1702,7 +1702,7 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, @@ -1733,7 +1733,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1766,7 +1766,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1848,7 +1848,7 @@ module RibbonComponent { width: 60, isBig: false } - }] + }] }, { text: "Font", alignType: "rows", content: [{ @@ -2149,7 +2149,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2161,7 +2161,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2173,7 +2173,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2416,7 +2416,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2446,7 +2446,7 @@ function onClick(args) { - + module RotatorComponent { $(function () { @@ -2609,7 +2609,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2621,9 +2621,7 @@ module ScrollerComponent { }); $(window).bind('resize', function () { scrollerSample.refresh(); - }); - - }); + }); }); } @@ -2790,9 +2788,9 @@ module piesparkline4 { }); } + - - + module SplitterComponent { @@ -2827,7 +2825,7 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { + loadComplete: () => { var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; if (!(spreadsheet).isImport) { spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); @@ -2851,13 +2849,13 @@ var default_data: Array = [ { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, @@ -2866,13 +2864,13 @@ var default_data: Array = [ { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, @@ -2882,7 +2880,7 @@ var default_data: Array = [ module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ {groupMemberPath: "Country"}, {groupMemberPath: "JobDescription"}, @@ -2921,8 +2919,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2953,7 +2951,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -2993,7 +2991,7 @@ module EditorComponent { - + module TileViewComponent { $(function () { @@ -3004,38 +3002,38 @@ module TileViewComponent { imageUrl:'content/images/tile/windows/people_1.png' }); var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + imageUrl:'content/images/tile/windows/alerts.png', + }); var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + imageUrl:'content/images/tile/windows/bing.png', }); var tile4 = new ej.Tile($("#tile4"), { tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + imageUrl:'content/images/tile/windows/camera.png', }); var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + imageUrl:'content/images/tile/windows/messages.png', }); var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", + imagePosition:"center", tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', + imageUrl:'content/images/tile/windows/games.png', caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { + var tile7 = new ej.Tile($("#tile7"), { tileSize:"medium", imageUrl:'content/images/tile/windows/map.png', caption:{text:"Maps"} }); var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", + imagePosition:"fill", tileSize:"wide", imageUrl:'content/images/tile/windows/sports.png', caption:{text:"Sports"} @@ -3087,13 +3085,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3106,7 +3104,7 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { var sample1 = new ej.Tooltip($("#link1"),{ @@ -3201,7 +3199,7 @@ module TreeGridComponent { isResponsive: true, }); }); -} +} @@ -3246,7 +3244,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3263,7 +3261,7 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: (window).baseurl + "api/uploadbox/Save", diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index ebbe57194d..e9f83b680c 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 15.3.0.29 +* version : 15.3.0.33 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -37,7 +37,7 @@ declare namespace ej { function createObject(nameSpace: string, value: any, initIn: any): JQuery; function createObject(element: any, eventEmitter: any, model: any): any; function setCulture(culture: string): void; - function getObject(element: string, model: any): T; + function getObject(element: string, model: any): any; function getObject(nameSpace: string, fromdata?: any): any; function defineClass(className: string, constructor: any, proto: any, replace: boolean): any; function destroyWidgets(element: any): void; @@ -7732,7 +7732,7 @@ declare namespace ej { */ enableRTL?: boolean; - /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set "showHeader" as true since the favicon will be displayed in the dialog + /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set 'showHeader' as true since the favicon will be displayed in the dialog * header. */ faviconCSS?: string; @@ -7791,7 +7791,7 @@ declare namespace ej { */ target?: string; - /** The title text to be displayed in the dialog header. In order to set title, you need to set "showHeader" as true since the title will be displayed in the dialog header. + /** The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header. */ title?: string; @@ -8443,6 +8443,12 @@ declare namespace ej { */ enableFilterSearch?: boolean; + /** The serverfiltering is to perform filter action when text is typed in the search box and filtering will be done based on the collection which contains the matched item from entire + * datasource. Serverfiltering will be done based on the entire items in DataSource. + * @Default {false} + */ + enableServerFiltering?: boolean; + /** Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and it is applied from the * browser cookies. * @Default {false} @@ -10273,7 +10279,7 @@ declare namespace ej { /** Specifies the field settings to map the datasource. */ - fieldSettings?: any; + fieldSettings?: FieldSettings; /** Contains the array of items to be added in ListView. * @Default {[]} @@ -10644,6 +10650,61 @@ declare namespace ej { */ type?: string; } + + export interface FieldSettings { + + /** Defines the specific field name which contains Boolean values to specify whether the list items to be checked by default or not. + */ + checked?: boolean; + + /** Defines the URL to be navigated while clicking the list item. + */ + navigateUrl?: string; + + /** Defines the HTML attributes such as id, class, styles for the specific list item. + */ + attributes?: any; + + /** Defines the specific field name which contains id values for the list items. + */ + id?: string; + + /** Defines the URL for the image to be displayed in the list item. + */ + imageUrl?: string; + + /** Defines the class name for image in that specific list items. + */ + imageClass?: string; + + /** Specifies whether to prevent the selection of the list item. + */ + preventSelection?: boolean; + + /** Specifies whether to retain the selection of the list item. + */ + persistSelection?: boolean; + + /** To define the first level of list items. + */ + primaryKey?: string; + + /** To define the child level of list items inside the parent items. + */ + parentPrimaryKey?: string; + + /** Defines the specific field name in the data source to load the list with data. + */ + text?: string; + + /** To trigger the mouseup event for specific list items. + */ + mouseUP?: string; + + /** To trigger the mousedown event for specific list items. + */ + mouseDown?: string; + } } class MaskEdit extends ej.Widget { @@ -10721,6 +10782,11 @@ declare namespace ej { */ inputMode?: ej.InputMode|string; + /** Defines the localization culture for MaskEdit. + * @Default {en-US} + */ + locale?: string; + /** Specifies the input mask. * @Default {null} */ @@ -11741,7 +11807,7 @@ declare namespace ej { */ externalStyles?: string; - /** Prepend a doctype to the document frame. + /** Prepend a docType to the document frame. * @Default {<!doctype html>} */ docType?: string; @@ -15901,7 +15967,7 @@ declare namespace ej { /** Performs the action value based on the given command. * @param {string} Command Name. * @param {any} Content to be inserted as argument. - * @param {boolean} Boolean value to specify whether the argument is textnode or not, this is optional. + * @param {boolean} Boolean value to specify whether the argument is textNode or not, this is optional. * @returns {void} */ executeCommand(cmdName: string, args: any, textnodeType?: boolean): void; @@ -22044,6 +22110,19 @@ declare namespace ej { */ cancelEditCell(): void; + /** Returns the total page size need to be displayed in grid based on the given container height. This method will also work when the property allowTextWrap as true only when wrap + * mode is header. + * @param {number} When passing the container height as integer or percentage, it will returns the page size that need to be displayed for grid. + * @returns {number} + */ + calculatePageSizeByParentHeight(containerHeight: number): number; + + /** It is used to change the number of records displayed per page in grid based on the given page size. + * @param {number} When passing the page size, it will change the number of records displayed per page in grid. + * @returns {void} + */ + changePageSize(pageSize: number): void; + /** It is used to clear all the cell selection. * @returns {boolean} */ @@ -22169,7 +22248,7 @@ declare namespace ej { export(action?: string, serverEvent?: string, multipleExport?: boolean, gridIds?: any[]): void; /** Send a filtering request to filter one column in grid. - * @param {any[]} Pass the field name of the column + * @param {any[]|string} Pass the field name of the column * @param {string} string/integer/dateTime operator * @param {string} Pass the value to be filtered in a column * @param {string} Pass the predicate as and/or @@ -22177,7 +22256,7 @@ declare namespace ej { * @param {any} optionalactualFilterValue denote the filter object of current filtered columns.Pass the value to filtered in a column * @returns {void} */ - filterColumn(fieldName: any[], filterOperator: string, filterValue: string, predicate: string, matchcase?: boolean, actualFilterValue?: any): void; + filterColumn(fieldName: any[]|string, filterOperator: string, filterValue: string, predicate: string, matchcase?: boolean, actualFilterValue?: any): void; /** Send a filtering request to filter single or multiple column in grid. * @param {any[]} Pass array of filterColumn query for performing filter operation @@ -25152,7 +25231,7 @@ declare namespace ej { /** Gets or sets a value that indicates to display a column value as checkbox or string * @Default {true} */ - displayAsCheckBox?: boolean; + displayAsCheckbox?: boolean; /** Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType */ @@ -25288,6 +25367,11 @@ declare namespace ej { * @Default {[]} */ subMenu?: any[]; + + /** Used to get or set the sub menu items to the custom context menu item using JsRender template. + * @Default {null} + */ + template?: string; } export interface ContextMenuSettings { @@ -51454,6 +51538,11 @@ declare namespace ej.datavisualization { /** Name of the event */ type?: string; + + /** location - X and Y co-ordinate of the points with respect to chart area.id - ID of the target element. size - Width and height of the chart. pageX - x-coordinate of the + * pointer, relative to the page pageY - y-coordinate of the pointer, relative to the page + */ + data?: any; } export interface ChartDoubleClickEventArgs { @@ -51469,6 +51558,11 @@ declare namespace ej.datavisualization { /** Name of the event */ type?: string; + + /** location - X and Y co-ordinate of the points with respect to chart area.id - ID of the target element. size - Width and height of the chart. pageX - x-coordinate of the + * pointer, relative to the page pageY - y-coordinate of the pointer, relative to the page + */ + data?: any; } export interface ChartMouseLeaveEventArgs { @@ -51564,7 +51658,7 @@ declare namespace ej.datavisualization { */ type?: string; - /** errorbar - Error bar Object + /** errorBar - Error bar Object */ data?: any; } @@ -51583,7 +51677,7 @@ declare namespace ej.datavisualization { */ type?: string; - /** multilevellabels - MultiLevel Label Object + /** MultiLevelLabels - MultiLevel Label Object */ data?: any; } @@ -51996,7 +52090,7 @@ declare namespace ej.datavisualization { export interface CommonSeriesOptionsBubbleOptions { /** Used for the calculation of the bubble radius based on the mode selected - * @Default {minmax} + * @Default {minMax} */ radiusMode?: ej.datavisualization.Chart.RadiusMode|string; @@ -52980,7 +53074,7 @@ declare namespace ej.datavisualization { */ pieOfPieCoefficient?: number; - /** Split Value of pieofpie series. + /** Split Value of pieOfPie series. * @Default {null} */ splitValue?: string; @@ -55968,7 +56062,7 @@ declare namespace ej.datavisualization { export interface SeriesBubbleOptions { /** Used for the calculation of the bubble radius based on the mode selected - * @Default {minmax .See RadiusMode} + * @Default {minMax .See RadiusMode} */ radiusMode?: ej.datavisualization.Chart.RadiusMode|string; @@ -57257,7 +57351,7 @@ declare namespace ej.datavisualization { */ pieOfPieCoefficient?: number; - /** Split Value of pieofpie series. + /** Split Value of pieOfPie series. * @Default {null} */ splitValue?: string; @@ -61343,7 +61437,7 @@ declare namespace ej.datavisualization { valuePath?: string; } - export interface LayersSublayersBubbleSettingsColorMappingsRangeColorMapping { + export interface LayersSubLayersBubbleSettingsColorMappingsRangeColorMapping { /** Start range colorMappings in the bubble layer. * @Default {null} @@ -61365,15 +61459,15 @@ declare namespace ej.datavisualization { color?: string; } - export interface LayersSublayersBubbleSettingsColorMappings { + export interface LayersSubLayersBubbleSettingsColorMappings { /** Specifies the range colorMappings in the bubble layer. * @Default {null} */ - rangeColorMapping?: LayersSublayersBubbleSettingsColorMappingsRangeColorMapping[]; + rangeColorMapping?: LayersSubLayersBubbleSettingsColorMappingsRangeColorMapping[]; } - export interface LayersSublayersBubbleSettings { + export interface LayersSubLayersBubbleSettings { /** Specifies the bubble Opacity value of bubbles for shape layer in map * @Default {0.9} @@ -61388,7 +61482,7 @@ declare namespace ej.datavisualization { /** Specifies the colorMappings of the shape layer in map * @Default {null} */ - colorMappings?: LayersSublayersBubbleSettingsColorMappings; + colorMappings?: LayersSubLayersBubbleSettingsColorMappings; /** Specifies the bubble color valuePath of the shape layer in map * @Default {null} @@ -61426,7 +61520,7 @@ declare namespace ej.datavisualization { valuePath?: string; } - export interface LayersSublayersLabelSettings { + export interface LayersSubLayersLabelSettings { /** enable or disable the enableSmartLabel property * @Default {false} @@ -61454,7 +61548,7 @@ declare namespace ej.datavisualization { smartLabelSize?: ej.datavisualization.Map.LabelSize|string; } - export interface LayersSublayersLegendSettings { + export interface LayersSubLayersLegendSettings { /** Determines whether the legend should be placed outside or inside the map bounds * @Default {false} @@ -61547,7 +61641,7 @@ declare namespace ej.datavisualization { width?: number; } - export interface LayersSublayersShapeSettingsColorMappingsRangeColorMapping { + export interface LayersSubLayersShapeSettingsColorMappingsRangeColorMapping { /** Specifies the start range colorMappings in the shape layer of map. * @Default {null} @@ -61565,7 +61659,7 @@ declare namespace ej.datavisualization { gradientColors?: any[]; } - export interface LayersSublayersShapeSettingsColorMappingsEqualColorMapping { + export interface LayersSubLayersShapeSettingsColorMappingsEqualColorMapping { /** Specifies the equalColorMapping value in the shape layer of map. * @Default {null} @@ -61578,20 +61672,20 @@ declare namespace ej.datavisualization { color?: string; } - export interface LayersSublayersShapeSettingsColorMappings { + export interface LayersSubLayersShapeSettingsColorMappings { /** Specifies the range colorMappings in the shape layer of map. * @Default {null} */ - rangeColorMapping?: LayersSublayersShapeSettingsColorMappingsRangeColorMapping[]; + rangeColorMapping?: LayersSubLayersShapeSettingsColorMappingsRangeColorMapping[]; /** Specifies the equalColorMapping in the shape layer of map. * @Default {null} */ - equalColorMapping?: LayersSublayersShapeSettingsColorMappingsEqualColorMapping[]; + equalColorMapping?: LayersSubLayersShapeSettingsColorMappingsEqualColorMapping[]; } - export interface LayersSublayersShapeSettings { + export interface LayersSubLayersShapeSettings { /** Enables or Disables the auto fill colors for shape layer in map. When this property value set to true, shapes will be filled with palette colors. * @Default {false} @@ -61601,7 +61695,7 @@ declare namespace ej.datavisualization { /** Specifies the colorMappings of the shape layer in map * @Default {null} */ - colorMappings?: LayersSublayersShapeSettingsColorMappings; + colorMappings?: LayersSubLayersShapeSettingsColorMappings; /** Specifies the shape color palette value of the shape layer in map. Accepted colorPalette values are palette1, palette2, palette3 and custompalette. * @Default {palette1} @@ -61669,7 +61763,7 @@ declare namespace ej.datavisualization { valuePath?: string; } - export interface LayersSublayer { + export interface LayersSubLayer { /** to get the type of bing map. * @Default {aerial} @@ -61678,7 +61772,7 @@ declare namespace ej.datavisualization { /** Specifies the bubble settings for map */ - bubbleSettings?: LayersSublayersBubbleSettings; + bubbleSettings?: LayersSubLayersBubbleSettings; /** Specifies the datasource for the shape layer */ @@ -61709,7 +61803,7 @@ declare namespace ej.datavisualization { /** Options for enabling and configuring labelSettings labelPath, smartLabelSize, labelLength etc., */ - labelSettings?: LayersSublayersLabelSettings; + labelSettings?: LayersSubLayersLabelSettings; /** Specifies the map view type. * @Default {'geographic'} @@ -61723,7 +61817,7 @@ declare namespace ej.datavisualization { /** Options for enabling and configuring legendSettings position, height, width, mode, type etc., */ - legendSettings?: LayersSublayersLegendSettings; + legendSettings?: LayersSubLayersLegendSettings; /** Specifies the map items template for shapes. */ @@ -61754,7 +61848,7 @@ declare namespace ej.datavisualization { /** Specifies the shape settings of map layer */ - shapeSettings?: LayersSublayersShapeSettings; + shapeSettings?: LayersSubLayersShapeSettings; /** Shows or hides the map items. * @Default {false} @@ -61884,7 +61978,7 @@ declare namespace ej.datavisualization { /** Sublayer is the collection of shape Layer */ - sublayers?: LayersSublayer[]; + subLayers?: LayersSubLayer[]; } } namespace Map { @@ -62606,7 +62700,7 @@ declare namespace ej.datavisualization { //Wrap the label by letter when its width exceeds grid width Wrap, //Wrap the label by word when its width exceeds grid width - Wrapbyword, + WrapByWord, } } namespace TreeMap { @@ -64075,11 +64169,11 @@ declare namespace ej.datavisualization { /** A method that defines whether the command is executable at the moment or not. */ - canExecute?: '() => void'; + canExecute?: any; /** A method that defines what to be executed when the key combination is recognized. */ - execute?: '() => void'; + execute?: any; /** Defines a combination of keys and key modifiers, on recognition of which the command will be executed */ @@ -64871,24 +64965,24 @@ declare namespace ej.datavisualization { /** A method that takes a history entry as argument and returns whether the specific entry can be popped or not */ - canPop?: '() => void'; + canPop?: any; /** A method that ends grouping the changes */ - closeGroupAction?: '() => void'; + closeGroupAction?: any; /** A method that removes the history of a recent change made in diagram */ - pop?: '() => void'; + pop?: any; /** A method that allows to track the custom changes made in diagram */ - push?: '() => void'; + push?: any; /** Defines what should be happened while trying to restore a custom change * @Default {null} */ - redo?: '() => void'; + redo?: any; /** The redoStack property is used to get the number of redo actions to be stored on the history manager. Its an read-only property and the collection should not be modified. * @Default {[]} @@ -64902,11 +64996,11 @@ declare namespace ej.datavisualization { /** A method that starts to group the changes to revert/restore them in a single undo or redo */ - startGroupAction?: '() => void'; + startGroupAction?: any; /** Defines what should be happened while trying to revert a custom change */ - undo?: '() => void'; + undo?: any; /** The undoStack property is used to get the number of undo actions to be stored on the history manager. Its an read-only property and the collection should not be modified. * @Default {[]} @@ -65197,6 +65291,11 @@ declare namespace ej.datavisualization { */ stops?: any[]; + /** Defines the type of gradient + * @Default {linear} + */ + type?: string; + /** Defines the left most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ @@ -65220,6 +65319,11 @@ declare namespace ej.datavisualization { export interface NodesGradientRadialGradient { + /** Defines the type of gradient + * @Default {radial} + */ + type?: string; + /** Defines the position of the outermost circle * @Default {0} */ diff --git a/types/ej.web.all/tsconfig.json b/types/ej.web.all/tsconfig.json index e187b54f67..0a0a2b79e4 100644 --- a/types/ej.web.all/tsconfig.json +++ b/types/ej.web.all/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "ej.web.all-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ej.web.all/tslint.json b/types/ej.web.all/tslint.json index fe15198aba..d396efe0bf 100644 --- a/types/ej.web.all/tslint.json +++ b/types/ej.web.all/tslint.json @@ -7,6 +7,7 @@ "no-mergeable-namespace": false, "no-padding": false, "no-any-union": false, + "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, "strict-export-declare-modifiers": false } diff --git a/types/ejs-locals/tsconfig.json b/types/ejs-locals/tsconfig.json index ee2ef81723..7f549cd0a6 100644 --- a/types/ejs-locals/tsconfig.json +++ b/types/ejs-locals/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ejs/tsconfig.json b/types/ejs/tsconfig.json index ce3a024d24..ea91455364 100644 --- a/types/ejs/tsconfig.json +++ b/types/ejs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ejson/tsconfig.json b/types/ejson/tsconfig.json index 95efe7696b..3769f3db66 100644 --- a/types/ejson/tsconfig.json +++ b/types/ejson/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/elastic.js/tsconfig.json b/types/elastic.js/tsconfig.json index 219dffce02..6a705c4c27 100644 --- a/types/elastic.js/tsconfig.json +++ b/types/elastic.js/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/elasticsearch/tsconfig.json b/types/elasticsearch/tsconfig.json index af051e1a4f..2d62eac43d 100644 --- a/types/elasticsearch/tsconfig.json +++ b/types/elasticsearch/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-config/tsconfig.json b/types/electron-config/tsconfig.json index 0d3777a09e..8462205033 100644 --- a/types/electron-config/tsconfig.json +++ b/types/electron-config/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "electron-config-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-debug/tsconfig.json b/types/electron-debug/tsconfig.json index 4279922d08..65a83c7c64 100644 --- a/types/electron-debug/tsconfig.json +++ b/types/electron-debug/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-devtools-installer/tsconfig.json b/types/electron-devtools-installer/tsconfig.json index 66e41ee094..77fbb1d7c5 100644 --- a/types/electron-devtools-installer/tsconfig.json +++ b/types/electron-devtools-installer/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-is-dev/tsconfig.json b/types/electron-is-dev/tsconfig.json index 91aa840742..1260f76477 100644 --- a/types/electron-is-dev/tsconfig.json +++ b/types/electron-is-dev/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "electron-is-dev-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-json-storage/tsconfig.json b/types/electron-json-storage/tsconfig.json index 66c91844db..d5bbe0168b 100644 --- a/types/electron-json-storage/tsconfig.json +++ b/types/electron-json-storage/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-notifications/tsconfig.json b/types/electron-notifications/tsconfig.json index cfe77deb03..b5d1926fe9 100644 --- a/types/electron-notifications/tsconfig.json +++ b/types/electron-notifications/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-notify/tsconfig.json b/types/electron-notify/tsconfig.json index 6bdc138b0b..49580cd305 100644 --- a/types/electron-notify/tsconfig.json +++ b/types/electron-notify/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-packager/tsconfig.json b/types/electron-packager/tsconfig.json index 789b385fea..76f19f8f73 100644 --- a/types/electron-packager/tsconfig.json +++ b/types/electron-packager/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-settings/tsconfig.json b/types/electron-settings/tsconfig.json index a9a5a70afc..badf76a8d0 100644 --- a/types/electron-settings/tsconfig.json +++ b/types/electron-settings/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "electron-settings-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-settings/v2/tsconfig.json b/types/electron-settings/v2/tsconfig.json index 335711f7ef..810fdbd504 100644 --- a/types/electron-settings/v2/tsconfig.json +++ b/types/electron-settings/v2/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" @@ -25,4 +26,4 @@ "index.d.ts", "electron-settings-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-store/tsconfig.json b/types/electron-store/tsconfig.json index 311e831103..6f21caec55 100644 --- a/types/electron-store/tsconfig.json +++ b/types/electron-store/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "electron-store-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-window-state/tsconfig.json b/types/electron-window-state/tsconfig.json index 3b9710d961..3843443cda 100644 --- a/types/electron-window-state/tsconfig.json +++ b/types/electron-window-state/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/electron-winstaller/tsconfig.json b/types/electron-winstaller/tsconfig.json index f208c4761f..af16777473 100644 --- a/types/electron-winstaller/tsconfig.json +++ b/types/electron-winstaller/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "electron-winstaller-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/element-ready/tsconfig.json b/types/element-ready/tsconfig.json index 42de8557bc..e5067c7ccf 100644 --- a/types/element-ready/tsconfig.json +++ b/types/element-ready/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "element-ready-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/element-resize-event/tsconfig.json b/types/element-resize-event/tsconfig.json index 74215ead8a..9d86e4632f 100644 --- a/types/element-resize-event/tsconfig.json +++ b/types/element-resize-event/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/elm/tsconfig.json b/types/elm/tsconfig.json index 0d8045c6c7..bca395d3c2 100644 --- a/types/elm/tsconfig.json +++ b/types/elm/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/email-addresses/tsconfig.json b/types/email-addresses/tsconfig.json index b8b983cf3a..2cda1ddc36 100644 --- a/types/email-addresses/tsconfig.json +++ b/types/email-addresses/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/email-templates/tsconfig.json b/types/email-templates/tsconfig.json index cf59410224..5a2994bb04 100644 --- a/types/email-templates/tsconfig.json +++ b/types/email-templates/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "email-templates-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/email-validator/tsconfig.json b/types/email-validator/tsconfig.json index b2af15fd62..d126e18174 100644 --- a/types/email-validator/tsconfig.json +++ b/types/email-validator/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ember-testing-helpers/ember-testing-helpers-tests.ts b/types/ember-testing-helpers/ember-testing-helpers-tests.ts index 3691e3ede0..01ee44b338 100644 --- a/types/ember-testing-helpers/ember-testing-helpers-tests.ts +++ b/types/ember-testing-helpers/ember-testing-helpers-tests.ts @@ -1,12 +1,12 @@ -import RSVP = require('rsvp'); +import RSVP from 'rsvp'; function testAndThen() { - const result: RSVP.Promise = andThen(() => 'some string'); + const result: RSVP.Promise = andThen(() => 'some string'); result.then(s => s.length); } function testClick() { - const result: RSVP.Promise = click('someString'); + const result: RSVP.Promise = click('someString'); result.then(() => {}); } @@ -29,7 +29,7 @@ function testFillIn() { const textResult = fillIn('.foo', 'waffles'); textResult.then(() => true); const contextResult = fillIn('.bar', {}, 'pancakes'); - contextResult.catch(reason => false); + contextResult.catch((reason: any) => false); } function testFind() { diff --git a/types/ember-testing-helpers/index.d.ts b/types/ember-testing-helpers/index.d.ts index 33231a0b65..8bbbcc09f7 100644 --- a/types/ember-testing-helpers/index.d.ts +++ b/types/ember-testing-helpers/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for ember-testing/lib/helpers // Project: https://github.com/emberjs/ember.js/tree/master/packages/ember-testing/lib/helpers -// Definitions by: Chris Krycho +// Definitions by: Chris Krycho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 // Note that these are distributed separately because they represent a discrete // set of functionality, and as globally-injected items (as of Ember 2.13), are @@ -10,14 +10,14 @@ /// -import RSVP = require('rsvp'); +import RSVP from 'rsvp'; type KeyEventType = 'keydown' | 'keyup' | 'keypress'; -type WaitResult = RSVP.Promise; +type WaitResult = RSVP.Promise; declare global { // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/and_then.js - function andThen(callback: (...args: any[]) => T): RSVP.Promise; + function andThen(callback: (...args: any[]) => T): RSVP.Promise; // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/click.js function click(selector: string, context?: Object): WaitResult; @@ -45,7 +45,7 @@ declare global { function keyEvent(selector: string, type: KeyEventType, keyCode: number): WaitResult; // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/pause_test.js - function pauseTest(): RSVP.Promise<{}, never>; + function pauseTest(): RSVP.Promise<{}>; function resumeTest(): void; // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/trigger_event.js diff --git a/types/ember-testing-helpers/tsconfig.json b/types/ember-testing-helpers/tsconfig.json index aaf474ecba..622d4d1584 100644 --- a/types/ember-testing-helpers/tsconfig.json +++ b/types/ember-testing-helpers/tsconfig.json @@ -8,10 +8,9 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true @@ -20,4 +19,4 @@ "index.d.ts", "ember-testing-helpers-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts old mode 100644 new mode 100755 index 60b2f28f70..62b6a81a77 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1,2543 +1,3672 @@ -// Type definitions for Ember.js 2.7 +// Type definitions for Ember.js 2.8 // Project: http://emberjs.com/ // Definitions by: Jed Mao // bttf +// Derek Wickern +// Chris Krycho +// Theron Cross // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /// /// -// Capitalization is intentional: this makes it much easier to re-export RSVP on -// the Ember namespace. -import Rsvp = require('rsvp'); +declare module 'ember' { + // Capitalization is intentional: this makes it much easier to re-export RSVP on + // the Ember namespace. + import Rsvp from 'rsvp'; + import { TemplateFactory } from 'htmlbars-inline-precompile'; -declare namespace EmberStates { - interface Transition { - targetName: string; - urlMethod: string; - intent: any; - params: {} | any; - pivotHandler: any; - resolveIndex: number; - handlerInfos: any; - resolvedModels: {} | any; - isActive: boolean; - state: any; - queryParams: {} | any; - queryParamsOnly: boolean; + // Get an alias to the global Array type to use in inner scope below. + type GlobalArray = T[]; - isTransition: boolean; + /** + * Deconstructs computed properties into the types which would be returned by `.get()`. + */ + type ComputedProperties = { [K in keyof T]: Ember.ComputedProperty | T[K] }; - /** - The Transition's internal promise. Calling `.then` on this property - is that same as calling `.then` on the Transition object itself, but - this property is exposed for when you want to pass around a - Transition's promise, but not the Transition object itself, since - Transition object can be externally `abort`ed, while the promise - cannot. - */ - promise: Rsvp.Promise; + /** + * Check that any arguments to `create()` match the type's properties. + * + * Accept any additional properties and add merge them into the instance. + */ + type EmberInstanceArguments = Partial & { + [key: string]: any; + }; - /** - Custom state can be stored on a Transition's `data` object. - This can be useful for decorating a Transition within an earlier - hook and shared with a later hook. Properties set on `data` will - be copied to new transitions generated by calling `retry` on this - transition. - */ - data: any; - - /** - A standard promise hook that resolves if the transition - succeeds and rejects if it fails/redirects/aborts. - - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @arg {Function} onFulfilled - @arg {Function} onRejected - @arg {String} label optional string for labeling the promise. Useful for tooling. - @return {Promise} - */ - then(onFulfilled: Function, onRejected?: Function, label?: string): Rsvp.Promise; - - /** - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @method catch - @arg {Function} onRejection - @arg {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch(onRejection: Function, label?: string): Rsvp.Promise; - - /** - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @method finally - @arg {Function} callback - @arg {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally(callback: Function, label?: string): Rsvp.Promise; - - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. - */ - abort(): EmberStates.Transition; - normalize(manager: Ember.StateManager, contexts: any[]): void; - - /** - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. - */ - retry(): EmberStates.Transition; - - /** - Sets the URL-changing method to be employed at the end of a - successful transition. By default, a new Transition will just - use `updateURL`, but passing 'replace' to this method will - cause the URL to update using 'replaceWith' instead. Omitting - a parameter will disable the URL change, allowing for transitions - that don't update the URL at completion (this is also used for - handleURL, since the URL has already changed before the - transition took place). - - @arg {String} method the type of URL-changing method to use - at the end of a transition. Accepted values are 'replace', - falsy values, or any other non-falsy value (which is - interpreted as an updateURL transition). - - @return {Transition} this transition - */ - method(method: string): EmberStates.Transition; - - /** - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. - - Note: This method is also aliased as `send` - - @arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error - @arg {String} name the name of the event to fire - */ - trigger(ignoreFailure: boolean, eventName: string): void; - /** - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. - - Note: This method is also aliased as `send` - - @arg {String} name the name of the event to fire - */ - trigger(eventName: string): void; - - /** - Transitions are aborted and their promises rejected - when redirects occur; this method returns a promise - that will follow any redirects that occur and fulfill - with the value fulfilled by any redirecting transitions - that occur. - - @return {Promise} a promise that fulfills with the same - value that the final redirecting transition fulfills with - */ - followRedirects(): Rsvp.Promise; + /** + * Accept any additional properties and add merge them into the prototype. + */ + interface EmberClassArguments { + [key: string]: any; } -} -// Get an alias to the global Array type to use in inner scope below. -type GlobalArray = T[]; + /** + * Map type `T` to a plain object hash with the identity mapping. + * + * Discards any additional object identity like the ability to `new()` up the class. + * The `new()` capability is added back later by merging `EmberClassConstructor` + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ + type Objectify = Readonly; -declare namespace EmberTesting { - namespace Test { - class Adapter { - asyncEnd(): void; - asyncStart(): void; - exception(error: string): void; + type Fix = { [K in keyof T]: T[K] }; + + /** + * Ember.Object.extend(...) accepts any number of mixins or literals. + */ + type MixinOrLiteral = Ember.Mixin | T; + + /** + * Used to infer the type of ember classes of type `T`. + * + * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. + * + * The no-arg constructor is required by the typescript compiler. + * The multi-arg constructor is included for better ergonomics. + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ + type EmberClassConstructor = (new () => T) & (new (...args: any[]) => T); + + type ComputedPropertyGetterFunction = (this: any, key: string) => T; + + interface ComputedPropertyGet { + get(this: any, key: string): T; + } + + interface ComputedPropertySet { + set(this: any, key: string, value: T): T; + } + + type ComputedPropertyCallback = + | ComputedPropertyGetterFunction + | ComputedPropertyGet + | ComputedPropertySet + | (ComputedPropertyGet & ComputedPropertySet); + + interface ActionsHash { + [index: string]: (...params: any[]) => any; + } + + interface EmberRunTimer { + __ember_run_timer_brand__: any; + } + + type RunMethod = ((this: Target, ...args: any[]) => Ret) | keyof Target; + type EmberRunQueues = + | 'sync' + | 'actions' + | 'routerTransitions' + | 'render' + | 'afterRender' + | 'destroy'; + + type ObserverMethod = + | (keyof Target) + | ((this: Target, sender: Sender, key: keyof Sender, value: any, rev: number) => void); + + interface RenderOptions { + into?: string; + controller?: string; + model?: any; + outlet?: string; + view?: string; + } + + interface RouteQueryParam { + refreshModel?: boolean; + replace?: boolean; + as?: string; + } + + interface EventDispatcherEvents { + touchstart?: string | null; + touchmove?: string | null; + touchend?: string | null; + touchcancel?: string | null; + keydown?: string | null; + keyup?: string | null; + keypress?: string | null; + mousedown?: string | null; + mouseup?: string | null; + contextmenu?: string | null; + click?: string | null; + dblclick?: string | null; + mousemove?: string | null; + focusin?: string | null; + focusout?: string | null; + mouseenter?: string | null; + mouseleave?: string | null; + submit?: string | null; + input?: string | null; + change?: string | null; + dragstart?: string | null; + drag?: string | null; + dragenter?: string | null; + dragleave?: string | null; + dragover?: string | null; + drop?: string | null; + dragend?: string | null; + [event: string]: string | null | undefined; + } + + interface ViewMixin { + /** + * A list of properties of the view to apply as attributes. If the property + * is a string value, the value of that string will be applied as the value + * for an attribute of the property's name. + */ + attributeBindings: string[]; + /** + * Returns the current DOM element for the view. + */ + element: Element; + /** + * Returns a jQuery object for this view's element. If you pass in a selector + * string, this method will return a jQuery object, using the current element + * as its buffer. + */ + $: JQueryStatic; + /** + * The HTML `id` of the view's element in the DOM. You can provide this + * value yourself but it must be unique (just as in HTML): + */ + elementId: string; + /** + * Tag name for the view's outer element. The tag name is only used when an + * element is first created. If you change the `tagName` for an element, you + * must destroy and recreate the view element. + */ + tagName: string; + /** + * Renders the view again. This will work regardless of whether the + * view is already in the DOM or not. If the view is in the DOM, the + * rendering process will be deferred to give bindings a chance + * to synchronize. + */ + rerender(): void; + /** + * Called when a view is going to insert an element into the DOM. + */ + willInsertElement(): void; + /** + * Called when the element of the view has been inserted into the DOM. + * Override this function to do any set up that requires an element + * in the document body. + */ + didInsertElement(): void; + /** + * Called when the view is about to rerender, but before anything has + * been torn down. This is a good opportunity to tear down any manual + * observers you have installed based on the DOM state + */ + willClearRender(): void; + /** + * Called when the element of the view is going to be destroyed. Override + * this function to do any teardown that requires an element, like removing + * event listeners. + */ + willDestroyElement(): void; + } + const ViewMixin: Ember.Mixin; + + /** + Ember.CoreView is an abstract class that exists to give view-like behavior to both Ember's main + view class Ember.Component and other classes that don't need the full functionality of Ember.Component. + + Unless you have specific needs for CoreView, you will use Ember.Component in your applications. + **/ + class CoreView extends Ember.Object.extend(Ember.Evented, Ember.ActionHandler) {} + interface ActionSupport { + sendAction(action: string, ...params: any[]): void; + } + const ActionSupport: Ember.Mixin; + + interface ClassNamesSupport { + /** + A list of properties of the view to apply as class names. If the property is a string value, + the value of that string will be applied as a class name. + + If the value of the property is a Boolean, the name of that property is added as a dasherized + class name. + + If you would prefer to use a custom value instead of the dasherized property name, you can + pass a binding like this: `classNameBindings: ['isUrgent:urgent']` + + This list of properties is inherited from the component's superclasses as well. + */ + classNameBindings: string[]; + /** + * Standard CSS class names to apply to the view's outer element. This + * property automatically inherits any class names defined by the view's + * superclasses as well. + */ + classNames: string[]; + } + const ClassNamesSupport: Ember.Mixin; + + interface TriggerActionOptions { + action?: string; + target?: Ember.Object; + actionContext?: Ember.Object; + } + /** + Ember.TargetActionSupport is a mixin that can be included in a class to add a triggerAction method + with semantics similar to the Handlebars {{action}} helper. In normal Ember usage, the {{action}} + helper is usually the best choice. This mixin is most often useful when you are doing more + complex event handling in Components. + **/ + interface TargetActionSupport { + triggerAction(opts: TriggerActionOptions): boolean; + } + + export namespace Ember { + interface FunctionPrototypeExtensions { + /** + * The `property` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * `true`, which is the default. + */ + property(...args: string[]): ComputedProperty; + /** + * The `observes` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * true, which is the default. + */ + observes(...args: string[]): this; + /** + * The `on` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * true, which is the default. + */ + on(...args: string[]): this; } - class QUnitAdapter extends Adapter {} - } -} - -interface Function { - observes(...args: string[]): Function; - observesBefore(...args: string[]): Function; - on(...args: string[]): Function; - property(...args: string[]): Function; -} - -interface String { - camelize(): string; - capitalize(): string; - classify(): string; - dasherize(): string; - decamelize(): string; - fmt(...args: string[]): string; - htmlSafe(): typeof Handlebars.SafeString; - loc(...args: string[]): string; - underscore(): string; - w(): string[]; -} - -interface Array { - constructor(arr: any[]): void; - activate(): void; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: any): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Ember.Enumerable | number, - adding: Ember.Enumerable | number - ): any; - enumerableContentDidChange( - removing: Ember.Enumerable | number, - adding: Ember.Enumerable | number - ): any; - enumerableContentWillChange( - removing: Ember.Enumerable | number, - adding: Ember.Enumerable | number - ): Ember.Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: any): boolean; - filter(callback: Function, target?: any): any[]; - filterBy(key: string, value?: string): any[]; - - /** - Returns the first item in the array for which the callback returns true. - This method works similar to the `filter()` method defined in JavaScript 1.6 - except that it will stop working on the array once a match is found. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @function find - @arg callback The callback to execute - @arg {Object} [target] The target object to use - @return {Object} Found item or `undefined`. -*/ - find(callback: Function, target?: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt?: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt?: number): number; - map(callback: Function, target?: any): any[]; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - replace(idx: number, amt: number, objects: any[]): void; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): any[]; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): any[]; - '[]': any[]; - '@each': Ember.EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - addObject(object: any): any; - addObjects(objects: Ember.Enumerable): any[]; - removeObject(object: any): any; - removeObjects(objects: Ember.Enumerable): any[]; - addObserver: ModifyObserver; - beginPropertyChanges(): any[]; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): any[]; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): any[]; - propertyDidChange(keyName: string): any[]; - propertyWillChange(keyName: string): any[]; - removeObserver(key: string, target: any, method: Function | string): Ember.Observable; - set(keyName: string, value: any): any[]; - setProperties(hash: {}): any[]; - toggleProperty(keyName: string): any; - copy(deep: boolean): any[]; - frozenCopy(): any[]; - // 1.3 - isAny(key: string, value?: string): boolean; - isEvery(key: string, value?: string): boolean; -} - -interface ApplicationCreateArguments { - customEvents?: {}; - rootElement?: string; - /** - Basic logging of successful transitions. - **/ - LOG_TRANSITIONS?: boolean; - /** - Detailed logging of all routing steps. - **/ - LOG_TRANSITIONS_INTERNAL?: boolean; -} - -type ApplicationInitializerFunction = ( - container: Ember.Container, - application: Ember.Application -) => void; - -interface ApplicationInitializerArguments { - name?: string; - initialize?: ApplicationInitializerFunction; -} - -interface CoreObjectArguments { - /** - An overridable method called when objects are instantiated. By default, does nothing unless it is - overridden during class definition. NOTE: If you do override init for a framework class like Ember.View - or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember - may not have an opportunity to do important setup work, and you'll see strange behavior in your application. - **/ - init?: Function; - /** - Override to implement teardown. - **/ - willDestroy?: Function; - - [propName: string]: any; -} - -interface EnumerableConfigurationOptions { - willChange?: boolean; - didChange?: boolean; -} - -type ItemIndexEnumerableCallbackTarget = ( - callback: ItemIndexEnumerableCallback, - target?: any -) => any[]; - -type ItemIndexEnumerableCallback = (item: any, index: number, enumerable: Ember.Enumerable) => void; - -type ReduceCallback = ( - previousValue: any, - item: any, - index: number, - enumerable: Ember.Enumerable -) => void; - -interface TransitionsHash { - contexts: any[]; - exitStates: Ember.State[]; - enterStates: Ember.State[]; - resolveState: Ember.State; -} - -interface ActionsHash { - willTransition?: Function; - error?: Function; -} - -interface DisconnectOutletOptions { - outlet?: string; - parentView?: string; -} - -interface RenderOptions { - into?: string; - controller?: string; - model?: any; - outlet?: string; - view?: string; -} - -type ModifyObserver = ( - obj: any, - path: string | null, - target: Function | any, - method?: Function | string -) => void; - -declare namespace Ember { - /** - Alias for jQuery. - **/ - // ReSharper disable once DuplicatingLocalDeclaration - const $: JQueryStatic; - /** - Creates an Ember.NativeArray from an Array like object. Does not modify the original object. - Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is - recommended that you use Ember.A when creating addons for ember or when you can not garentee - that Ember.EXTEND_PROTOTYPES will be true. - **/ - function A(arr?: any[]): NativeArray; - /** - The Ember.ActionHandler mixin implements support for moving an actions property to an _actions - property at extend time, and adding _actions to the object's mergedProperties list. - **/ - class ActionHandlerMixin { - /** - Triggers a named action on the ActionHandler - **/ - send(name: string, ...args: any[]): void; - /** - The collection of functions, keyed by name, available on this ActionHandler as action targets. - **/ - actions: ActionsHash; - } - /** - An instance of Ember.Application is the starting point for every Ember application. It helps to - instantiate, initialize and coordinate the many objects that make up your app. - **/ - class Application extends Namespace { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - /** - Call advanceReadiness after any asynchronous setup logic has completed. - Each call to deferReadiness must be matched by a call to advanceReadiness - or the application will never become ready and routing will not begin. - **/ - advanceReadiness(): void; - /** - Use this to defer readiness until some condition is true. - - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - */ - deferReadiness(): void; - /** - defines an injection or typeInjection - **/ - inject(factoryNameOrType: string, property: string, injectionName: string): void; - /** - This injects the test helpers into the window's scope. If a function of the - same name has already been defined it will be cached (so that it can be reset - if the helper is removed with `unregisterHelper` or `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - **/ - injectTestHelpers(): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; - /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - **/ - removeTestHelpers(): void; - /** - Reset the application. This is typically used only in tests. - **/ - reset(): void; - /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - **/ - setupForTesting(): void; - /** - The DOM events for which the event dispatcher should listen. - */ - customEvents: {}; - /** - The Ember.EventDispatcher responsible for delegating events to this application's views. - **/ - eventDispatcher: EventDispatcher; - /** - Set this to provide an alternate class to Ember.DefaultResolver - **/ - resolver: DefaultResolver; - /** - The root DOM element of the Application. This can be specified as an - element or a jQuery-compatible selector string. - - This is the element that will be passed to the Application's, eventDispatcher, - which sets up the listeners for event delegation. Every view in your application - should be a child of the element you specify here. - **/ - rootElement: HTMLElement; - /** - Called when the Application has become ready. - The call will be delayed until the DOM has become ready. - **/ - ready: Function; - /** - Application's router. - **/ - Router: Router; - registry: Registry; - } - /** - This module implements Observer-friendly Array-like behavior. This mixin is picked up by the - Array class as well as other controllers, etc. that want to appear to be arrays. - **/ - class Array implements Enumerable { - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target?: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - setEach(key: string, value?: any): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '@each': EachProxy; - Boolean: boolean; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - } - /** - An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, - forwarding all requests. This makes it very useful for a number of binding use cases or other cases - where being able to swap out the underlying array is useful. - **/ - class ArrayProxy extends Object implements MutableArray { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, $target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectAtContent(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - replaceContent(idx: number, amt: number, objects: any[]): void; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - } - const BOOTED: boolean; - /** - Connects the properties of two objects so that whenever the value of one property changes, - the other property will be changed also. - **/ - class Binding { - constructor(toPath: string, fromPath: string); - connect(obj: any): Binding; - copy(): Binding; - disconnect(): Binding; - from(path: string): Binding; - to(path: string | any[]): Binding; - toString(): string; - } - class Button extends Component implements TargetActionSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - triggerAction(opts: {}): boolean; - } - /** - The internal class used to create text inputs when the {{input}} helper is used - with type of checkbox. See Handlebars.helpers.input for usage details. - **/ - class Checkbox extends Component { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - /** - Implements some standard methods for comparing objects. Add this mixin to any class - you create that can compare its instances. - **/ - class Comparable { - compare(a: any, b: any): number; - } - /** - A view that is completely isolated. Property access in its templates go to the view object - and actions are targeted at the view object. There is no access to the surrounding context or - outer controller; all contextual information is passed in. - **/ - class Component extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - sendAction(action: string, context: any): void; - targetObject: Controller; - } - /** - A computed property transforms an objects function into a property. - By default the function backing the computed property will only be called once and the result - will be cached. You can specify various properties that your computed property is dependent on. - This will force the cached result to be recomputed if the dependencies are modified. - **/ - class ComputedProperty { - get(keyName: string): any; - meta(meta: {}): ComputedProperty; - property(...args: string[]): ComputedProperty; - readOnly(): ComputedProperty; - set(keyName: string, newValue: any, oldValue: string): any; - // ReSharper disable UsingOfReservedWord - volatile(): ComputedProperty; - // ReSharper restore UsingOfReservedWord - } - class Container { - constructor(parent: Container); - parent: Container; - children: any[]; - owner: any; - ownerInjection(): any; - resolver: Function; - registry: Registry; - cache: {}; - typeInjections: {}; - injections: {}; - child(): Container; - set(object: {}, key: string, value: any): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - describe(fullName: string): string; - makeToString(factory: any, fullName: string): Function; - lookup(fullName: string, options?: {}): any; - lookupFactory(fullName: string, options?: {}): any; - destroy(): void; - reset(): void; - } - class Controller extends Object implements ControllerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - model: any; - needs: string[]; - queryParams: any; - target: any; - send(name: string, ...args: any[]): void; - actions: ActionsHash; - } - /** - Additional methods for the ControllerMixin. - **/ - class ControllerMixin extends ActionHandlerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - model: any; - needs: string[]; - queryParams: any; - target: any; - } - /** - Implements some standard methods for copying an object. Add this mixin to any object you - create that can create a copy of itself. This mixin is added automatically to the built-in array. - You should generally implement the copy() method to return a copy of the receiver. - Note that frozenCopy() will only work if you also implement Ember.Freezable. - **/ - class Copyable { - copy(deep: boolean): Copyable; - frozenCopy(): Copyable; - } - class CoreObject { - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - @method init - **/ - init(): void; + interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} /** - Defines the properties that will be concatenated from the superclass (instead of overridden). - @property concatenatedProperties - @type Array - @default null - **/ - concatenatedProperties: any[]; - - /** - Destroyed object property flag. If this property is true the observers and bindings were - already removed by the effect of calling the destroy() method. - @property isDestroyed - @default false - **/ - isDestroyed: boolean; - /** - Destruction scheduled flag. The destroy() method has been called. The object stays intact - until the end of the run loop at which point the isDestroyed flag is set. - @property isDestroying - @default false - **/ - isDestroying: boolean; - - /** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @method destroy - @return {Ember.Object} receiver - */ - destroy(): CoreObject; - - /** - Override to implement teardown. - @method willDestroy - */ - willDestroy(): void; - - /** - Returns a string representation which attempts to provide more information than Javascript's toString - typically does, in a generic way for all Ember objects (e.g., ""). - @method toString - @return {String} string representation - **/ - toString(): string; - - static isClass: boolean; - static isMethod: boolean; - - /** - Creates a new subclass. - @method extend - @static - @param {Mixin} [mixins] - One or more Mixin classes - @param {Object} [args] - Object containing values to use within the new class - **/ - static extend(args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, mixin5: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, mixin5: Mixin, mixin6: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, mixin5: Mixin, mixin6: Mixin, mixin7: Mixin, args?: CoreObjectArguments): T; - - /** - Creates a new subclass. - @method extend - @param {Mixin} [mixins] - One or more Mixin classes - @param {Object} [args] - Object containing values to use within the new class - Non-static method because Ember classes aren't currently 'real' TypeScript classes. - **/ - extend(mixin1?: Mixin, mixin2?: Mixin, args?: CoreObjectArguments): T; - - /** - Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. - @method createWithMixins - @static - @param [args] - **/ - static createWithMixins(args?: {}): T; - - /** - Creates an instance of the class. - @method create - @static - @param [args] - A hash containing values with which to initialize the newly instantiated object. - **/ - static create(args?: {}): T; - - /** - Augments a constructor's prototype with additional properties and functions. - To add functions and properties to the constructor itself, see reopenClass. - @method reopen - **/ - static reopen(args?: {}): T; - - /** - Augments a constructor's own properties and functions. - To add functions and properties to instances of a constructor by extending the - constructor's prototype see reopen. - @method reopenClass - **/ - static reopenClass(args?: {}): T; - - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - - /** - Returns the original hash that was passed to meta(). - @method metaForProperty - @static - @param key {String} property name - **/ - static metaForProperty(key: string): {}; - - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - - @method eachComputedProperty - @static - @param {Function} callback - @param {Object} binding - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - } - class DAG { - add(name: string): any; - map(name: string, value: any): void; - addEdge(fromName: string, toName: string): void; - topsort(fn: Function): void; - addEdges(name: string, value: any, before: any, after: any): void; - names: any[]; - vertices: {}; - } - function DEFAULT_GETTER_FUNCTION(name: string): Function; - /** - The DefaultResolver defines the default lookup rules to resolve container lookups before consulting - the container for registered items: - templates are looked up on Ember.TEMPLATES - other names are looked up on the application after converting the name. - For example, controller:post looks up App.PostController by default. - **/ - class DefaultResolver { - resolve(fullName: string): {}; - namespace: Application; - } - /** - Objects of this type can implement an interface to respond to requests to get and set. - The default implementation handles simple properties. - You generally won't need to create or subclass this directly. - **/ - class Descriptor {} - namespace ENV { - const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; - const LOG_BINDINGS: boolean; - const LOG_STACKTRACE_ON_DEPRECATION: boolean; - const LOG_VERSION: boolean; - const MODEL_FACTORY_INJECTIONS: boolean; - const RAISE_ON_DEPRECATION: boolean; - } - namespace EXTEND_PROTOTYPES { - const Array: boolean; - const Function: boolean; - const String: boolean; - } - /** - This is the object instance returned when you get the @each property on an array. It uses - the unknownProperty handler to automatically create EachArray instances for property names. - **/ - class EachProxy extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - unknownProperty(keyName: string, value: any): any[]; - } - /** - This mixin defines the common interface implemented by enumerable objects in Ember. Most of these - methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific - features that cannot be emulated in older versions of JavaScript). - This mixin is applied automatically to the Array class on page load, so you can use any of these methods - on simple arrays. If Array already implements one of these methods, the mixin will not override them. - **/ - class Enumerable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - setEach(key: string, value?: any): any; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - } - /** - A subclass of the JavaScript Error object for use in Ember. - **/ - // Restore this to 'typeof Error' when https://github.com/Microsoft/TypeScript/issues/983 is resolved - // ReSharper disable once DuplicatingLocalDeclaration - const Error: any; // typeof Error; - /** - Handles delegating browser events to their corresponding Ember.Views. For example, when you click on - a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. - **/ - class EventDispatcher extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - events: {}; - } - /** - This mixin allows for Ember objects to subscribe to and emit events. - You can also chain multiple event subscriptions. - **/ - class Evented { - has(name: string): boolean; - off(name: string, target: any, method: Function): Evented; - on(name: string, target: any, method: Function): Evented; - one(name: string, target: any, method: Function): Evented; - trigger(name: string, ...args: string[]): void; - } - const FROZEN_ERROR: string; - class Freezable { - freeze(): Freezable; - isFrozen: boolean; - } - const GUID_KEY: string; - namespace Handlebars { - function compile(string: string): Function; - function compile(environment: any, options?: any, context?: any, asObject?: any): any; - function precompile(string: string, options: any): void; - class Compiler {} - class JavaScriptCompiler {} - function registerPartial(name: string, str: any): void; - function K(): any; - function createFrame(objec: any): any; - function Exception(message: string): void; - class SafeString { - constructor(str: string); - static toString(): string; - } - function parse(string: string): any; - function print(ast: any): void; - const logger: typeof Ember.Logger; - function log(level: string, str: string): void; - } - class HashLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class HistoryLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - rootURL: string; - } - const IS_BINDING: RegExp; - const inject: { - controller(name?: string): Controller; - service(name?: string): Service; - }; - class Helper extends Object { - static helper(h: (params: any, hash?: any) => any): Helper; - compute(params: any[], hash: any): any; - recompute(params: any[], hash: any): any; - } - class Instrumentation { - getProperties(obj: any, list: any[]): {}; - getProperties(obj: any, ...args: string[]): {}; - instrument(name: string, payload: any, callback: Function, binding: any): void; - reset(): void; - subscribe(pattern: string, object: any): void; - unsubscribe(subscriber: any): void; - } - const K: Function; - const LOG_BINDINGS: boolean; - const LOG_STACKTRACE_ON_DEPRECATION: boolean; - const LOG_VERSION: boolean; - class Location { - create(options?: {}): any; - registerImplementation(name: string, implementation: any): void; - } - const Logger: { - assert(param: any): void; - debug(...args: any[]): void; - error(...args: any[]): void; - info(...args: any[]): void; - log(...args: any[]): void; - warn(...args: any[]): void; - }; - function MANDATORY_SETTER_FUNCTION(value: string): void; - const META_KEY: string; - class Map { - copy(): Map; - static create(): Map; - forEach(callback: Function, self: any): void; - get(key: any): any; - has(key: any): boolean; - set(key: any, value: any): void; - length: number; - } - class MapWithDefault extends Map { - copy(): MapWithDefault; - static create(): MapWithDefault; - } - class Mixin { - apply(obj: any): any; - /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ - static create(...args: CoreObjectArguments[]): T; - detect(obj: any): boolean; - reopen(args?: {}): T; - } - class MutableArray implements Array, MutableEnumberable { - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - } - class MutableEnumberable implements Enumerable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - setEach(key: string, value?: any): any; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - } - const NAME_KEY: string; - class Namespace extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class NativeArray implements MutableArray, Observable, Copyable { - constructor(arr: any[]); - static activate(): void; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: any): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: any): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): any; - copy(deep: boolean): Copyable; - frozenCopy(): Copyable; - } - class NoneLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - const ORDER_DEFINITION: string[]; - class Object extends CoreObject implements Observable { - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - - /** - * Retrieves the value of a property from the object - * @param keyName - * @returns {} + * Given a fullName return a factory manager. */ - get(keyName: string): any; + interface _ContainerProxyMixin { + /** + * Returns an object that can be used to provide an owner to a + * manually created instance. + */ + ownerInjection(): {}; + /** + * Given a fullName return a corresponding instance. + */ + lookup(fullName: string, options: {}): any; + } + const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>; /** - * Retrieves the value of a property from the object - * @param keyName - * @returns {} + * RegistryProxyMixin is used to provide public access to specific + * registry functionality. */ - get(keyName: string): T; - - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: Function | string): Observable; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): any; - } - class ObjectProxy extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - /** - The object whose properties will be forwarded. - **/ - content: Object; - } - class Observable { - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - /** - Set the value of a boolean property to the opposite of its current value. - */ - toggleProperty(keyName: string): boolean; - } - class OrderedSet { - add(obj: any): void; - clear(): void; - copy(): OrderedSet; - static create(): OrderedSet; - forEach(fn: Function, self: any): void; - has(obj: any): boolean; - isEmpty(): boolean; - toArray(): any[]; - } - class Registry { - constructor(options: any); - static set: typeof Ember.set; - } - - // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js - const RSVP: typeof Rsvp; - - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - */ - class Route extends Object implements ActionHandlerMixin, Evented { - static isClass: boolean; - static isMethod: boolean; - - /** - This hook is executed when the router enters the route. It is not executed - when the model for the route changes. - @method activate - */ - activate: Function; - - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - - Refer to documentation for `beforeModel` for a description - of transition-pausing semantics when a promise is returned - from this hook. - @method afterModel - @param {Object} resolvedModel the value returned from `model`, - or its resolved value if it was a promise - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - */ - afterModel(resolvedModel: any, transition: EmberStates.Transition): Rsvp.Promise; - - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - - @method beforeModel - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - */ - beforeModel(transition: EmberStates.Transition): Rsvp.Promise; - - /** - The controller associated with this route. - - @property controller - @type Ember.Controller - @since 1.6.0 - */ - controller: Controller; - - /** - Returns the controller for a particular route or name. - The controller instance must already have been created, either through entering the - associated route or using `generateController`. - - @method controllerFor - @param {String} name the name of the route or controller - @return {Ember.Controller} - */ - controllerFor(name: string): Controller; - - /** - The name of the controller to associate with this route. - By default, Ember will lookup a route's controller that matches the name - of the route (i.e. `App.PostController` for `App.PostRoute`). However, - if you would like to define a specific controller to use, you can do so - using this property. - This is useful in many ways, as the controller specified will be: - * passed to the `setupController` method. - * used as the controller for the view being rendered by the route. - * returned from a call to `controllerFor` for the route. - @property controllerName - @type String - @default null - @since 1.4.0 - */ - controllerName: string; - - /** - This hook is executed when the router completely exits this route. It is - not executed when the model for the route changes. - @method deactivate - */ - deactivate: Function; - - /** - Deserializes value of the query parameter based on defaultValueType - @method deserializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - */ - deserializeQueryParam(value: any, urlKey: string, defaultValueType: string): any; - - /** - Disconnects a view that has been rendered into an outlet. - You may pass any or all of the following options to `disconnectOutlet`: - * `outlet`: the name of the outlet to clear (default: 'main') - * `parentView`: the name of the view containing the outlet to clear - (default: the view rendered by the parent route) - - @method disconnectOutlet - @param {Object|String} options the options hash or outlet name - */ - disconnectOutlet(options: DisconnectOutletOptions | string): void; - - /** - @method findModel - @param {String} type the model type - @param {Object} value the value passed to find - */ - findModel(type: string, value: any): any; - - /** - Generates a controller for a route. - If the optional model is passed then the controller type is determined automatically, - e.g., an ArrayController for arrays. - - @method generateController - @param {String} name the name of the controller - @param {Object} model the model to infer the type of the controller (optional) - */ - generateController(name: string, model: {}): Controller; - - /** - Perform a synchronous transition into another route without attempting - to resolve promises, update the URL, or abort any currently active - asynchronous transitions (i.e. regular transitions caused by - `transitionTo` or URL changes). - This method is handy for performing intermediate transitions on the - way to a final destination route, and is called internally by the - default implementations of the `error` and `loading` handlers. - @method intermediateTransitionTo - @param {String} name the name of the route - @param {...Object} models the model(s) to be used while transitioning - to the route. - @since 1.2.0 - */ - intermediateTransitionTo(name: string, ...models: any[]): void; - - /** - A hook you can implement to convert the URL into the model for - this route. - - @method model - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. If - a promise is returned, the transition will pause until - the promise resolves, and the resolved value of the promise - will be used as the model for this route. - */ - model(params: {}, transition: EmberStates.Transition): any | Rsvp.Promise; - - /** - Returns the model of a parent (or any ancestor) route - in a route hierarchy. During a transition, all routes - must resolve a model object, and if a route - needs access to a parent route's model in order to - resolve a model (or just reuse the model from a parent), - it can call `this.modelFor(theNameOfParentRoute)` to - retrieve it. - - @method modelFor - @param {String} name the name of the route - @return {Object} the model object - */ - modelFor(name: string): {}; - - /** - Retrieves parameters, for current route using the state.params - variable and getQueryParamsFor, using the supplied routeName. - @method paramsFor - @param {String} name - */ - paramsFor(name: string): any; - - /** - Configuration hash for this route's queryParams. - @property queryParams - @for Ember.Route - @type Hash - */ - queryParams: {}; - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - */ - redirect(): EmberStates.Transition; - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - */ - refresh(): EmberStates.Transition; - - /** - `render` is used to render a template into a region of another template - (indicated by an `{{outlet}}`). `render` is used both during the entry - phase of routing (via the `renderTemplate` hook) and later in response to - user interaction. - - @method render - @param {String} name the name of the template to render - @param {Object} [options] the options - @param {String} [options.into] the template to render into, - referenced by name. Defaults to the parent template - @param {String} [options.outlet] the outlet inside `options.template` to render into. - Defaults to 'main' - @param {String|Object} [options.controller] the controller to use for this template, - referenced by name or as a controller instance. Defaults to the Route's paired controller - @param {Object} [options.model] the model object to set on `options.controller`. - Defaults to the return value of the Route's model hook - */ - render(name: string, options?: RenderOptions): void; - - /** - A hook you can use to render the template for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. By default, it renders the route's - template, configured with the controller for the route. - This method can be overridden to set up and render additional or - alternative templates. - - @method renderTemplate - @param {Object} controller the route's controller - @param {Object} model the route's model - */ - renderTemplate(controller: Controller, model: {}): void; - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionTo` in all other respects. See - 'transitionTo' for additional information regarding multiple models. - - @method replaceWith - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @return {Transition} the transition object associated with this - attempted transition - */ - replaceWith(name: string, ...models: any[]): void; - - /** - A hook you can use to reset controller values either when the model - changes or the route is exiting. - - @method resetController - @param {Controller} controller instance - @param {Boolean} isExiting - @param {Object} transition - @since 1.7.0 - */ - resetController(controller: Ember.Controller, isExiting: boolean, transition: any): void; - - /** - A hook you can implement to convert the route's model into parameters - for the URL. - - The default `serialize` method will insert the model's `id` into the - route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - If the route has multiple dynamic segments or does not contain '_id', `serialize` - will return `Ember.getProperties(model, params)` - This method is called when `transitionTo` is called with a context - in order to populate the URL. - @method serialize - @param {Object} model the route's model - @param {Array} params an Array of parameter names for the current - route (in the example, `['post_id']`. - @return {Object} the serialized parameters - */ - serialize(model: {}, params: string[]): string; - - /** - Serializes value of the query parameter based on defaultValueType - @method serializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - */ - serializeQueryParam(value: any, urlKey: string, defaultValueType: string): string; - - /** - Serializes the query parameter key - @method serializeQueryParamKey - @param {String} controllerPropertyName - */ - serializeQueryParamKey(controllerPropertyName: string): string; - - /** - A hook you can use to setup the controller for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. - By default, the `setupController` hook sets the `model` property of - the controller to the `model`. - If you implement the `setupController` hook in your Route, it will - prevent this default behavior. If you want to preserve that behavior - when implementing your `setupController` function, make sure to call - `_super` - @method setupController - @param {Controller} controller instance - @param {Object} model - */ - setupController(controller: Controller, model: {}): void; - - /** - Store property provides a hook for data persistence libraries to inject themselves. - By default, this store property provides the exact same functionality previously - in the model hook. - Currently, the required interface is: - `store.find(modelName, findArguments)` - @method store - @param {Object} store - */ - store(store: any): any; - - /** - The name of the template to use by default when rendering this routes - template. - This is similar with `viewName`, but is useful when you just want a custom - template without a view. - - @property templateName - @type String - @default null - @since 1.4.0 - */ - templateName: string; - - /** - Transition the application into another route. The route may - be either a single route or route path - - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - */ - transitionTo(name: string, ...object: any[]): EmberStates.Transition; - - /** - The name of the view to use by default when rendering this routes template. - When rendering a template, the route will, by default, determine the - template and view to use from the name of the route itself. If you need to - define a specific view, set this property. - This is useful when multiple routes would benefit from using the same view - because it doesn't require a custom `renderTemplate` method. - @property viewName - @type String - @default null - @since 1.4.0 - */ - viewName: string; - - // ActionHandlerMixin methods - - /** - Sends an action to the router, which will delegate it to the currently - active route hierarchy per the bubbling rules explained under actions - - @method send - @param {String} actionName The action to trigger - @param {*} context a context to send with the action - */ - send(name: string, ...args: any[]): void; - - /** - The collection of functions, keyed by name, available on this - `ActionHandler` as action targets. - These functions will be invoked when a matching `{{action}}` is triggered - from within a template and the application's current route is this route. - Actions can also be invoked from other parts of your application - via `ActionHandler#send`. - The `actions` hash will inherit action handlers from - the `actions` hash defined on extended parent classes - or mixins rather than just replace the entire hash. - - Within a Controller, Route, View or Component's action handler, - the value of the `this` context is the Controller, Route, View or - Component object: - - It is also possible to call `this._super.apply(this, arguments)` from within an - action handler if it overrides a handler defined on a parent - class or mixin. - - ## Bubbling - By default, an action will stop bubbling once a handler defined - on the `actions` hash handles it. To continue bubbling the action, - you must return `true` from the handler - - @property actions - @type Hash - @default null - */ - actions: ActionsHash; - - // Evented methods - - /** - Subscribes to a named event with given function. - - An optional target can be passed in as the 2nd argument that will - be set as the "this" for the callback. This is a good way to give your - function access to the object triggering the event. When the target - parameter is used the callback becomes the third argument. - - @method on - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - */ - on(name: string, target: any, method: Function): Evented; - - /** - Subscribes a function to a named event and then cancels the subscription - after the first time the event is triggered. It is good to use ``one`` when - you only care about the first time an event has taken place. - This function takes an optional 2nd argument that will become the "this" - value for the callback. If this argument is passed then the 3rd argument - becomes the function. - - @method one - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - */ - one(name: string, target: any, method: Function): Evented; - - /** - Triggers a named event for the object. Any additional arguments - will be passed as parameters to the functions that are subscribed to the - event. - - @method trigger - @param {String} name The name of the event - @param {Object...} args Optional arguments to pass on - */ - trigger(name: string, ...args: string[]): void; - - /** - Cancels subscription for given name, target, and method. - - @method off - @param {String} name The name of the event - @param {Object} target The target of the subscription - @param {Function} method The function of the subscription - @return this - */ - off(name: string, target: any, method: Function): Evented; - - /** - Checks to see if object has any subscriptions for named event. - - @method has - @param {String} name The name of the event - @return {Boolean} does the object have a subscription for event - */ - has(name: string): boolean; - } - - class Router extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - map(callback: Function): Router; - } - class RouterDSL { - resource(name: string, options?: {}, callback?: Function): void; - resource(name: string, callback: Function): void; - route(name: string, options?: {}): void; - explicitIndex: boolean; - router: Router; - options: any; - } - class Service extends CoreObject implements Observable { - /* Observable */ - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): boolean; - /* /Observable */ - } - const STRINGS: boolean; - class State extends Object implements Evented { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - has(name: string): boolean; - off(name: string, target: any, method: Function): State; - on(name: string, target: any, method: Function): State; - one(name: string, target: any, method: Function): State; - trigger(name: string, ...args: string[]): void; - getPathsCache(stateManager: {}, path: string): {}; - init(): void; - setPathsCache(stateManager: {}, path: string, transitions: any): void; - static transitionTo(target: string): void; - hasContext: boolean; - isLeaf: boolean; - name: string; - parentState: State; - path: string; - enter: Function; - exit: Function; - setup: Function; - } - class StateManager extends State { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - contextFreeTransition(currentState: State, path: string): TransitionsHash; - enterState(transition: TransitionsHash): void; - getState(name: string): State; - getStateByPath(root: State, path: string): State; - getStateMeta(state: State, key: string): any; - getStatesInPath(root: State, path: string): State[]; - goToState(path: string, context: any): void; - send(event: string): void; - setStateMeta(state: State, key: string, value: any): any; - stateMetaFor(state: State): {}; - transitionTo(path: string, context: any): void; - triggerSetupContext(transitions: TransitionsHash): void; - unhandledEvent(manager: StateManager, event: string): any; - currentPath: string; - currentState: State; - errorOnUnhandledEvents: boolean; - transitionEvent: string; - } - namespace String { - function camelize(str: string): string; - function capitalize(str: string): string; - function classify(str: string): string; - function dasherize(str: string): string; - function decamelize(str: string): string; - function fmt(...args: string[]): string; - function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; - function loc(...args: string[]): string; - function underscore(str: string): string; - function w(str: string): string[]; - } - const TEMPLATES: {}; - class TargetActionSupport { - triggerAction(opts: {}): boolean; - } - namespace Test { - class Adapter extends Ember.Object { - constructor(); + interface _RegistryProxyMixin { + /** + * Given a fullName return the corresponding factory. + */ + resolveRegistration(fullName: string): Function; + /** + * Registers a factory that can be used for dependency injection (with + * `inject`) or for service lookup. Each factory is registered with + * a full name including two parts: `type:name`. + */ + register(fullName: string, factory: Function, options: {}): any; + /** + * Unregister a factory. + */ + unregister(fullName: string): any; + /** + * Check if a factory is registered. + */ + hasRegistration(fullName: string): boolean; + /** + * Register an option for a particular factory. + */ + registerOption(fullName: string, optionName: string, options: {}): any; + /** + * Return a specific registered option for a particular factory. + */ + registeredOption(fullName: string, optionName: string): {}; + /** + * Register options for a particular factory. + */ + registerOptions(fullName: string, options: {}): any; + /** + * Return registered options for a particular factory. + */ + registeredOptions(fullName: string): {}; + /** + * Allow registering options for all factories of a type. + */ + registerOptionsForType(type: string, options: {}): any; + /** + * Return the registered options for all factories of a type. + */ + registeredOptionsForType(type: string): {}; + /** + * Define a dependency injection onto a specific factory or all factories + * of a type. + */ + inject(factoryNameOrType: string, property: string, injectionName: string): any; } - class Promise extends Rsvp.Promise { - constructor(); + const _RegistryProxyMixin: Mixin<_RegistryProxyMixin>; + /** + Ember.ActionHandler is available on some familiar classes including Ember.Route, + Ember.Component, and Ember.Controller. (Internally the mixin is used by Ember.CoreView, + Ember.ControllerMixin, and Ember.Route and available to the above classes through inheritance.) + **/ + interface ActionHandler { + /** + Triggers a named action on the ActionHandler. Any parameters supplied after the actionName + string will be passed as arguments to the action target function. + + If the ActionHandler has its target property set, actions may bubble to the target. + Bubbling happens when an actionName can not be found in the ActionHandler's actions + hash or if the action target function returns true. + **/ + send(actionName: string, ...args: any[]): void; + /** + The collection of functions, keyed by name, available on this ActionHandler as action targets. + **/ + actions: ActionsHash; } - function oninjectHelpers(callback: Function): void; - function promise(resolver: (a: T) => any, label: string): Ember.Test.Promise; - function unregisterHelper(name: string): void; - function registerHelper(name: string, helperMethod: Function): void; - function registerAsyncHelper(name: string, helperMethod: Function): void; - - const adapter: Object; - const QUnitAdapter: Object; - - function registerWaiter(callback: Function): void; - function registerWaiter(context: any, callback: Function): void; - function unregisterWaiter(callback: Function): void; - function unregisterWaiter(context: any, callback: Function): void; - - function resolve(result: T): Ember.Test.Promise; - } - class TextArea extends Component implements TextSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; + const ActionHandler: Ember.Mixin; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. + An instance of Ember.Application is the starting point for every Ember application. It helps to + instantiate, initialize and coordinate the many objects that make up your app. **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - class TextField extends Component implements TextSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - pattern: string; - size: string; - type: string; - value: string; - } - class TextSupport { - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - const VERSION: string; - class ViewTargetActionSupport extends Mixin { - target: any; - actionContext: any; - } - const ViewUtils: {}; // TODO: define interface - function addListener( - obj: any, - eventName: string, - target: Function | any, - method: Function | string, - once?: boolean - ): void; - const addObserver: ModifyObserver; - /** - Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. - **/ - const alias: typeof deprecateFunc; - function aliasMethod(methodName: string): Descriptor; - function assert(desc: string, test: boolean): void; - function beginPropertyChanges(): void; - function bind(obj: any, to: string, from: string): Binding; - function cacheFor(obj: any, key: string): any; - function canInvoke(obj: any, methodName: string): boolean; - function changeProperties(callback: Function, binding?: any): void; - function compare(v: any, w: any): number; - // ReSharper disable once DuplicatingLocalDeclaration - const computed: { - (...args: any[]): ComputedProperty; - alias(dependentKey: string): ComputedProperty; - and(...args: string[]): ComputedProperty; - any(...args: string[]): ComputedProperty; - bool(dependentKey: string): ComputedProperty; - defaultTo(defaultPath: string): ComputedProperty; - empty(dependentKey: string): ComputedProperty; - equal(dependentKey: string, value: any): ComputedProperty; - filter( - dependentKey: string, - callback: (item: any, index?: number, array?: any[]) => boolean - ): ComputedProperty; - filterBy(dependentKey: string, propertyKey: string, value: any): ComputedProperty; - gt(dependentKey: string, value: number): ComputedProperty; - gte(dependentKey: string, value: number): ComputedProperty; - lt(dependentKey: string, value: number): ComputedProperty; - lte(dependentKey: string, value: number): ComputedProperty; - map(dependentKey: string, callback: (item: any, index: number) => T): ComputedProperty; - match(dependentKey: string, regexp: RegExp): ComputedProperty; - none(dependentKey: string): ComputedProperty; - not(dependentKey: string): ComputedProperty; - notEmpty(dependentKey: string): ComputedProperty; - oneWay(dependentKey: string): ComputedProperty; - or(...args: string[]): ComputedProperty; - readOnly(dependentString: string): ComputedProperty; - }; - // ReSharper restore DuplicatingLocalDeclaration - function controllerFor( - container: Container, - controllerName: string, - lookupOptions?: {} - ): Controller; - function copy(obj: any, deep: boolean): any; - /** - Creates an instance of the CoreObject class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ - function create(arguments?: {}): CoreObject; - function debug(message: string): void; - function defineProperty(obj: any, keyName: string, desc: {}): void; - function deprecate(message: string, test?: boolean): void; - function deprecateFunc(message: string, func: Function): Function; - function destroy(obj: any): void; - /** - Ember.empty is deprecated. Please use Ember.isEmpty instead. - **/ - // ReSharper disable once DuplicatingLocalDeclaration - const empty: typeof deprecateFunc; - function endPropertyChanges(): void; - function finishChains(obj: any): void; - function generateController( - container: Container, - controllerName: string, - context: any - ): Controller; - function generateGuid(obj: any, prefix?: string): string; - function get(obj: any, keyName: string): any; - function getProperties(obj: any, ...args: string[]): object; - function getProperties(obj: any, keys: string[]): object; - /** - getPath is deprecated since get now supports paths. - **/ - const getPath: typeof deprecateFunc; - function getWithDefault(root: string, key: string, defaultValue: any): any; - function guidFor(obj: any): string; - function handleErrors(func: Function, context: any): any; - function hasListeners(context: any, name: string): boolean; - function hasOwnProperty(prop: string): boolean; - function immediateObserver(func: Function, ...propertyNames: any[]): Function; - function inspect(obj: any): string; - function instrument(name: string, payload: any, callback: Function, binding: any): void; - function isArray(obj: any): boolean; - function isBlank(obj: any): boolean; - function isEmpty(obj: any): boolean; - function isEqual(a: any, b: any): boolean; - function isGlobalPath(path: string): boolean; - const isNamespace: boolean; - function isNone(obj: any): boolean; - function isPresent(obj: any): boolean; - function isPrototypeOf(obj: {}): boolean; - function isWatching(obj: any, key: string): boolean; - function keys(obj: any): any[]; - function listenersDiff(obj: any, eventName: string, otherActions: any[]): any[]; - function listenersFor(obj: any, eventName: string): any[]; - function listenersUnion(obj: any, eventName: string, otherActions: any[]): void; - // ReSharper disable once DuplicatingLocalDeclaration - const lookup: {}; // TODO: define interface - function makeArray(obj: any): any[]; - function merge(original: any, updates: any): any; - function meta(obj: any): {}; - function mixin(obj: any, ...args: any[]): any; - /** - Ember.none is deprecated. Please use Ember.isNone instead. - **/ - const none: typeof deprecateFunc; - function observer(...args: any[]): Function; - function observersFor(obj: any, path: string): any[]; - function onLoad(name: string, callback: Function): void; - const onError: Error; - function onerror(error: any): void; - function overrideChains(obj: any, keyName: string, m: any): boolean; - // ReSharper disable once DuplicatingLocalDeclaration - const platform: { - defineProperty: boolean; - hasPropertyAccessors: boolean; - }; - function propertyDidChange(obj: any, keyName: string): void; - function propertyIsEnumerable(prop: string): boolean; - function propertyWillChange(obj: any, keyName: string): void; - function removeChainWatcher(obj: any, keyName: string, node: any): void; - function removeListener( - obj: any, - eventName: string, - target: Function | any, - method: Function | string - ): void; - function removeObserver(obj: any, path: string, target: any, method: Function): any; - function required(): Descriptor; - function rewatch(obj: any): void; + class Application extends Namespace { + /** + Call advanceReadiness after any asynchronous setup logic has completed. + Each call to deferReadiness must be matched by a call to advanceReadiness + or the application will never become ready and routing will not begin. + **/ + advanceReadiness(): void; + /** + Use this to defer readiness until some condition is true. - type RunMethod = (...args: any[]) => T; - const run: { - (method: RunMethod | string): T; - (target: any, method: RunMethod | string): T; - begin(): void; - cancel(timer: any): void; - debounce(target: any, method: Function | string, ...args: any[]): void; - end(): void; - join(target: any, method: Function | string, ...args: any[]): any; - later(target: any, method: Function | string, ...args: any[]): string; - next(target: any, method: Function | string, ...args: any[]): number; - once(target: any, method: Function | string, ...args: any[]): number; - schedule(queue: string, target: any, method: Function | string, ...args: any[]): void; - scheduleOnce(queue: string, target: any, method: Function | string, ...args: any[]): void; - sync(): void; - throttle(target: any, method: Function | string, ...args: any[]): void; - queues: any[]; - }; - function runInDebug(fn: Function): void; - function runLoadHooks(name: string, object: any): void; - function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; - function set(obj: any, keyName: string, value: any): any; - /** - setPath is deprecated since set now supports paths. - **/ - const setPath: typeof deprecateFunc; - function setProperties(self: any, hash: {}): any; - function subscribe(pattern: string, object: any): void; - function toLocaleString(): string; - function toString(): string; - function tryCatchFinally( - tryable: Function, - catchable: Function, - finalizer: Function, - binding?: any - ): any; - function tryInvoke(obj: any, methodName: string, args?: any[]): any; - function trySet(obj: any, path: string, value: any): void; - /** - trySetPath has been renamed to trySet. - **/ - const trySetPath: typeof deprecateFunc; - function typeOf(item: any): string; - function unwatch(obj: any, keyPath: string): void; - function unwatchKey(obj: any, keyName: string): void; - function unwatchPath(obj: any, keyPath: string): void; - // ReSharper disable once DuplicatingLocalDeclaration - const uuid: number; - function valueOf(): {}; - function warn(message: string, test?: boolean): void; - function watch(obj: any, keyPath: string): void; - function watchKey(obj: any, keyName: string): void; - function watchPath(obj: any, keyPath: string): void; - function watchedEvents(obj: {}): any[]; - function wrap(func: Function, superFunc: Function): Function; - const _ContainerProxyMixin: Mixin; - const _RegistryProxyMixin: Mixin; - function getOwner(object: any): any; - function setOwner(object: any, owner: any): void; - const testing: boolean; - const MODEL_FACTORY_INJECTIONS: boolean; - function assign(original: any, ...sources: any[]): any; + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. + + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + */ + deferReadiness(): void; + /** + defines an injection or typeInjection + **/ + inject(factoryNameOrType: string, property: string, injectionName: string): void; + /** + This injects the test helpers into the window's scope. If a function of the + same name has already been defined it will be cached (so that it can be reset + if the helper is removed with `unregisterHelper` or `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + **/ + injectTestHelpers(): void; + /** + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; + /** + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + **/ + removeTestHelpers(): void; + /** + Reset the application. This is typically used only in tests. + **/ + reset(): void; + /** + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + **/ + setupForTesting(): void; + /** + The DOM events for which the event dispatcher should listen. + */ + customEvents: EventDispatcherEvents; + /** + The Ember.EventDispatcher responsible for delegating events to this application's views. + **/ + eventDispatcher: EventDispatcher; + /** + Set this to provide an alternate class to Ember.DefaultResolver + **/ + resolver: DefaultResolver; + /** + The root DOM element of the Application. This can be specified as an + element or a jQuery-compatible selector string. + + This is the element that will be passed to the Application's, eventDispatcher, + which sets up the listeners for event delegation. Every view in your application + should be a child of the element you specify here. + **/ + rootElement: HTMLElement | string; + /** + Called when the Application has become ready. + The call will be delayed until the DOM has become ready. + **/ + ready: Function; + /** + Application's router. + **/ + Router: Router; + registry: Registry; + } + /** + The `ApplicationInstance` encapsulates all of the stateful aspects of a + running `Application`. + **/ + class ApplicationInstance extends EngineInstance {} + /** + This module implements Observer-friendly Array-like behavior. This mixin is picked up by the + Array class as well as other controllers, etc. that want to appear to be arrays. + **/ + interface Array extends Enumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + length: number | ComputedProperty; + /** + * Returns the object at the given `index`. If the given `index` is negative + * or is greater or equal than the array length, returns `undefined`. + */ + objectAt(idx: number): T | undefined; + /** + * This returns the objects at the specified indexes, using `objectAt`. + */ + objectsAt(indexes: number[]): Ember.Array; + /** + * Returns a new array that is a slice of the receiver. This implementation + * uses the observable array methods to retrieve the objects for the new + * slice. + */ + slice(beginIndex?: number, endIndex?: number): T[]; + /** + * Returns the index of the given object's first occurrence. + * If no `startAt` argument is given, the starting location to + * search is 0. If it's negative, will count backward from + * the end of the array. Returns -1 if no match is found. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the given object's last occurrence. + * If no `startAt` argument is given, the search starts from + * the last position. If it's negative, will count backward + * from the end of the array. Returns -1 if no match is found. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Adds an array observer to the receiving array. The array observer object + * normally must implement two methods: + */ + addArrayObserver(target: {}, opts: {}): this; + /** + * Removes an array observer from the object if the observer is current + * registered. Calling this method multiple times with the same object will + * have no effect. + */ + removeArrayObserver(target: {}, opts: {}): this; + /** + * Becomes true whenever the array currently has observers watching changes + * on the array. + */ + hasArrayObservers: ComputedProperty; + /** + * If you are implementing an object that supports `Ember.Array`, call this + * method just before the array content changes to notify any observers and + * invalidate any related properties. Pass the starting index of the change + * as well as a delta of the amounts to change. + */ + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): this; + /** + * If you are implementing an object that supports `Ember.Array`, call this + * method just after the array content changes to notify any observers and + * invalidate any related properties. Pass the starting index of the change + * as well as a delta of the amounts to change. + */ + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): this; + /** + * Returns a special object that can be used to observe individual properties + * on the array. Just get an equivalent property on this object and it will + * return an enumerable that maps automatically to the named key on the + * member objects. + */ + '@each': ComputedProperty; + } + // Ember.Array rather than Array because the `array-type` lint rule doesn't realize the global is shadowed + const Array: Mixin>; + + /** + An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, + forwarding all requests. This makes it very useful for a number of binding use cases or other cases + where being able to swap out the underlying array is useful. + **/ + interface ArrayProxy extends MutableArray {} + class ArrayProxy extends Object.extend(MutableArray as {}) { + /** + * Should actually retrieve the object at the specified index from the + * content. You can override this method in subclasses to transform the + * content item to something new. + */ + objectAtContent(idx: number): T | undefined; + } + /** + AutoLocation will select the best location option based off browser support with the priority order: history, hash, none. + **/ + class AutoLocation extends Object {} + /** + * Connects the properties of two objects so that whenever the value of one property changes, + * the other property will be changed also. + * + * @deprecated https://emberjs.com/deprecations/v2.x#toc_ember-binding + **/ + class Binding { + constructor(toPath: string, fromPath: string); + connect(obj: any): Binding; + copy(): Binding; + disconnect(): Binding; + from(path: string): Binding; + to(path: string | string[]): Binding; + toString(): string; + } + /** + The internal class used to create text inputs when the {{input}} helper is used + with type of checkbox. See Handlebars.helpers.input for usage details. + **/ + class Checkbox extends Component {} + /** + * Implements some standard methods for comparing objects. Add this mixin to + * any class you create that can compare its instances. + * @private + */ + interface Comparable { + compare(a: any, b: any): number; + } + const Comparable: Mixin; + /** + A view that is completely isolated. Property access in its templates go to the view object + and actions are targeted at the view object. There is no access to the surrounding context or + outer controller; all contextual information is passed in. + **/ + class Component extends CoreView.extend(ViewMixin, ActionSupport, ClassNamesSupport) { + // methods + readDOMAttr(name: string): string; + // properties + /** + * The WAI-ARIA role of the control represented by this view. For example, a button may have a + * role of type 'button', or a pane may have a role of type 'alertdialog'. This property is + * used by assistive software to help visually challenged users navigate rich web applications. + */ + ariaRole: string; + /** + * The HTML id of the component's element in the DOM. You can provide this value yourself but + * it must be unique (just as in HTML): + * + * If not manually set a default value will be provided by the framework. Once rendered an + * element's elementId is considered immutable and you should never change it. If you need + * to compute a dynamic value for the elementId, you should do this when the component or + * element is being instantiated: + */ + elementId: string; + /** + * If false, the view will appear hidden in DOM. + */ + isVisible: boolean; + /** + * A component may contain a layout. A layout is a regular template but supersedes the template + * property during rendering. It is the responsibility of the layout template to retrieve the + * template property from the component (or alternatively, call Handlebars.helpers.yield, + * {{yield}}) to render it in the correct location. This is useful for a component that has a + * shared wrapper, but which delegates the rendering of the contents of the wrapper to the + * template property on a subclass. + */ + layout: TemplateFactory | string; + /** + * Enables components to take a list of parameters as arguments. + */ + static positionalParams: string[] | string; + // events + /** + * Called when the attributes passed into the component have been updated. Called both during the + * initial render of a container and during a rerender. Can be used in place of an observer; code + * placed here will be executed every time any attribute updates. + */ + didReceiveAttrs(): void; + /** + * Called after a component has been rendered, both on initial render and in subsequent rerenders. + */ + didRender(): void; + /** + * Called when the component has updated and rerendered itself. Called only during a rerender, + * not during an initial render. + */ + didUpdate(): void; + /** + * Called when the attributes passed into the component have been changed. Called only during a + * rerender, not during an initial render. + */ + didUpdateAttrs(): void; + /** + * Called before a component has been rendered, both on initial render and in subsequent rerenders. + */ + willRender(): void; + /** + * Called when the component is about to update and rerender itself. Called only during a rerender, + * not during an initial render. + */ + willUpdate(): void; + } + /** + A computed property transforms an objects function into a property. + By default the function backing the computed property will only be called once and the result + will be cached. You can specify various properties that your computed property is dependent on. + This will force the cached result to be recomputed if the dependencies are modified. + **/ + class ComputedProperty { + /** + * Call on a computed property to set it into non-cached mode. When in this + * mode the computed property will not automatically cache the return value. + */ + volatile(): this; + /** + * Call on a computed property to set it into read-only mode. When in this + * mode the computed property will throw an error when set. + */ + readOnly(): this; + /** + * Sets the dependent keys on this computed property. Pass any number of + * arguments containing key paths that this computed property depends on. + */ + property(...path: string[]): this; + /** + * In some cases, you may want to annotate computed properties with additional + * metadata about how they function or what values they operate on. For example, + * computed property functions may close over variables that are then no longer + * available for introspection. + */ + meta(meta: {}): this; + meta(): {}; + } + /** + * A container used to instantiate and cache objects. + * @private + */ + class Container { + /** + * Given a fullName, return the corresponding factory. The consumer of the factory + * is responsible for the destruction of any factory instances, as there is no + * way for the container to ensure instances are destroyed when it itself is + * destroyed. + */ + factoryFor(fullName: string, options?: {}): any; + } + /** + The ContainerDebugAdapter helps the container and resolver interface + with tools that debug Ember such as the Ember Inspector for Chrome and Firefox. + **/ + class ContainerDebugAdapter extends Object { + resolver: Resolver; + canCatalogEntriesByType(type: string): boolean; + catalogEntriesByType(type: string): any[]; + } + /** + * Additional methods for the Controller. + * @private + */ + interface ControllerMixin extends ActionHandler { + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + model: any; + queryParams: string[] | Array<{ [key: string]: { type: string } }>; + target: Object; + } + const ControllerMixin: Ember.Mixin; + class Controller extends Object.extend(ControllerMixin) {} + /** + * Implements some standard methods for copying an object. Add this mixin to + * any object you create that can create a copy of itself. This mixin is + * added automatically to the built-in array. + * @private + */ + interface Copyable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + copy(deep: boolean): Copyable; + /** + * If the object implements `Ember.Freezable`, then this will return a new + * copy if the object is not frozen and the receiver if the object is frozen. + */ + frozenCopy(): Copyable; + } + const Copyable: Ember.Mixin; + class CoreObject { + _super(...args: any[]): any; + + /** + An overridable method called when objects are instantiated. By default, + does nothing unless it is overridden during class definition. + @method init + **/ + init(): void; + + /** + Defines the properties that will be concatenated from the superclass (instead of overridden). + @property concatenatedProperties + @type Array + @default null + **/ + concatenatedProperties: any[]; + + /** + Destroyed object property flag. If this property is true the observers and bindings were + already removed by the effect of calling the destroy() method. + @property isDestroyed + @default false + **/ + isDestroyed: boolean; + /** + Destruction scheduled flag. The destroy() method has been called. The object stays intact + until the end of the run loop at which point the isDestroyed flag is set. + @property isDestroying + @default false + **/ + isDestroying: boolean; + + /** + Destroys an object by setting the `isDestroyed` flag and removing its + metadata, which effectively destroys observers and bindings. + If you try to set a property on a destroyed object, an exception will be + raised. + Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + @method destroy + @return {Ember.Object} receiver + */ + destroy(): CoreObject; + + /** + Override to implement teardown. + @method willDestroy + */ + willDestroy(): void; + + /** + Returns a string representation which attempts to provide more information than Javascript's toString + typically does, in a generic way for all Ember objects (e.g., ""). + @method toString + @return {String} string representation + **/ + toString(): string; + + static create(this: EmberClassConstructor): Fix; + + static create>( + this: EmberClassConstructor>, + arg1: T1 & ThisType> + ): Fix; + + static create< + Instance, + Args, + T1 extends EmberInstanceArguments, + T2 extends EmberInstanceArguments + >( + this: EmberClassConstructor>, + arg1: T1 & ThisType>, + arg2: T2 & ThisType> + ): Fix; + + static create< + Instance, + Args, + T1 extends EmberInstanceArguments, + T2 extends EmberInstanceArguments, + T3 extends EmberInstanceArguments + >( + this: EmberClassConstructor>, + arg1: T1 & ThisType>, + arg2: T2 & ThisType>, + arg3: T3 & ThisType> + ): Fix; + + static extend( + this: Statics & EmberClassConstructor + ): Objectify & EmberClassConstructor; + + static extend( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2 & B3, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2 & B3 & B4, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3, + T4 extends EmberClassArguments, + B4 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType>, + arg4: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen( + this: Statics & EmberClassConstructor + ): Objectify & EmberClassConstructor; + + static reopen( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1 & B2, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1 & B2 & B3, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopenClass(this: Statics): Statics; + + static reopenClass( + this: Statics, + arg1: T1 + ): Statics & T1; + + static reopenClass< + Statics, + T1 extends EmberClassArguments, + T2 extends EmberClassArguments + >(this: Statics, arg1: T1, arg2: T2): Statics & T1 & T2; + + static reopenClass< + Statics, + T1 extends EmberClassArguments, + T2 extends EmberClassArguments, + T3 extends EmberClassArguments + >(this: Statics, arg1: T1, arg2: T2, arg3: T3): Statics & T1 & T2 & T3; + + static detect( + this: Statics & EmberClassConstructor, + obj: any + ): obj is Objectify & EmberClassConstructor; + + static detectInstance( + this: EmberClassConstructor, + obj: any + ): obj is Instance; + + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + /** + * The `DataAdapter` helps a data persistence library + * interface with tools that debug Ember such as Chrome and Firefox. + */ + class DataAdapter extends Object { + /** + * The container-debug-adapter which is used + * to list all models. + */ + containerDebugAdapter: any; + /** + * Ember Data > v1.0.0-beta.18 + * requires string model names to be passed + * around instead of the actual factories. + */ + acceptsModelName: any; + /** + * Specifies how records can be filtered. + * Records returned will need to have a `filterValues` + * property with a key for every name in the returned array. + */ + getFilters(): any[]; + /** + * Fetch the model types and observe them for changes. + */ + watchModelTypes(typesAdded: Function, typesUpdated: Function): Function; + /** + * Fetch the records of a given type and observe them for changes. + */ + watchRecords( + modelName: string, + recordsAdded: Function, + recordsUpdated: Function, + recordsRemoved: Function + ): Function; + } + const Debug: { + /** + * Allows for runtime registration of handler functions that override the default deprecation behavior. + * Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). + * The following example demonstrates its usage by registering a handler that throws an error if the + * message contains the word "should", otherwise defers to the default handler. + */ + registerDeprecationHandler(handler: Function): any; + /** + * Allows for runtime registration of handler functions that override the default warning behavior. + * Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). + * The following example demonstrates its usage by registering a handler that does nothing overriding Ember's + * default warning behavior. + */ + registerWarnHandler(handler: Function): any; + }; + /** + * The DefaultResolver defines the default lookup rules to resolve + * container lookups before consulting the container for registered + * items: + */ + class DefaultResolver extends Resolver { + /** + * This method is called via the container's resolver method. + * It parses the provided `fullName` and then looks up and + * returns the appropriate template or class. + */ + resolve(fullName: string): {}; + /** + * This will be set to the Application instance when it is + * created. + */ + namespace: Application; + } + /** + * The `Engine` class contains core functionality for both applications and + * engines. + */ + class Engine extends Namespace { + /** + * The goal of initializers should be to register dependencies and injections. + * This phase runs once. Because these initializers may load code, they are + * allowed to defer application readiness and advance it. If you need to access + * the container or store you should use an InstanceInitializer that will be run + * after all initializers and therefore after all code is loaded and the app is + * ready. + */ + initializer(initializer: {}): any; + /** + * Instance initializers run after all initializers have run. Because + * instance initializers run after the app is fully set up. We have access + * to the store, container, and other items. However, these initializers run + * after code has loaded and are not allowed to defer readiness. + */ + instanceInitializer(instanceInitializer: any): any; + /** + * Set this to provide an alternate class to `Ember.DefaultResolver` + */ + resolver: Resolver; + } + /** + * The `EngineInstance` encapsulates all of the stateful aspects of a + * running `Engine`. + */ + class EngineInstance extends Ember.Object.extend( + _RegistryProxyMixin, + _ContainerProxyMixin + ) { + /** + * Unregister a factory. + */ + unregister(fullName: string): any; + } + /** + * This mixin defines the common interface implemented by enumerable objects + * in Ember. Most of these methods follow the standard Array iteration + * API defined up to JavaScript 1.8 (excluding language-specific features that + * cannot be emulated in older versions of JavaScript). + */ + interface Enumerable { + /** + * Helper method returns the first object from a collection. This is usually + * used by bindings and other parts of the framework to extract a single + * object if the enumerable contains only one item. + */ + firstObject: ComputedProperty; + /** + * Helper method returns the last object from a collection. If your enumerable + * contains only one object, this method should always return that object. + * If your enumerable is empty, this method should return `undefined`. + */ + lastObject: ComputedProperty; + /** + * @deprecated Use `Enumerable#includes` instead. + */ + contains(obj: T): boolean; + /** + * Iterates through the enumerable, calling the passed function on each + * item. This method corresponds to the `forEach()` method defined in + * JavaScript 1.6. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + /** + * Alias for `mapBy` + */ + getEach(key: string): any[]; + /** + * Sets the value on the named property for each member. This is more + * ergonomic than using other methods defined on this helper. If the object + * implements Ember.Observable, the value will be changed to `set(),` otherwise + * it will be set directly. `null` objects are skipped. + */ + setEach(key: string, value: any): any; + /** + * Maps all of the items in the enumeration to another value, returning + * a new array. This method corresponds to `map()` defined in JavaScript 1.6. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + /** + * Similar to map, this specialized function returns the value of the named + * property on all items in the enumeration. + */ + mapBy(key: string): any[]; + /** + * Returns an array with all of the items in the enumeration that the passed + * function returns true for. This method corresponds to `filter()` defined in + * JavaScript 1.6. + */ + filter( + callbackfn: (value: T, index: number, array: T[]) => value is S, + thisArg?: any + ): S[]; + filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; + /** + * Returns an array with all of the items in the enumeration where the passed + * function returns false. This method is the inverse of filter(). + */ + reject(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; + /** + * Returns an array with just the items with the matched property. You + * can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to `true`. + */ + filterBy(key: string, value?: any): any[]; + /** + * Returns an array with the items that do not have truthy values for + * key. You can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to false. + */ + rejectBy(key: string, value?: string): any[]; + /** + * Returns the first item in the array for which the callback returns true. + * This method works similar to the `filter()` method defined in JavaScript 1.6 + * except that it will stop working on the array once a match is found. + */ + find( + predicate: (value: T, index: number, obj: T[]) => boolean, + thisArg?: any + ): T | undefined; + /** + * Returns the first item with a property matching the passed value. You + * can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to `true`. + */ + findBy(key: string, value: string): T | undefined; + /** + * Returns `true` if the passed function returns true for every item in the + * enumeration. This corresponds with the `every()` method in JavaScript 1.6. + */ + every( + callbackfn: (value: T, index: number, array: T[]) => boolean, + thisArg?: any + ): boolean; + /** + * Returns `true` if the passed property resolves to the value of the second + * argument for all items in the enumerable. This method is often simpler/faster + * than using a callback. + */ + isEvery(key: string, value: boolean): boolean; + /** + * Returns `true` if the passed function returns true for any item in the + * enumeration. + */ + any(callback: (value: T, index: number, array: T[]) => boolean, target?: {}): boolean; + /** + * Returns `true` if the passed property resolves to the value of the second + * argument for any item in the enumerable. This method is often simpler/faster + * than using a callback. + */ + isAny(key: string, value?: boolean): boolean; + /** + * This will combine the values of the enumerator into a single value. It + * is a useful way to collect a summary value from an enumeration. This + * corresponds to the `reduce()` method defined in JavaScript 1.8. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + /** + * Invokes the named method on every object in the receiver that + * implements it. This method corresponds to the implementation in + * Prototype 1.6. + */ + invoke(methodName: keyof T, ...args: any[]): any[]; + /** + * Simply converts the enumerable into a genuine array. The order is not + * guaranteed. Corresponds to the method implemented by Prototype. + */ + toArray(): T[]; + /** + * Returns a copy of the array with all `null` and `undefined` elements removed. + */ + compact(): Enumerable; + /** + * Returns a new enumerable that excludes the passed value. The default + * implementation returns an array regardless of the receiver type. + * If the receiver does not contain the value it returns the original enumerable. + */ + without(value: T): Enumerable; + /** + * Returns a new enumerable that contains only unique values. The default + * implementation returns an array regardless of the receiver type. + */ + uniq(): Enumerable; + /** + * Converts the enumerable into an array and sorts by the keys + * specified in the argument. + */ + sortBy(property: string): Enumerable; + /** + * Returns a new enumerable that contains only items containing a unique property value. + * The default implementation returns an array regardless of the receiver type. + */ + uniqBy(): Enumerable; + /** + * Returns `true` if the passed object can be found in the enumerable. + */ + includes(searchElement: T, fromIndex?: number): boolean; + /** + * This is the handler for the special array content property. If you get + * this property, it will return this. If you set this property to a new + * array, it will replace the current content. + */ + '[]': ComputedProperty; + } + const Enumerable: Mixin>; + /** + A subclass of the JavaScript Error object for use in Ember. + **/ + const Error: ErrorConstructor; + /** + * `Ember.EventDispatcher` handles delegating browser events to their + * corresponding `Ember.Views.` For example, when you click on a view, + * `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets + * called. + * @private + */ + class EventDispatcher extends Object { + /** + * The set of events names (and associated handler function names) to be setup + * and dispatched by the `EventDispatcher`. Modifications to this list can be done + * at setup time, generally via the `Ember.Application.customEvents` hash. + */ + events: EventDispatcherEvents; + } + /** + * This mixin allows for Ember objects to subscribe to and emit events. + */ + interface Evented { + /** + * Subscribes to a named event with given function. + */ + on( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + on(name: string, method: (...args: any[]) => void): this; + /** + * Subscribes a function to a named event and then cancels the subscription + * after the first time the event is triggered. It is good to use ``one`` when + * you only care about the first time an event has taken place. + */ + one( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + one(name: string, method: (...args: any[]) => void): this; + /** + * Triggers a named event for the object. Any additional arguments + * will be passed as parameters to the functions that are subscribed to the + * event. + */ + trigger(name: string, ...args: any[]): any; + /** + * Cancels subscription for given name, target, and method. + */ + off( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + off(name: string, method: (...args: any[]) => void): this; + /** + * Checks to see if object has any subscriptions for named event. + */ + has(name: string): boolean; + } + const Evented: Mixin; + /** + * The `Ember.Freezable` mixin implements some basic methods for marking an + * object as frozen. Once an object is frozen it should be read only. No changes + * may be made the internal state of the object. + * @private + * @deprecated Use `Object.freeze` instead. + */ + interface Freezable { + freeze(): Freezable; + isFrozen: boolean; + } + const Freezable: Mixin; + /** + * `Ember.HashLocation` implements the location API using the browser's + * hash. At present, it relies on a `hashchange` event existing in the + * browser. + * @protected + */ + class HashLocation extends Object {} + /** + * Ember.HistoryLocation implements the location API using the browser's + * history.pushState API. + * @protected + */ + class HistoryLocation extends Object {} + /** + * Ember Helpers are functions that can compute values, and are used in templates. + * For example, this code calls a helper named `format-currency`: + */ + class Helper extends Object { + /** + * In many cases, the ceremony of a full `Ember.Helper` class is not required. + * The `helper` method create pure-function helpers without instances. For + * example: + */ + static helper(helper: (params: any[], hash?: object) => any): Helper; + /** + * Override this function when writing a class-based helper. + */ + compute(params: any[], hash: object): any; + /** + * On a class-based helper, it may be useful to force a recomputation of that + * helpers value. This is akin to `rerender` on a component. + */ + recompute(): any; + } + /** + * The purpose of the Ember Instrumentation module is + * to provide efficient, general-purpose instrumentation + * for Ember. + * @private + */ + const Instrumentation: { + instrument(name: string, payload: any, callback: Function, binding: any): void; + reset(): void; + subscribe(pattern: string, object: any): void; + unsubscribe(subscriber: any): void; + }; + /** + * `Ember.LinkComponent` renders an element whose `click` event triggers a + * transition of the application's instance of `Ember.Router` to + * a supplied route by name. + */ + class LinkComponent extends Component { + /** + * Used to determine when this `LinkComponent` is active. + */ + currentWhen: any; + /** + * Sets the `title` attribute of the `LinkComponent`'s HTML element. + */ + title: string | null; + /** + * Sets the `rel` attribute of the `LinkComponent`'s HTML element. + */ + rel: string | null; + /** + * Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. + */ + tabindex: string | null; + /** + * Sets the `target` attribute of the `LinkComponent`'s HTML element. + */ + target: string | null; + /** + * The CSS class to apply to `LinkComponent`'s element when its `active` + * property is `true`. + */ + activeClass: string; + /** + * Determines whether the `LinkComponent` will trigger routing via + * the `replaceWith` routing strategy. + */ + replace: boolean; + } + /** + * Ember.Location returns an instance of the correct implementation of + * the `location` API. + */ + const Location: { + /** + * This is deprecated in favor of using the container to lookup the location + * implementation as desired. + * @deprecated Use the container to lookup the location implementation that you need. + */ + create(options?: {}): any; + }; + /** + * Inside Ember-Metal, simply uses the methods from `imports.console`. + * Override this to provide more robust logging functionality. + */ + const Logger: { + /** + * If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. + */ + assert(test: boolean, message?: string): void; + /** + * Logs the arguments to the console in blue text. + */ + debug(...args: any[]): void; + /** + * Prints the arguments to the console with an error icon, red text and a stack trace. + */ + error(...args: any[]): void; + /** + * Logs the arguments to the console. + */ + info(...args: any[]): void; + /** + * Logs the arguments to the console. + */ + log(...args: any[]): void; + /** + * Prints the arguments to the console with a warning icon. + */ + warn(...args: any[]): void; + }; + /** + * A Map stores values indexed by keys. Unlike JavaScript's + * default Objects, the keys of a Map can be any JavaScript + * object. + * @deprecated + */ + class Map { + copy(): Map; + static create(): Map; + forEach(callback: Function, self: any): void; + get(key: any): any; + has(key: any): boolean; + set(key: any, value: any): void; + length: number; + } + /** + * @deprecated + */ + class MapWithDefault extends Map { + copy(): MapWithDefault; + static create(): MapWithDefault; + } + /** + * The `Ember.Mixin` class allows you to create mixins, whose properties can be + * added to other classes. + */ + class Mixin { + /** + * Mixin needs to have *something* on its prototype, otherwise it's treated like an empty interface. + */ + private __ember_mixin__: never; + + static create( + args?: T & ThisType> + ): Mixin; + } + /** + * This mixin defines the API for modifying array-like objects. These methods + * can be applied only to a collection that keeps its items in an ordered set. + * It builds upon the Array mixin and adds methods to modify the array. + * One concrete implementations of this class include ArrayProxy. + */ + interface MutableArray extends Array, MutableEnumberable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + replace(idx: number, amt: number, objects: any[]): any; + /** + * Remove all elements from the array. This is useful if you + * want to reuse an existing array without having to recreate it. + */ + clear(): this; + /** + * This will use the primitive `replace()` method to insert an object at the + * specified index. + */ + insertAt(idx: number, object: {}): this; + /** + * Remove an object at the specified index using the `replace()` primitive + * method. You can pass either a single index, or a start and a length. + */ + removeAt(start: number, len: number): this; + /** + * Push the object onto the end of the array. Works just like `push()` but it + * is KVO-compliant. + */ + pushObject(obj: T): T; + /** + * Add the objects in the passed numerable to the end of the array. Defers + * notifying observers of the change until all objects are added. + */ + pushObjects(objects: Enumerable): this; + /** + * Pop object from array or nil if none are left. Works just like `pop()` but + * it is KVO-compliant. + */ + popObject(): T; + /** + * Shift an object from start of array or nil if none are left. Works just + * like `shift()` but it is KVO-compliant. + */ + shiftObject(): T; + /** + * Unshift an object to start of array. Works just like `unshift()` but it is + * KVO-compliant. + */ + unshiftObject(obj: T): T; + /** + * Adds the named objects to the beginning of the array. Defers notifying + * observers until all objects have been added. + */ + unshiftObjects(objects: Enumerable): this; + /** + * Reverse objects in the array. Works just like `reverse()` but it is + * KVO-compliant. + */ + reverseObjects(): this; + /** + * Replace all the receiver's content with content of the argument. + * If argument is an empty array receiver will be cleared. + */ + setObjects(objects: Ember.Array): this; + } + const MutableArray: Mixin>; + /** + * This mixin defines the API for modifying generic enumerables. These methods + * can be applied to an object regardless of whether it is ordered or + * unordered. + */ + interface MutableEnumberable extends Enumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + addObject(object: T): T; + /** + * Adds each object in the passed enumerable to the receiver. + */ + addObjects(objects: Enumerable): this; + /** + * __Required.__ You must implement this method to apply this mixin. + */ + removeObject(object: T): T; + /** + * Removes each object in the passed enumerable from the receiver. + */ + removeObjects(objects: Enumerable): this; + } + const MutableEnumerable: Mixin>; + /** + * A Namespace is an object usually used to contain other objects or methods + * such as an application or framework. Create a namespace anytime you want + * to define one of these new containers. + */ + class Namespace extends Object {} + /** + * The NativeArray mixin contains the properties needed to make the native + * Array support Ember.MutableArray and all of its dependent APIs. Unless you + * have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to + * false, this will be applied automatically. Otherwise you can apply the mixin + * at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + */ + interface NativeArray extends GlobalArray, MutableArray, Observable, Copyable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + length: number; + + // NOTE: some array polyfill methods are re-declared here because their signatures + // differ between typescript versions 2.4 and 2.6. Since we need to compile against + // both, pick the more recent signature and re-declare it here as a tie-breaker. + + /** + * Returns the first item in the array for which the callback returns true. + * This method works similar to the `filter()` method defined in JavaScript 1.6 + * except that it will stop working on the array once a match is found. + */ + find( + predicate: (value: T, index: number, obj: T[]) => boolean, + thisArg?: any + ): T | undefined; + /** + * This will combine the values of the enumerator into a single value. It + * is a useful way to collect a summary value from an enumeration. This + * corresponds to the `reduce()` method defined in JavaScript 1.8. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + } + const NativeArray: Mixin>; + /** + * Ember.NoneLocation does not interact with the browser. It is useful for + * testing, or when you need to manage state with your Router, but temporarily + * don't want it to muck with the URL (for example when you embed your + * application in a larger page). + * @private + */ + class NoneLocation extends Object {} + /** + * `Ember.Object` is the main base class for all Ember objects. It is a subclass + * of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, + * see the documentation for each of these. + */ + class Object extends CoreObject.extend(Observable) {} + /** + * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself + * to a proxied `content` object. + */ + class ObjectProxy extends Object { + /** + The object whose properties will be forwarded. + **/ + content: Object; + } + /** + * This mixin provides properties and property observing functionality, core features of the Ember object model. + */ + interface Observable { + /** + * Retrieves the value of a property from the object. + */ + get(this: ComputedProperties, key: K): T[K]; + /** + * To get the values of multiple properties at once, call `getProperties` + * with a list of strings or an array: + */ + getProperties(this: ComputedProperties, list: K[]): Pick; + getProperties( + this: ComputedProperties, + ...list: K[] + ): Pick; + /** + * Sets the provided key or path to the value. + */ + set(this: ComputedProperties, key: K, value: T[K]): T[K]; + /** + * Sets a list of properties at once. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ + setProperties( + this: ComputedProperties, + hash: Pick + ): Pick; + /** + * Convenience method to call `propertyWillChange` and `propertyDidChange` in + * succession. + */ + notifyPropertyChange(keyName: string): this; + /** + * Adds an observer on a property. + */ + addObserver( + key: keyof this, + target: Target, + method: ObserverMethod + ): void; + /** + * Remove an observer you have previously registered on this object. Pass + * the same key, target, and method you passed to `addObserver()` and your + * target will no longer receive notifications. + */ + removeObserver( + key: keyof this, + target: Target, + method: ObserverMethod + ): any; + /** + * Retrieves the value of a property, or a default value in the case that the + * property returns `undefined`. + */ + getWithDefault( + this: ComputedProperties, + key: K, + defaultValue: T[K] + ): T[K]; + /** + * Set the value of a property to the current value plus some amount. + */ + incrementProperty(keyName: keyof this, increment?: number): number; + /** + * Set the value of a property to the current value minus some amount. + */ + decrementProperty(keyName: keyof this, decrement?: number): number; + /** + * Set the value of a boolean property to the opposite of its + * current value. + */ + toggleProperty(keyName: keyof this): boolean; + /** + * Returns the cached value of a computed property, if it exists. + * This allows you to inspect the value of a computed property + * without accidentally invoking it if it is intended to be + * generated lazily. + */ + cacheFor(this: ComputedProperties, key: K): T[K] | undefined; + } + const Observable: Mixin; + /** + * This class is used internally by Ember and Ember Data. + * Please do not use it at this time. We plan to clean it up + * and add many tests soon. + * @deprecated + */ + class OrderedSet { + add(obj: any): void; + clear(): void; + copy(): OrderedSet; + static create(): OrderedSet; + forEach(fn: Function, self: any): void; + has(obj: any): boolean; + isEmpty(): boolean; + toArray(): any[]; + } + /** + * A low level mixin making ObjectProxy promise-aware. + */ + interface PromiseProxyMixin extends RSVP.Promise { + /** + * If the proxied promise is rejected this will contain the reason + * provided. + */ + reason: any; + /** + * Once the proxied promise has settled this will become `false`. + */ + isPending: boolean; + /** + * Once the proxied promise has settled this will become `true`. + */ + isSettled: boolean; + /** + * Will become `true` if the proxied promise is rejected. + */ + isRejected: boolean; + /** + * Will become `true` if the proxied promise is fulfilled. + */ + isFulfilled: boolean; + /** + * The promise whose fulfillment value is being proxied by this object. + */ + promise: RSVP.Promise; + } + const PromiseProxyMixin: Mixin>; + /** + * A registry used to store factory and option information keyed + * by type. + * @private + */ + class Registry { + register( + fullName: string, + factory: EmberClassConstructor, + options?: { singleton?: boolean } + ): void; + } + class Resolver extends Ember.Object {} + /** + The `Ember.Route` class is used to define individual routes. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ + class Route extends Object.extend(ActionHandler, Evented) { + // methods + /** + This hook is called after this route's model has resolved. + It follows identical async/promise semantics to `beforeModel` + but is provided the route's resolved model in addition to + the `transition`, and is therefore suited to performing + logic that can only take place after the model has already + resolved. + */ + afterModel(resolvedModel: any, transition: Transition): Rsvp.Promise; + + /** + This hook is the first of the route entry validation hooks + called when an attempt is made to transition into a route + or one of its children. It is called before `model` and + `afterModel`, and is appropriate for cases when: + 1) A decision can be made to redirect elsewhere without + needing to resolve the model first. + 2) Any async operations need to occur first before the + model is attempted to be resolved. + This hook is provided the current `transition` attempt + as a parameter, which can be used to `.abort()` the transition, + save it for a later `.retry()`, or retrieve values set + on it from a previous hook. You can also just call + `this.transitionTo` to another route to implicitly + abort the `transition`. + You can return a promise from this hook to pause the + transition until the promise resolves (or rejects). This could + be useful, for instance, for retrieving async code from + the server that is required to enter a route. + */ + beforeModel(transition: Transition): Rsvp.Promise; + + /** + * Returns the controller for a particular route or name. + * The controller instance must already have been created, either through entering the + * associated route or using `generateController`. + */ + controllerFor(name: string): Controller; + + /** + * Disconnects a view that has been rendered into an outlet. + */ + disconnectOutlet(options: string | { outlet?: string; parentView?: string }): void; + + /** + * A hook you can implement to convert the URL into the model for + * this route. + */ + model(params: {}, transition: Transition): T | Rsvp.Promise; + + /** + * Returns the model of a parent (or any ancestor) route + * in a route hierarchy. During a transition, all routes + * must resolve a model object, and if a route + * needs access to a parent route's model in order to + * resolve a model (or just reuse the model from a parent), + * it can call `this.modelFor(theNameOfParentRoute)` to + * retrieve it. + */ + modelFor(name: string): {}; + + /** + * Retrieves parameters, for current route using the state.params + * variable and getQueryParamsFor, using the supplied routeName. + */ + paramsFor(name: string): {}; + + /** + * Refresh the model on this route and any child routes, firing the + * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + * to how routes are entered when transitioning in from other route. + * The current route params (e.g. `article_id`) will be passed in + * to the respective model hooks, and if a different model is returned, + * `setupController` and associated route hooks will re-fire as well. + * An example usage of this method is re-querying the server for the + * latest information using the same parameters as when the route + * was first entered. + * Note that this will cause `model` hooks to fire even on routes + * that were provided a model object when the route was initially + * entered. + */ + redirect(): Transition; + + /** + * Refresh the model on this route and any child routes, firing the + * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + * to how routes are entered when transitioning in from other route. + * The current route params (e.g. `article_id`) will be passed in + * to the respective model hooks, and if a different model is returned, + * `setupController` and associated route hooks will re-fire as well. + * An example usage of this method is re-querying the server for the + * latest information using the same parameters as when the route + * was first entered. + * Note that this will cause `model` hooks to fire even on routes + * that were provided a model object when the route was initially + * entered. + */ + refresh(): Transition; + + /** + * `render` is used to render a template into a region of another template + * (indicated by an `{{outlet}}`). `render` is used both during the entry + * phase of routing (via the `renderTemplate` hook) and later in response to + * user interaction. + */ + render(name: string, options?: RenderOptions): void; + + /** + * A hook you can use to render the template for the current route. + * This method is called with the controller for the current route and the + * model supplied by the `model` hook. By default, it renders the route's + * template, configured with the controller for the route. + * This method can be overridden to set up and render additional or + * alternative templates. + */ + renderTemplate(controller: Controller, model: {}): void; + + /** + * Transition into another route while replacing the current URL, if possible. + * This will replace the current history entry instead of adding a new one. + * Beside that, it is identical to `transitionTo` in all other respects. See + * 'transitionTo' for additional information regarding multiple models. + */ + replaceWith(name: string, ...args: any[]): Transition; + + /** + * A hook you can use to reset controller values either when the model + * changes or the route is exiting. + */ + resetController(controller: Controller, isExiting: boolean, transition: any): void; + + /** + * Sends an action to the router, which will delegate it to the currently active + * route hierarchy per the bubbling rules explained under actions. + */ + send(name: string, ...args: any[]): void; + + /** + * A hook you can implement to convert the route's model into parameters + * for the URL. + * + * The default `serialize` method will insert the model's `id` into the + * route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + * If the route has multiple dynamic segments or does not contain '_id', `serialize` + * will return `Ember.getProperties(model, params)` + * This method is called when `transitionTo` is called with a context + * in order to populate the URL. + */ + serialize(model: {}, params: string[]): string; + + /** + * A hook you can use to setup the controller for the current route. + * This method is called with the controller for the current route and the + * model supplied by the `model` hook. + * By default, the `setupController` hook sets the `model` property of + * the controller to the `model`. + * If you implement the `setupController` hook in your Route, it will + * prevent this default behavior. If you want to preserve that behavior + * when implementing your `setupController` function, make sure to call + * `_super` + */ + setupController(controller: Controller, model: {}): void; + + /** + * Transition the application into another route. The route may + * be either a single route or route path + */ + transitionTo(name: string, ...object: any[]): Transition; + + /** + * The name of the view to use by default when rendering this routes template. + * When rendering a template, the route will, by default, determine the + * template and view to use from the name of the route itself. If you need to + * define a specific view, set this property. + * This is useful when multiple routes would benefit from using the same view + * because it doesn't require a custom `renderTemplate` method. + */ + transitionTo(name: string, ...object: any[]): Transition; + + // properties + /** + * The controller associated with this route. + */ + controller: Controller; + + /** + * The name of the controller to associate with this route. + * By default, Ember will lookup a route's controller that matches the name + * of the route (i.e. `App.PostController` for `App.PostRoute`). However, + * if you would like to define a specific controller to use, you can do so + * using this property. + * This is useful in many ways, as the controller specified will be: + * * p assed to the `setupController` method. + * * used as the controller for the view being rendered by the route. + * * returned from a call to `controllerFor` for the route. + */ + controllerName: string; + + /** + * Configuration hash for this route's queryParams. + */ + queryParams: { [key: string]: RouteQueryParam }; + + /** + * The name of the route, dot-delimited + */ + routeName: string; + + /** + * The name of the template to use by default when rendering this routes + * template. + * This is similar with `viewName`, but is useful when you just want a custom + * template without a view. + */ + templateName: string; + + // events + /** + * This hook is executed when the router enters the route. It is not executed + * when the model for the route changes. + */ + activate(): void; + + /** + * This hook is executed when the router completely exits this route. It is + * not executed when the model for the route changes. + */ + deactivate(): void; + + /** + * The didTransition action is fired after a transition has successfully been + * completed. This occurs after the normal model hooks (beforeModel, model, + * afterModel, setupController) have resolved. The didTransition action has + * no arguments, however, it can be useful for tracking page views or resetting + * state on the controller. + */ + didTransition(): void; + + /** + * When attempting to transition into a route, any of the hooks may return a promise + * that rejects, at which point an error action will be fired on the partially-entered + * routes, allowing for per-route error handling logic, or shared error handling logic + * defined on a parent route. + */ + error(error: any, transition: Transition): void; + + /** + * The loading action is fired on the route when a route's model hook returns a + * promise that is not already resolved. The current Transition object is the first + * parameter and the route that triggered the loading event is the second parameter. + */ + loading(transition: Transition, route: Route): void; + + /** + * The willTransition action is fired at the beginning of any attempted transition + * with a Transition object as the sole argument. This action can be used for aborting, + * redirecting, or decorating the transition from the currently active routes. + */ + willTransition(transition: Transition): void; + } + /** + * The `Ember.Router` class manages the application state and URLs. Refer to + * the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ + class Router extends Object.extend(Evented) { + /** + * The `Router.map` function allows you to define mappings from URLs to routes + * in your application. These mappings are defined within the + * supplied callback function using `this.route`. + */ + static map(callback: (this: RouterDSL) => void): void; + /** + * The `location` property determines the type of URL's that your + * application will use. + */ + location: string; + /** + * Represents the URL of the root of the application, often '/'. This prefix is + * assumed on all routes defined on this router. + */ + rootURL: string; + /** + * Handles updating the paths and notifying any listeners of the URL + * change. + */ + didTransition(): any; + /** + * Handles notifying any listeners of an impending URL + * change. + */ + willTransition(): any; + /** + * Transition the application into another route. The route may + * be either a single route or route path: + */ + transitionTo(name: string, ...models: any[]): Transition; + transitionTo(name: string, options: {}): Transition; + } + class RouterDSL { + constructor(name: string, options: object); + route(name: string, callback: (this: RouterDSL) => void): void; + route( + name: string, + options?: { path?: string; resetNamespace?: boolean }, + callback?: (this: RouterDSL) => void + ): void; + mount(name: string): void; + } + class Service extends Object {} + /** + * The internal class used to create textarea element when the `{{textarea}}` + * helper is used. + */ + class TextArea extends Component.extend(TextSupport) {} + /** + * The internal class used to create text inputs when the `{{input}}` + * helper is used with `type` of `text`. + */ + class TextField extends Component.extend(TextSupport) { + /** + * The `value` attribute of the input element. As the user inputs text, this + * property is updated live. + */ + value: string; + /** + * The `type` attribute of the input element. + */ + type: string; + /** + * The `size` of the text field in characters. + */ + size: string; + /** + * The `pattern` attribute of input element. + */ + pattern: string; + /** + * The `min` attribute of input element used with `type="number"` or `type="range"`. + */ + min: string; + /** + * The `max` attribute of input element used with `type="number"` or `type="range"`. + */ + max: string; + } + /** + * `TextSupport` is a shared mixin used by both `Ember.TextField` and + * `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to + * specify a controller action to invoke when a certain event is fired on your + * text field or textarea. The specifed controller action would get the current + * value of the field passed in as the only argument unless the value of + * the field is empty. In that case, the instance of the field itself is passed + * in as the only argument. + */ + interface TextSupport extends TargetActionSupport { + cancel(event: Function): void; + focusIn(event: Function): void; + focusOut(event: Function): void; + insertNewLine(event: Function): void; + keyPress(event: Function): void; + action: string; + bubbles: boolean; + onEvent: string; + } + const TextSupport: Ember.Mixin; + interface Transition { + /** + Aborts the Transition. Note you can also implicitly abort a transition + by initiating another transition while a previous one is underway. + */ + abort(): Transition; + /** + Retries a previously-aborted transition (making sure to abort the + transition if it's still active). Returns a new transition that + represents the new attempt to transition. + */ + retry(): Transition; + } + interface ViewTargetActionSupport { + target: any; + actionContext: any; + } + const ViewTargetActionSupport: Mixin; + const ViewUtils: {}; // TODO: define interface + + // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js + const RSVP: typeof Rsvp; + namespace RSVP { + type Promise = Rsvp.Promise; + } + + /** + * This is a container for an assortment of testing related functionality + */ + namespace Test { + /** + * `registerHelper` is used to register a test helper that will be injected + * when `App.injectTestHelpers` is called. + */ + function registerHelper( + name: string, + helperMethod: (app: Application, ...args: any[]) => any, + options?: object + ): any; + /** + * `registerAsyncHelper` is used to register an async test helper that will be injected + * when `App.injectTestHelpers` is called. + */ + function registerAsyncHelper( + name: string, + helperMethod: (app: Application, ...args: any[]) => any + ): void; + /** + * Remove a previously added helper method. + */ + function unregisterHelper(name: string): void; + /** + * Used to register callbacks to be fired whenever `App.injectTestHelpers` + * is called. + */ + function onInjectHelpers(callback: (app: Application) => void): void; + /** + * This returns a thenable tailored for testing. It catches failed + * `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` + * callback in the last chained then. + */ + function promise( + resolver: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void + ) => void, + label?: string + ): Ember.Test.Promise; + /** + * Replacement for `Ember.RSVP.resolve` + * The only difference is this uses + * an instance of `Ember.Test.Promise` + */ + function resolve(value?: T | PromiseLike, label?: string): Ember.Test.Promise; + function resolve(): Ember.Test.Promise; + /** + * This allows ember-testing to play nicely with other asynchronous + * events, such as an application that is waiting for a CSS3 + * transition or an IndexDB transaction. The waiter runs periodically + * after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, + * until the returning result is truthy. After the waiters finish, the next async helper + * is executed and the process repeats. + */ + function registerWaiter(callback: () => boolean): any; + function registerWaiter( + context: Context, + callback: (this: Context) => boolean + ): any; + /** + * `unregisterWaiter` is used to unregister a callback that was + * registered with `registerWaiter`. + */ + function unregisterWaiter(callback: () => boolean): any; + function unregisterWaiter( + context: Context, + callback: (this: Context) => boolean + ): any; + /** + * Iterates through each registered test waiter, and invokes + * its callback. If any waiter returns false, this method will return + * true indicating that the waiters have not settled yet. + */ + function checkWaiters(): boolean; + /** + * Used to allow ember-testing to communicate with a specific testing + * framework. + */ + const adapter: Adapter; + /** + * The primary purpose of this class is to create hooks that can be implemented + * by an adapter for various test frameworks. + */ + class Adapter { + /** + * This callback will be called whenever an async operation is about to start. + */ + asyncStart(): any; + /** + * This callback will be called whenever an async operation has completed. + */ + asyncEnd(): any; + /** + * Override this method with your testing framework's false assertion. + * This function is called whenever an exception occurs causing the testing + * promise to fail. + */ + exception(error: string): any; + } + /** + * This class implements the methods defined by Ember.Test.Adapter for the + * QUnit testing framework. + */ + class QUnitAdapter extends Adapter {} + class Promise extends Rsvp.Promise { + constructor( + executor: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void + ) => void + ); + } + } + /** + * Namespace for injection helper methods. + */ + namespace inject { + /** + * Creates a property that lazily looks up another controller in the container. + * Can only be used when defining another controller. + */ + function controller(name?: string): ComputedProperty; + /** + * Creates a property that lazily looks up a service in the container. There + * are no restrictions as to what objects a service can be injected into. + */ + function service(name?: string): ComputedProperty; + } + namespace ENV { + const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; + const LOG_BINDINGS: boolean; + const LOG_STACKTRACE_ON_DEPRECATION: boolean; + const LOG_VERSION: boolean; + const MODEL_FACTORY_INJECTIONS: boolean; + const RAISE_ON_DEPRECATION: boolean; + } + namespace EXTEND_PROTOTYPES { + const Array: boolean; + const Function: boolean; + const String: boolean; + } + namespace Handlebars { + function compile(string: string): Function; + function compile(environment: any, options?: any, context?: any, asObject?: any): any; + function precompile(string: string, options: any): void; + class Compiler {} + class JavaScriptCompiler {} + function registerPartial(name: string, str: any): void; + function K(): any; + function createFrame(objec: any): any; + function Exception(message: string): void; + class SafeString { + constructor(str: string); + static toString(): string; + } + function parse(string: string): any; + function print(ast: any): void; + const logger: typeof Ember.Logger; + function log(level: string, str: string): void; + } + namespace String { + function camelize(str: string): string; + function capitalize(str: string): string; + function classify(str: string): string; + function dasherize(str: string): string; + function decamelize(str: string): string; + function fmt(...args: string[]): string; + function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; + function isHTMLSafe(str: string): boolean; + function loc(...args: string[]): string; + function underscore(str: string): string; + function w(str: string): string[]; + } + const computed: { + (cb: ComputedPropertyCallback): ComputedProperty; + (k1: string, cb: ComputedPropertyCallback): ComputedProperty; + (k1: string, k2: string, cb: ComputedPropertyCallback): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + k6: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + k6: string, + k7: string, + ...rest: any[] + ): ComputedProperty; + + /** + * A computed property that returns true if the value of the dependent + * property is null, an empty string, empty array, or empty function. + */ + empty(dependentKey: string): ComputedProperty; + /** + * A computed property that returns true if the value of the dependent + * property is NOT null, an empty string, empty array, or empty function. + */ + notEmpty(dependentKey: string): ComputedProperty; + /** + * A computed property that returns true if the value of the dependent + * property is null or undefined. This avoids errors from JSLint complaining + * about use of ==, which can be technically confusing. + */ + none(dependentKey: string): ComputedProperty; + /** + * A computed property that returns the inverse boolean value + * of the original value for the dependent property. + */ + not(dependentKey: string): ComputedProperty; + /** + * A computed property that converts the provided dependent property + * into a boolean value. + */ + bool(dependentKey: string): ComputedProperty; + /** + * A computed property which matches the original value for the + * dependent property against a given RegExp, returning `true` + * if the value matches the RegExp and `false` if it does not. + */ + match(dependentKey: string, regexp: RegExp): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is equal to the given value. + */ + equal(dependentKey: string, value: any): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is greater than the provided value. + */ + gt(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is greater than or equal to the provided value. + */ + gte(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is less than the provided value. + */ + lt(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is less than or equal to the provided value. + */ + lte(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that performs a logical `and` on the + * original values for the provided dependent properties. + */ + and(...dependentKeys: string[]): ComputedProperty; + /** + * A computed property which performs a logical `or` on the + * original values for the provided dependent properties. + */ + or(...dependentKeys: string[]): ComputedProperty; + /** + * Creates a new property that is an alias for another property + * on an object. Calls to `get` or `set` this property behave as + * though they were called on the original property. + */ + alias(dependentKey: string): ComputedProperty; + /** + * Where `computed.alias` aliases `get` and `set`, and allows for bidirectional + * data flow, `computed.oneWay` only provides an aliased `get`. The `set` will + * not mutate the upstream property, rather causes the current property to + * become the value set. This causes the downstream property to permanently + * diverge from the upstream property. + */ + oneWay(dependentKey: string): ComputedProperty; + /** + * This is a more semantically meaningful alias of `computed.oneWay`, + * whose name is somewhat ambiguous as to which direction the data flows. + */ + reads(dependentKey: string): ComputedProperty; + /** + * Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides + * a readOnly one way binding. Very often when using `computed.oneWay` one does + * not also want changes to propagate back up, as they will replace the value. + */ + readOnly(dependentKey: string): ComputedProperty; + /** + * Creates a new property that is an alias for another property + * on an object. Calls to `get` or `set` this property behave as + * though they were called on the original property, but also + * print a deprecation warning. + */ + deprecatingAlias( + dependentKey: string, + options: { id: string; until: string } + ): ComputedProperty; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + deprecatingAlias( + dependentKey: string, + options?: { id?: string; until?: string } + ): ComputedProperty; + /** + * A computed property that returns the sum of the values + * in the dependent array. + */ + sum(dependentKey: string): ComputedProperty; + /** + * A computed property that calculates the maximum value in the + * dependent array. This will return `-Infinity` when the dependent + * array is empty. + */ + max(dependentKey: string): ComputedProperty; + /** + * A computed property that calculates the minimum value in the + * dependent array. This will return `Infinity` when the dependent + * array is empty. + */ + min(dependentKey: string): ComputedProperty; + /** + * Returns an array mapped via the callback + */ + map( + dependentKey: string, + callback: (value: any, index: number, array: any[]) => U + ): ComputedProperty; + /** + * Returns an array mapped to the specified key. + */ + mapBy(dependentKey: string, propertyKey: string): ComputedProperty; + /** + * Filters the array by the callback. + */ + filter( + dependentKey: string, + callback: (value: any, index: number, array: any[]) => boolean + ): ComputedProperty; + /** + * Filters the array by the property and value + */ + filterBy( + dependentKey: string, + propertyKey: string, + value?: any + ): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from one or more dependent arrays. + */ + uniq(propertyKey: string): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from an array, with uniqueness determined by specific key. + */ + uniqBy(dependentKey: string, propertyKey: string): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from one or more dependent arrays. + */ + union(...propertyKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the elements + * two or more dependent arrays have in common. + */ + intersect(...propertyKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the + * properties from the first dependent array that are not in the second + * dependent array. + */ + setDiff(setAProperty: string, setBProperty: string): ComputedProperty; + /** + * A computed property that returns the array of values + * for the provided dependent properties. + */ + collect(...dependentKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the + * properties from the first dependent array sorted based on a property + * or sort function. + */ + sort( + itemsKey: string, + sortDefinition: string | ((itemA: any, itemB: any) => number) + ): ComputedProperty; + }; + const run: { + /** + * Runs the passed target and method inside of a RunLoop, ensuring any + * deferred actions including bindings and views updates are flushed at the + * end. + */ + (method: (...args: any[]) => Ret): Ret; + (target: Target, method: RunMethod): Ret; + /** + * If no run-loop is present, it creates a new one. If a run loop is + * present it will queue itself to run on the existing run-loops action + * queue. + */ + join(method: (...args: any[]) => Ret, ...args: any[]): Ret | undefined; + join( + target: Target, + method: RunMethod, + ...args: any[] + ): Ret | undefined; + /** + * Allows you to specify which context to call the specified function in while + * adding the execution of that function to the Ember run loop. This ability + * makes this method a great way to asynchronously integrate third-party libraries + * into your Ember application. + */ + bind( + target: Target, + method: RunMethod, + ...args: any[] + ): (...args: any[]) => Ret; + /** + * Begins a new RunLoop. Any deferred actions invoked after the begin will + * be buffered until you invoke a matching call to `run.end()`. This is + * a lower-level way to use a RunLoop instead of using `run()`. + */ + begin(): void; + /** + * Ends a RunLoop. This must be called sometime after you call + * `run.begin()` to flush any deferred actions. This is a lower-level way + * to use a RunLoop instead of using `run()`. + */ + end(): void; + /** + * Adds the passed target/method and any optional arguments to the named + * queue to be executed at the end of the RunLoop. If you have not already + * started a RunLoop when calling this method one will be started for you + * automatically. + */ + schedule( + queue: EmberRunQueues, + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + schedule( + queue: EmberRunQueues, + method: (args: any[]) => any, + ...args: any[] + ): EmberRunTimer; + /** + * Invokes the passed target/method and optional arguments after a specified + * period of time. The last parameter of this method must always be a number + * of milliseconds. + */ + later(method: (...args: any[]) => any, wait: number): EmberRunTimer; + later(target: Target, method: RunMethod, wait: number): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + wait: number + ): EmberRunTimer; + /** + * Schedule a function to run one time during the current RunLoop. This is equivalent + * to calling `scheduleOnce` with the "actions" queue. + */ + once(target: Target, method: RunMethod, ...args: any[]): EmberRunTimer; + /** + * Schedules a function to run one time in a given queue of the current RunLoop. + * Calling this method with the same queue/target/method combination will have + * no effect (past the initial call). + */ + scheduleOnce( + queue: EmberRunQueues, + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + /** + * Schedules an item to run from within a separate run loop, after + * control has been returned to the system. This is equivalent to calling + * `run.later` with a wait time of 1ms. + */ + next(target: Target, method: RunMethod, ...args: any[]): EmberRunTimer; + /** + * Cancels a scheduled item. Must be a value returned by `run.later()`, + * `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or + * `run.throttle()`. + */ + cancel(timer: EmberRunTimer): boolean; + /** + * Delay calling the target method until the debounce period has elapsed + * with no additional debounce calls. If `debounce` is called again before + * the specified time has elapsed, the timer is reset and the entire period + * must pass again before the target method is called. + */ + debounce( + method: (...args: any[]) => any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + /** + * Ensure that the target method is never called more frequently than + * the specified spacing period. The target method is called immediately. + */ + throttle( + method: (...args: any[]) => any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + + queues: EmberRunQueues[]; + }; + const platform: { + defineProperty: boolean; + hasPropertyAccessors: boolean; + }; + + /** + * `getEngineParent` retrieves an engine instance's parent instance. + */ + function getEngineParent(engine: EngineInstance): EngineInstance; + /** + * Display a deprecation warning with the provided message and a stack trace + * (Chrome and Firefox only). + */ + function deprecate( + message: string, + test: boolean, + options: { id: string; until: string } + ): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function deprecate( + message: string, + test: boolean, + options?: { id?: string; until?: string } + ): any; + /** + * Define an assertion that will throw an exception if the condition is not met. + */ + function assert(desc: string, test?: boolean): void | never; + /** + * Display a debug notice. + */ + function debug(message: string): void; + /** + * NOTE: This is a low-level method used by other parts of the API. + * You almost never want to call this method directly. Instead you + * should use Ember.mixin() to define new properties. + * @private + */ + function defineProperty( + obj: object, + keyName: string, + desc?: PropertyDescriptor | ComputedProperty, + data?: any, + meta?: any + ): void; + /** + * Alias an old, deprecated method with its new counterpart. + * @private + */ + function deprecateFunc any)>( + message: string, + options: { id: string; until: string }, + func: Func + ): Func; + /** + * @private + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function deprecateFunc any)>( + message: string, + func: Func + ): Func; + /** + * Run a function meant for debugging. + */ + function runInDebug(func: () => void): any; + /** + * Display a warning with the provided message. + */ + function warn(message: string, test: boolean, options: { id: string }): any; + function warn(message: string, options: { id: string }): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function warn(message: string, test: boolean, options?: { id?: string }): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function warn(message: string, options?: { id?: string }): any; + /** + * Global helper method to create a new binding. Just pass the root object + * along with a `to` and `from` path to create and connect the binding. + * @deprecated https://emberjs.com/deprecations/v2.x#toc_ember-binding + */ + function bind(obj: {}, to: string, from: string): Binding; + /** + * Returns the cached value for a property, if one exists. + * This can be useful for peeking at the value of a computed + * property that is generated lazily, without accidentally causing + * it to be created. + */ + function cacheFor( + obj: ComputedProperties, + key: K + ): T[K] | undefined; + /** + * Add an event listener + */ + function addListener( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod, + once?: boolean + ): void; + /** + * Remove an event listener + */ + function removeListener( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod + ): any; + /** + * Send an event. The execution of suspended listeners + * is skipped, and once listeners are removed. A listener without + * a target is executed on the passed object. If an array of actions + * is not passed, the actions stored on the passed object are invoked. + */ + function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; + /** + * Define a property as a function that should be executed when + * a specified event or events are triggered. + */ + function on(eventNames: string, func: (...args: any[]) => void): (...args: any[]) => void; + /** + * To get multiple properties at once, call `Ember.getProperties` + * with an object followed by a list of strings or an array: + */ + function getProperties( + obj: ComputedProperties, + list: K[] + ): Pick; + function getProperties( + obj: ComputedProperties, + ...list: K[] + ): Pick; + /** + * A value is blank if it is empty or a whitespace string. + */ + function isBlank(obj: any): boolean; + /** + * Verifies that a value is `null` or an empty string, empty array, + * or empty function. + */ + function isEmpty(obj: any): boolean; + /** + * Returns true if the passed value is null or undefined. This avoids errors + * from JSLint complaining about use of ==, which can be technically + * confusing. + */ + function isNone(obj: any): obj is null | undefined; + /** + * A value is present if it not `isBlank`. + */ + function isPresent(obj: any): boolean; + /** + * Merge the contents of two objects together into the first object. + * @deprecated Use Object.assign + */ + function merge(original: T, updates: U): T & U; + /** + * Makes a method available via an additional name. + */ + function aliasMethod(methodName: string): ComputedProperty; + /** + * Specify a method that observes property changes. + */ + function observer(key1: string, func: (target: any, key: string) => void): void; + function observer( + key1: string, + key2: string, + func: (target: any, key: string) => void + ): void; + function observer( + key1: string, + key2: string, + key3: string, + func: (target: any, key: string) => void + ): void; + function observer( + key1: string, + key2: string, + key3: string, + key4: string, + func: (target: any, key: string) => void + ): void; + function observer( + key1: string, + key2: string, + key3: string, + key4: string, + key5: string, + func: (target: any, key: string) => void + ): void; + /** + * Adds an observer on a property. + */ + function addObserver( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod + ): void; + /** + * Remove an observer you have previously registered on this object. Pass + * the same key, target, and method you passed to `addObserver()` and your + * target will no longer receive notifications. + */ + function removeObserver( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod + ): any; + /** + * Gets the value of a property on an object. If the property is computed, + * the function will be invoked. If the property is not defined but the + * object implements the `unknownProperty` method then that will be invoked. + */ + function get(obj: ComputedProperties, key: K): T[K]; + /** + * Retrieves the value of a property from an Object, or a default value in the + * case that the property returns `undefined`. + */ + function getWithDefault( + obj: ComputedProperties, + key: K, + defaultValue: T[K] + ): T[K]; + /** + * Sets the value of a property on an object, respecting computed properties + * and notifying observers and other listeners of the change. If the + * property is not defined but the object implements the `setUnknownProperty` + * method then that will be invoked as well. + */ + function set( + obj: ComputedProperties, + key: K, + value: V + ): V; + /** + * Error-tolerant form of `Ember.set`. Will not blow up if any part of the + * chain is `undefined`, `null`, or destroyed. + */ + function trySet(root: object, path: string, value: any): any; + /** + * Set a list of properties on an object. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ + function setProperties( + obj: ComputedProperties, + hash: Pick + ): Pick; + /** + * Detects when a specific package of Ember (e.g. 'Ember.Application') + * has fully loaded and is available for extension. + * @private + */ + function onLoad(name: string, callback: Function): any; + /** + * Called when an Ember.js package (e.g Ember.Application) has finished + * loading. Triggers any callbacks registered for this event. + * @private + */ + function runLoadHooks(name: string, object?: {}): any; + /** + * Creates an `Ember.NativeArray` from an Array like object. + * Does not modify the original object's contents. Ember.A is not needed if + * `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, + * it is recommended that you use Ember.A when creating addons for + * ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` + * will be `true`. + */ + function A(arr?: T[]): NativeArray; + /** + * Compares two javascript values and returns: + */ + function compare(v: any, w: any): number; + /** + * Creates a shallow copy of the passed object. A deep copy of the object is + * returned if the optional `deep` argument is `true`. + */ + function copy(obj: any, deep?: boolean): any; + /** + * Compares two objects, returning true if they are equal. + */ + function isEqual(a: any, b: any): boolean; + /** + * Returns true if the passed object is an array or Array-like. + */ + function isArray(obj: any): obj is ArrayLike; + /** + * Returns a consistent type for the passed object. + */ + function typeOf(item: any): string; + /** + * Copy properties from a source object to a target object. + * @deprecated Use Object.assign + */ + function assign(target: T, source: U): T & U; + function assign(target: T, source1: U, source2: V): T & U & V; + function assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + /** + * Polyfill for Object.create + * @deprecated Use Object.create + */ + function create(o: object | null): any; + /** + * Polyfill for Object.keys + * @deprecated Use Object.keys + */ + function keys(o: any): string[]; + /** + * Returns a unique id for the object. If the object does not yet have a guid, + * one will be assigned to it. You can call this on any object, + * `Ember.Object`-based or not, but be aware that it will add a `_guid` + * property. + */ + function guidFor(obj: any): string; + /** + * Convenience method to inspect an object. This method will attempt to + * convert the object into a useful string description. + * @private + */ + function inspect(obj: any): string; + /** + * Checks to see if the `methodName` exists on the `obj`, + * and if it does, invokes it with the arguments passed. + */ + function tryInvoke(obj: any, methodName: string, args?: any[]): any; + /** + * Forces the passed object to be part of an array. If the object is already + * an array, it will return the object. Otherwise, it will add the object to + * an array. If obj is `null` or `undefined`, it will return an empty array. + * @private + */ + function makeArray(obj?: T[] | T | null | undefined): T[]; + /** + * Framework objects in an Ember application (components, services, routes, etc.) + * are created via a factory and dependency injection system. Each of these + * objects is the responsibility of an "owner", which handled its + * instantiation and manages its lifetime. + */ + function getOwner(object: any): any; + /** + * `setOwner` forces a new owner on a given object instance. This is primarily + * useful in some testing cases. + */ + function setOwner(object: any, owner: any): void; + /** + * A function may be assigned to `Ember.onerror` to be called when Ember + * internals encounter an error. This is useful for specialized error handling + * and reporting code. + */ + function onerror(error: Error): void; + /** + * An empty function useful for some operations. Always returns `this`. + * @deprecated https://emberjs.com/deprecations/v2.x/#toc_code-ember-k-code + */ + function K(this: This): This; + /** + * The semantic version + */ + const VERSION: string; + /** + * Alias for jQuery + */ + const $: JQueryStatic; + /** + * This property indicates whether or not this application is currently in + * testing mode. This is set when `setupForTesting` is called on the current + * application. + */ + const testing: boolean; + /** + * @private + */ + const instrument: typeof Instrumentation.instrument; + /** + * @private + */ + const reset: typeof Instrumentation.reset; + /** + * @private + */ + const subscribe: typeof Instrumentation.subscribe; + /** + * @private + */ + const unsubscribe: typeof Instrumentation.unsubscribe; + /** + * Expands `pattern`, invoking `callback` for each expansion. + * @private + */ + function expandProperties(pattern: string, callback: (expanded: string) => void): void; + } + + export default Ember; } -export default Ember; +declare module '@ember/application' { + import Ember from 'ember'; + export default Ember.Application; + export const getOwner: typeof Ember.getOwner; + export const onLoad: typeof Ember.onLoad; + export const runLoadHooks: typeof Ember.runLoadHooks; + export const setOwner: typeof Ember.setOwner; +} + +declare module '@ember/application/deprecations' { + import Ember from 'ember'; + export const deprecate: typeof Ember.deprecate; + export const deprecateFunc: typeof Ember.deprecateFunc; +} + +declare module '@ember/application/globals-resolver' { + import Ember from 'ember'; + export default Ember.DefaultResolver; +} + +declare module '@ember/application/instance' { + import Ember from 'ember'; + export default Ember.ApplicationInstance; +} + +declare module '@ember/application/resolver' { + import Ember from 'ember'; + export default Ember.Resolver; +} + +declare module '@ember/array' { + import Ember from 'ember'; + export default Ember.Array; + export const A: typeof Ember.A; + export const isArray: typeof Ember.isArray; + export const makeArray: typeof Ember.makeArray; +} + +declare module '@ember/array/mutable' { + import Ember from 'ember'; + export default Ember.MutableArray; +} + +declare module '@ember/array/proxy' { + import Ember from 'ember'; + export default Ember.ArrayProxy; +} + +declare module '@ember/component' { + import Ember from 'ember'; + export default Ember.Component; +} + +declare module '@ember/component/checkbox' { + import Ember from 'ember'; + export default Ember.Checkbox; +} + +declare module '@ember/component/helper' { + import Ember from 'ember'; + export default Ember.Helper; + export const helper: typeof Ember.Helper.helper; +} + +declare module '@ember/component/text-area' { + import Ember from 'ember'; + export default Ember.TextArea; +} + +declare module '@ember/component/text-field' { + import Ember from 'ember'; + export default Ember.TextField; +} + +declare module '@ember/controller' { + import Ember from 'ember'; + export default Ember.Controller; + export const inject: typeof Ember.inject.controller; +} + +declare module '@ember/debug' { + import Ember from 'ember'; + export const assert: typeof Ember.assert; + export const debug: typeof Ember.debug; + export const inspect: typeof Ember.inspect; + export const registerDeprecationHandler: typeof Ember.Debug.registerDeprecationHandler; + export const registerWarnHandler: typeof Ember.Debug.registerWarnHandler; + export const runInDebug: typeof Ember.runInDebug; + export const warn: typeof Ember.warn; +} + +declare module '@ember/debug/container-debug-adapter' { + import Ember from 'ember'; + export default Ember.ContainerDebugAdapter; +} + +declare module '@ember/debug/data-adapter' { + import Ember from 'ember'; + export default Ember.DataAdapter; +} + +declare module '@ember/engine' { + import Ember from 'ember'; + export default Ember.Engine; + export const getEngineParent: typeof Ember.getEngineParent; +} + +declare module '@ember/engine/instance' { + import Ember from 'ember'; + export default Ember.EngineInstance; +} + +declare module '@ember/enumerable' { + import Ember from 'ember'; + export default Ember.Enumerable; +} + +declare module '@ember/instrumentation' { + import Ember from 'ember'; + export const instrument: typeof Ember.instrument; + export const reset: typeof Ember.reset; + export const subscribe: typeof Ember.subscribe; + export const unsubscribe: typeof Ember.unsubscribe; +} + +declare module '@ember/map' { + import Ember from 'ember'; + export default Ember.Map; +} + +declare module '@ember/map/with-default' { + import Ember from 'ember'; + export default Ember.MapWithDefault; +} + +declare module '@ember/object' { + import Ember from 'ember'; + export default Ember.Object; + export const aliasMethod: typeof Ember.aliasMethod; + export const computed: typeof Ember.computed; + export const defineProperty: typeof Ember.defineProperty; + export const get: typeof Ember.get; + export const getProperties: typeof Ember.getProperties; + export const getWithDefault: typeof Ember.getWithDefault; + export const observer: typeof Ember.observer; + export const set: typeof Ember.set; + export const setProperties: typeof Ember.setProperties; + export const trySet: typeof Ember.trySet; +} + +declare module '@ember/object/computed' { + import Ember from 'ember'; + export default Ember.ComputedProperty; + export const alias: typeof Ember.computed.alias; + export const and: typeof Ember.computed.and; + export const bool: typeof Ember.computed.bool; + export const collect: typeof Ember.computed.collect; + export const deprecatingAlias: typeof Ember.computed.deprecatingAlias; + export const empty: typeof Ember.computed.empty; + export const equal: typeof Ember.computed.equal; + export const expandProperties: typeof Ember.expandProperties; + export const filter: typeof Ember.computed.filter; + export const filterBy: typeof Ember.computed.filterBy; + export const gt: typeof Ember.computed.gt; + export const gte: typeof Ember.computed.gte; + export const intersect: typeof Ember.computed.intersect; + export const lt: typeof Ember.computed.lt; + export const lte: typeof Ember.computed.lte; + export const map: typeof Ember.computed.map; + export const mapBy: typeof Ember.computed.mapBy; + export const match: typeof Ember.computed.match; + export const max: typeof Ember.computed.max; + export const min: typeof Ember.computed.min; + export const none: typeof Ember.computed.none; + export const not: typeof Ember.computed.not; + export const notEmpty: typeof Ember.computed.notEmpty; + export const oneWay: typeof Ember.computed.oneWay; + export const or: typeof Ember.computed.or; + export const readOnly: typeof Ember.computed.readOnly; + export const reads: typeof Ember.computed.reads; + export const setDiff: typeof Ember.computed.setDiff; + export const sort: typeof Ember.computed.sort; + export const sum: typeof Ember.computed.sum; + export const union: typeof Ember.computed.union; + export const uniq: typeof Ember.computed.uniq; + export const uniqBy: typeof Ember.computed.uniqBy; +} + +declare module '@ember/object/core' { + import Ember from 'ember'; + export default Ember.CoreObject; +} + +declare module '@ember/object/evented' { + import Ember from 'ember'; + export default Ember.Evented; + export const on: typeof Ember.on; +} + +declare module '@ember/object/events' { + import Ember from 'ember'; + export const addListener: typeof Ember.addListener; + export const removeListener: typeof Ember.removeListener; + export const sendEvent: typeof Ember.sendEvent; +} + +declare module '@ember/object/internals' { + import Ember from 'ember'; + export const cacheFor: typeof Ember.cacheFor; + export const copy: typeof Ember.copy; + export const guidFor: typeof Ember.guidFor; +} + +declare module '@ember/object/mixin' { + import Ember from 'ember'; + export default Ember.Mixin; +} + +declare module '@ember/object/observable' { + import Ember from 'ember'; + export default Ember.Observable; +} + +declare module '@ember/object/observers' { + import Ember from 'ember'; + export const addObserver: typeof Ember.addObserver; + export const removeObserver: typeof Ember.removeObserver; +} + +declare module '@ember/object/promise-proxy-mixin' { + import Ember from 'ember'; + export default Ember.PromiseProxyMixin; +} + +declare module '@ember/object/proxy' { + import Ember from 'ember'; + export default Ember.ObjectProxy; +} + +declare module '@ember/polyfills' { + import Ember from 'ember'; + export const assign: typeof Ember.assign; + export const create: typeof Ember.create; + export const hasPropertyAccessors: typeof Ember.platform.hasPropertyAccessors; + export const keys: typeof Ember.keys; + export const merge: typeof Ember.merge; +} + +declare module '@ember/routing/auto-location' { + import Ember from 'ember'; + export default Ember.AutoLocation; +} + +declare module '@ember/routing/hash-location' { + import Ember from 'ember'; + export default Ember.HashLocation; +} + +declare module '@ember/routing/history-location' { + import Ember from 'ember'; + export default Ember.HistoryLocation; +} + +declare module '@ember/routing/link-component' { + import Ember from 'ember'; + export default Ember.LinkComponent; +} + +declare module '@ember/routing/location' { + import Ember from 'ember'; + export default Ember.Location; +} + +declare module '@ember/routing/none-location' { + import Ember from 'ember'; + export default Ember.NoneLocation; +} + +declare module '@ember/routing/route' { + import Ember from 'ember'; + export default Ember.Route; +} + +declare module '@ember/routing/router' { + import Ember from 'ember'; + export default Ember.Router; +} + +declare module '@ember/runloop' { + import Ember from 'ember'; + export const begin: typeof Ember.run.begin; + export const bind: typeof Ember.run.bind; + export const cancel: typeof Ember.run.cancel; + export const debounce: typeof Ember.run.debounce; + export const end: typeof Ember.run.end; + export const join: typeof Ember.run.join; + export const later: typeof Ember.run.later; + export const next: typeof Ember.run.next; + export const once: typeof Ember.run.once; + export const run: typeof Ember.run; + export const schedule: typeof Ember.run.schedule; + export const scheduleOnce: typeof Ember.run.scheduleOnce; + export const throttle: typeof Ember.run.throttle; +} + +declare module '@ember/service' { + import Ember from 'ember'; + export default Ember.Service; + export const inject: typeof Ember.inject.service; +} + +declare module '@ember/string' { + import Ember from 'ember'; + export const camelize: typeof Ember.String.camelize; + export const capitalize: typeof Ember.String.capitalize; + export const classify: typeof Ember.String.classify; + export const dasherize: typeof Ember.String.dasherize; + export const decamelize: typeof Ember.String.decamelize; + export const fmt: typeof Ember.String.fmt; + export const htmlSafe: typeof Ember.String.htmlSafe; + export const isHTMLSafe: typeof Ember.String.isHTMLSafe; + export const loc: typeof Ember.String.loc; + export const underscore: typeof Ember.String.underscore; + export const w: typeof Ember.String.w; +} + +declare module '@ember/test' { + import Ember from 'ember'; + export const registerAsyncHelper: typeof Ember.Test.registerAsyncHelper; + export const registerHelper: typeof Ember.Test.registerHelper; + export const registerWaiter: typeof Ember.Test.registerWaiter; + export const unregisterHelper: typeof Ember.Test.unregisterHelper; + export const unregisterWaiter: typeof Ember.Test.unregisterWaiter; +} + +declare module '@ember/test/adapter' { + import Ember from 'ember'; + export default Ember.Test.Adapter; +} + +declare module '@ember/utils' { + import Ember from 'ember'; + export const compare: typeof Ember.compare; + export const isBlank: typeof Ember.isBlank; + export const isEmpty: typeof Ember.isEmpty; + export const isEqual: typeof Ember.isEqual; + export const isNone: typeof Ember.isNone; + export const isPresent: typeof Ember.isPresent; + export const tryInvoke: typeof Ember.tryInvoke; + export const typeOf: typeof Ember.typeOf; +} + +declare module 'htmlbars-inline-precompile' { + interface TemplateFactory { + __htmlbars_inline_precompile_template_factory: any; + } + export default function hbs(tagged: TemplateStringsArray): TemplateFactory; +} diff --git a/types/ember/test/application.ts b/types/ember/test/application.ts new file mode 100755 index 0000000000..0589e64879 --- /dev/null +++ b/types/ember/test/application.ts @@ -0,0 +1,15 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +let App = Ember.Application.create({ + customEvents: { + paste: 'paste' + } +}); + +let App2 = Ember.Application.create({ + customEvents: { + mouseenter: null, + mouseleave: null + } +}); diff --git a/types/ember/test/array-ext.ts b/types/ember/test/array-ext.ts new file mode 100755 index 0000000000..86e84fd7c5 --- /dev/null +++ b/types/ember/test/array-ext.ts @@ -0,0 +1,18 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +declare global { + interface Array extends Ember.ArrayPrototypeExtensions {} +} + +class Person extends Ember.Object { + name: string; +} + +const person = Person.create({ name: 'Joe' }); +const array = [person]; + +assertType(array.get('length')); +assertType(array.get('firstObject')); +assertType(array.mapBy('name')); +assertType(array.map(p => p.get('name'))); diff --git a/types/ember/test/array-proxy.ts b/types/ember/test/array-proxy.ts new file mode 100755 index 0000000000..280ab52ded --- /dev/null +++ b/types/ember/test/array-proxy.ts @@ -0,0 +1,26 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const pets = ['dog', 'cat', 'fish']; +const proxy = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + +proxy.get('firstObject'); // 'dog' +proxy.set('content', Ember.A(['amoeba', 'paramecium'])); +proxy.get('firstObject'); // 'amoeba' + +const overridden = Ember.ArrayProxy.create({ + content: Ember.A(pets), + objectAtContent(idx: number): string { + return this.get('content').objectAt(idx)!.toUpperCase(); + } +}); + +overridden.get('firstObject'); // 'DOG' + +class MyNewProxy extends Ember.ArrayProxy { + isNew = true; +} + +let x: MyNewProxy = MyNewProxy.create({ content: Ember.A([1, 2, 3]) }); +assertType(x.get('firstObject')); +assertType(x.isNew); diff --git a/types/ember/test/array.ts b/types/ember/test/array.ts new file mode 100755 index 0000000000..5934459735 --- /dev/null +++ b/types/ember/test/array.ts @@ -0,0 +1,46 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +type Person = typeof Person.prototype; +const Person = Ember.Object.extend({ + name: '', + isHappy: false +}); + +const people = Ember.A([ + Person.create({ name: 'Yehuda', isHappy: true }), + Person.create({ name: 'Majd', isHappy: false }), +]); + +assertType(people.get('length')); +assertType(people.get('lastObject')); +assertType(people.isAny('isHappy')); +assertType(people.isAny('isHappy', false)); +assertType(people.filterBy('isHappy')); +assertType(people.get('[]')); +assertType(people.get('[]').get('firstObject')); + +assertType>(people.mapBy('isHappy')); +assertType(people.mapBy('name.length')); + +const last = people.get('lastObject'); +if (last) { + assertType(last.get('name')); +} + +const first = people.get('lastObject'); +if (first) { + assertType(first.get('isHappy')); +} + +const letters: Ember.Enumerable = Ember.A(['a', 'b', 'c']); +const codes: number[] = letters.map((item, index, enumerable) => { + assertType(item); + assertType(index); + return item.charCodeAt(0); +}); + +let value = '1,2,3'; +let filters = Ember.A(value.split(',')); +filters.push('4'); +filters.sort(); diff --git a/types/ember/test/component.ts b/types/ember/test/component.ts new file mode 100755 index 0000000000..bcc314300d --- /dev/null +++ b/types/ember/test/component.ts @@ -0,0 +1,124 @@ +import Ember from 'ember'; +import Component from '@ember/component'; +import Object, { computed } from '@ember/object'; +import hbs from 'htmlbars-inline-precompile'; +import { assertType } from "./lib/assert"; + +Component.extend({ + layout: hbs` +
+ {{yield}} +
+ `, +}); + +Component.extend({ + layout: 'my-layout', +}); + +const MyComponent = Component.extend(); +assertType(Ember.get(MyComponent, 'positionalParams')); + +const component1 = Component.extend({ + actions: { + hello(name: string) { + console.log('Hello', name); + }, + }, +}); + +Component.extend({ + name: '', + hello(name: string) { + this.set('name', name); + }, +}); + +Component.extend({ + tagName: 'em', +}); + +Component.extend({ + classNames: ['my-class', 'my-other-class'], +}); + +Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: computed(function() { + if (!this.get('propertyA')) { + return 'from-b'; + } + }), +}); + +Component.extend({ + classNameBindings: ['hovered'], + hovered: true, +}); + +Component.extend({ + classNameBindings: ['messages.empty'], + messages: Object.create({ + empty: true, + }), +}); + +Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true, +}); + +Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true, +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com', +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com', +}); + +Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle', +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false, +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: computed(() => { + if ('someLogic') { + return true; + } else { + return false; + } + }), +}); + +Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null, +}); + +Component.extend({ + click(event: object) { + // will be called when an instance's + // rendered element is clicked + }, +}); diff --git a/types/ember/test/computed.ts b/types/ember/test/computed.ts new file mode 100755 index 0000000000..b9bfe2ada6 --- /dev/null +++ b/types/ember/test/computed.ts @@ -0,0 +1,160 @@ +import Ember from 'ember'; +import Component from '@ember/component'; +import { or } from '@ember/object/computed'; +import { assertType } from './lib/assert'; + +const Person = Ember.Object.extend({ + firstName: '', + lastName: '', + age: 0, + + noArgs: Ember.computed(() => 'test'), + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }), + + fullNameReadonly: Ember.computed('fullName', function() { + return this.get('fullName'); + }).readOnly(), + + fullNameWritable: Ember.computed('firstName', 'lastName', { + get() { + return this.get('fullName'); + }, + set(key, value) { + let [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + fullNameGetOnly: Ember.computed('fullName', { + get() { + return this.get('fullName'); + } + }), + + fullNameSetOnly: Ember.computed('firstName', 'lastName', { + set(key, value) { + let [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + combinators: Ember.computed(function() { + return this.get('firstName'); + }).property('firstName') + .meta({ foo: 'bar' }) + .volatile() + .readOnly() +}); + +const person = Person.create({ + firstName: 'Fred', + lastName: 'Smith', + age: 29, +}); + +assertType(person.firstName); +assertType(person.age); +assertType>(person.noArgs); +assertType>(person.fullName); +assertType>(person.fullNameReadonly); +assertType>(person.fullNameWritable); +assertType>(person.fullNameGetOnly); +assertType>(person.fullNameSetOnly); +assertType>(person.combinators); + +assertType(person.get('firstName')); +assertType(person.get('age')); +assertType(person.get('noArgs')); +assertType(person.get('fullName')); +assertType(person.get('fullNameReadonly')); +assertType(person.get('fullNameWritable')); +assertType(person.get('fullNameGetOnly')); +assertType(person.get('fullNameSetOnly')); +assertType(person.get('combinators')); + +assertType<{ firstName: string, fullName: string, age: number }>(person.getProperties('firstName', 'fullName', 'age')); + +const person2 = Person.create({ + fullName: 'Fred Smith' +}); + +assertType(person2.get('firstName')); +assertType(person2.get('fullName')); + +const person3 = Person.extend({ + firstName: 'Fred', + fullName: 'Fred Smith' +}).create(); + +assertType(person3.get('firstName')); +assertType(person3.get('fullName')); + +const person4 = Person.extend({ + firstName: Ember.computed(() => 'Fred'), + fullName: Ember.computed(() => 'Fred Smith') +}).create(); + +assertType(person4.get('firstName')); +assertType(person4.get('fullName')); + +// computed property macros +const objectWithComputedProperties = Ember.Object.extend({ + alias: Ember.computed.alias('foo'), + and: Ember.computed.and('foo', 'bar', 'baz', 'qux'), + bool: Ember.computed.bool('foo'), + collect: Ember.computed.collect('foo', 'bar', 'baz', 'qux'), + deprecatingAlias: Ember.computed.deprecatingAlias('foo', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }), + empty: Ember.computed.empty('foo'), + equalNumber: Ember.computed.equal('foo', 1), + equalString: Ember.computed.equal('foo', 'bar'), + equalObject: Ember.computed.equal('foo', {}), + filter: Ember.computed.filter('foo', (item) => item === 'bar'), + filterBy1: Ember.computed.filterBy('foo', 'bar'), + filterBy2: Ember.computed.filterBy('foo', 'bar', false), + gt: Ember.computed.gt('foo', 3), + gte: Ember.computed.gte('foo', 3), + intersect: Ember.computed.intersect('foo', 'bar', 'baz', 'qux'), + lt: Ember.computed.lt('foo', 3), + lte: Ember.computed.lte('foo', 3), + map: Ember.computed.map('foo', (item, index) => item.bar), + mapBy: Ember.computed.mapBy('foo', 'bar'), + match: Ember.computed.match('foo', /^tom.ter$/), + max: Ember.computed.max('foo'), + min: Ember.computed.min('foo'), + none: Ember.computed.none('foo'), + not: Ember.computed.not('foo'), + notEmpty: Ember.computed.notEmpty('foo'), + oneWay: Ember.computed.oneWay('foo'), + or: Ember.computed.or('foo', 'bar', 'baz', 'qux'), + readOnly: Ember.computed.readOnly('foo'), + reads: Ember.computed.reads('foo'), + setDiff: Ember.computed.setDiff('foo', 'bar'), + sort1: Ember.computed.sort('foo', 'bar'), + sort2: Ember.computed.sort('foo', (itemA, itemB) => { + if (itemA < itemB) { + return -1; + } else if (itemA > itemB) { + return 1; + } else { + return 0; + } + }), + sum: Ember.computed.sum('foo'), + union: Ember.computed.union('foo', 'bar', 'baz', 'qux'), + uniq: Ember.computed.uniq('foo'), + uniqBy: Ember.computed.uniqBy('foo', 'bar') +}); + +const component2 = Component.extend({ + isAnimal: or('isDog', 'isCat') +}); diff --git a/types/ember/test/controller.ts b/types/ember/test/controller.ts new file mode 100755 index 0000000000..02307f447c --- /dev/null +++ b/types/ember/test/controller.ts @@ -0,0 +1,11 @@ +import Controller from '@ember/controller'; + +Controller.extend ({ + queryParams: ['category'], + category: null, + isExpanded: false, + + toggleBody() { + this.toggleProperty('isExpanded'); + } +}); diff --git a/types/ember/test/create.ts b/types/ember/test/create.ts new file mode 100755 index 0000000000..6dc61b80f6 --- /dev/null +++ b/types/ember/test/create.ts @@ -0,0 +1,7 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const obj = Ember.Object.create({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(obj.a); +assertType(obj.b); +assertType(obj.c); diff --git a/types/ember/test/detect-instance.ts b/types/ember/test/detect-instance.ts new file mode 100755 index 0000000000..1b25beb244 --- /dev/null +++ b/types/ember/test/detect-instance.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const ExtendClass = Ember.Object.extend({ + foo: 'hello' +}); + +class ES6Class extends Ember.Object { + bar: string; +} + +let testObject = null; + +if (ExtendClass.detectInstance(testObject)) { + assertType(testObject.foo); +} + +if (ES6Class.detectInstance(testObject)) { + assertType(testObject.bar); +} diff --git a/types/ember/test/detect.ts b/types/ember/test/detect.ts new file mode 100755 index 0000000000..cd54880f9f --- /dev/null +++ b/types/ember/test/detect.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const ExtendClass = Ember.Object.extend({ + foo: 'hello' +}); + +class ES6Class extends Ember.Object { + bar: string; +} + +let TestClass = Ember.Object; + +if (ExtendClass.detect(TestClass)) { + assertType(TestClass.create().foo); +} + +if (ES6Class.detect(TestClass)) { + assertType(TestClass.create().bar); +} diff --git a/types/ember/ember-tests.ts b/types/ember/test/ember-tests.ts old mode 100644 new mode 100755 similarity index 68% rename from types/ember/ember-tests.ts rename to types/ember/test/ember-tests.ts index 3964d68a86..94de3bf259 --- a/types/ember/ember-tests.ts +++ b/types/ember/test/ember-tests.ts @@ -2,8 +2,7 @@ import Ember from 'ember'; let App: any; -App = Ember.Application.create(); - +App = Ember.Application.create(); App.president = Ember.Object.create({ name: 'Barack Obama', }); @@ -23,8 +22,9 @@ App.president.get('fullName'); declare class MyPerson extends Ember.Object { static createMan(): MyPerson; } +MyPerson.createMan(); -const Person1 = Ember.Object.extend({ +const Person1 = Ember.Object.extend({ say: (thing: string) => { alert(thing); }, @@ -33,7 +33,9 @@ const Person1 = Ember.Object.extend({ declare class MyPerson2 extends Ember.Object { helloWorld(): void; } -const tom = Person1.create({ +MyPerson2.create().helloWorld(); + +const tom = Person1.create({ name: 'Tom Dale', helloWorld() { this.say('Hi my name is ' + this.get('name')); @@ -41,23 +43,8 @@ const tom = Person1.create({ }); tom.helloWorld(); -Person1.reopen({ isPerson: true }); -Person1.create().get('isPerson'); - -Person1.reopenClass({ - createMan: () => { - return Person1.create({ isMan: true }); - }, -}); -// ReSharper disable once DuplicatingLocalDeclaration -Person1.createMan().get('isMan'); - -const person = Person1.create({ - firstName: 'Yehuda', - lastName: 'Katz', -}); -person.addObserver('fullName', null, () => {}); -person.set('firstName', 'Brohuda'); +const PersonReopened = Person1.reopen({ isPerson: true }); +PersonReopened.create().get('isPerson'); App.todosController = Ember.Object.create({ todos: [Ember.Object.create({ isDone: false })], @@ -105,17 +92,6 @@ App.userController = Ember.Object.create({ }), }); -Ember.Helper.helper(params => { - const cents = params[0]; - return `${cents * 0.01}`; -}); - -Ember.Helper.helper((params, hash) => { - const cents = params[0]; - const currency = hash.currency; - return `${currency}${cents * 0.01}`; -}); - Handlebars.registerHelper( 'highlight', (property: string, options: any) => @@ -124,7 +100,8 @@ Handlebars.registerHelper( const coolView = App.CoolView.create(); -const Person2 = Ember.Object.extend({ +const Person2 = Ember.Object.extend({ + name: '', sayHello() { console.log('Hello from ' + this.get('name')); }, @@ -140,24 +117,25 @@ const arr = Ember.A([Ember.Object.create(), Ember.Object.create()]); arr.setEach('name', 'unknown'); arr.getEach('name'); -const Person3 = Ember.Object.extend({ - name: null, +const Person3 = Ember.Object.extend({ + name: '', isHappy: false, }); const people2 = Ember.A([ Person3.create({ name: 'Yehuda', isHappy: true }), Person3.create({ name: 'Majd', isHappy: false }), ]); -const isHappy = (person: Ember.Object): Boolean => { +const isHappy = (person: typeof Person3.prototype): boolean => { return !!person.get('isHappy'); }; people2.every(isHappy); people2.any(isHappy); -people2.everyProperty('isHappy', true); -people2.someProperty('isHappy', true); +people2.isEvery('isHappy', true); +people2.isAny('isHappy', true); +people2.isAny('isHappy'); // Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html -const promise = new Ember.RSVP.Promise((resolve: Function, reject: Function) => { +const promise = new Ember.RSVP.Promise((resolve: Function, reject: Function) => { // on success resolve('ok!'); @@ -174,6 +152,9 @@ promise.then( } ); +// make sure Ember.RSVP.Promise can be reference as a type +declare function promiseReturningFunction(urn: string): Ember.RSVP.Promise; + const mix1 = Ember.Mixin.create({ foo: 1, }); @@ -182,27 +163,7 @@ const mix2 = Ember.Mixin.create({ bar: 2, }); -const mix3 = Ember.Mixin.create({ - foo: 3, -}); - -const mix4 = Ember.Mixin.create({ - bar: 4, -}); - -const mix5 = Ember.Mixin.create({ - foo: 5, -}); - -const mix6 = Ember.Mixin.create({ - bar: 6, -}); - -const mix7 = Ember.Mixin.create({ - foo: 7, -}); - -const component1 = Ember.Component.extend(mix1, mix2, mix3, mix4, mix5, mix6, mix7, { +const component1 = Ember.Component.extend(mix1, mix2, { lyft: Ember.inject.service(), cars: Ember.computed.readOnly('lyft.cars'), }); diff --git a/types/ember/test/event.ts b/types/ember/test/event.ts new file mode 100755 index 0000000000..c934072440 --- /dev/null +++ b/types/ember/test/event.ts @@ -0,0 +1,58 @@ +import Ember from 'ember'; + +function testOn() { + let Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', function() { + console.log('Job completed!'); + }) + }); + + let job = Job.create(); + + Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' +} + +function testEvented() { + let Person = Ember.Object.extend(Ember.Evented, { + greet() { + this.trigger('greet'); + } + }); + + let person = Person.create(); + + person.on('greet', function() { + console.log('Our person has greeted'); + }); + + person.on('greet', function() { + console.log('Our person has greeted'); + }).one('greet', function() { + console.log('Offer one-time special'); + }).off('event', {}, function() {}); + + person.greet(); +} + +function testObserver() { + Ember.Object.extend({ + valueObserver: Ember.observer('value', function() { + // Executes whenever the "value" property changes + }) + }); +} + +function testListener() { + Ember.Component.extend({ + init() { + Ember.addListener(this, 'willDestroyElement', this, 'willDestroyListener'); + Ember.addListener(this, 'willDestroyElement', this, 'willDestroyListener', true); + Ember.addListener(this, 'willDestroyElement', this, this.willDestroyListener); + Ember.addListener(this, 'willDestroyElement', this, this.willDestroyListener, true); + Ember.removeListener(this, 'willDestroyElement', this, 'willDestroyListener'); + Ember.removeListener(this, 'willDestroyElement', this, this.willDestroyListener); + }, + willDestroyListener() { + } + }); +} diff --git a/types/ember/test/extend.ts b/types/ember/test/extend.ts new file mode 100755 index 0000000000..a54f81a600 --- /dev/null +++ b/types/ember/test/extend.ts @@ -0,0 +1,61 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const Person = Ember.Object.extend({ + firstName: '', + lastName: '', + + getFullName() { + return `${this.firstName} ${this.lastName}`; + }, + getFullName2(): string { + return `${this.get('firstName')} ${this.get('lastName')}`; + } +}); + +assertType(Person.prototype.firstName); +assertType<() => string>(Person.prototype.getFullName); + +const person = Person.create({ + firstName: 'Joe', + lastName: 'Blow', + extra: 42 +}); + +assertType(person.getFullName()); +assertType(person.extra); + +class ES6Person extends Ember.Object { + firstName: string; + lastName: string; + + get fullName() { + return `${this.firstName} ${this.lastName}`; + } + get fullName2(): string { + return `${this.get('firstName')} ${this.get('lastName')}`; + } +} + +assertType(ES6Person.prototype.firstName); +assertType(ES6Person.prototype.fullName); + +const es6Person = ES6Person.create({ + firstName: 'Joe', + lastName: 'Blow', + extra: 42 +}); + +assertType(es6Person.fullName); +assertType(es6Person.extra); + +class PersonWithStatics extends Ember.Object { + static isPerson = true; +} +const PersonWithStatics2 = PersonWithStatics.extend({}); +class PersonWithStatics3 extends PersonWithStatics {} +class PersonWithStatics4 extends PersonWithStatics2 {} +assertType(PersonWithStatics.isPerson); +assertType(PersonWithStatics2.isPerson); +assertType(PersonWithStatics3.isPerson); +assertType(PersonWithStatics4.isPerson); diff --git a/types/ember/test/function-ext.ts b/types/ember/test/function-ext.ts new file mode 100755 index 0000000000..37d831d49a --- /dev/null +++ b/types/ember/test/function-ext.ts @@ -0,0 +1,21 @@ +import Ember from 'ember'; + +declare global { + interface Function extends Ember.FunctionPrototypeExtensions {} +} + +Ember.Object.extend({ + foo: '', + + arr: function() { + return []; + }.property(), + + alias: function(this: any) { + return this.get('foo'); + }.property('foo', 'bar.@each.baz'), + + observer: function() {}.observes('foo', 'bar'), + + on: function() {}.on('foo', 'bar'), +}); diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts new file mode 100755 index 0000000000..efe3ce33d7 --- /dev/null +++ b/types/ember/test/helper.ts @@ -0,0 +1,27 @@ +import Ember from 'ember'; + +const FormatCurrencyHelper = Ember.Helper.helper(function(params, hash: { currency: string }) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; +}); + +class User extends Ember.Object { + email: string; +} + +class SessionService extends Ember.Service { + currentUser: User; +} + +const CurrentUserEmailHelper = Ember.Helper.extend({ + session: Ember.inject.service() as Ember.ComputedProperty, + onNewUser: Ember.observer('session.currentUser', function(this: Ember.Helper) { + this.recompute(); + }), + compute(): string { + return this.get('session') + .get('currentUser') + .get('email'); + }, +}); diff --git a/types/ember/test/inject.ts b/types/ember/test/inject.ts new file mode 100755 index 0000000000..dd628f6d2a --- /dev/null +++ b/types/ember/test/inject.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; + +class AuthService extends Ember.Service { + isAuthenticated: boolean; +} + +class ApplicationController extends Ember.Controller { + transitionToLogin() {} +} + +class LoginRoute extends Ember.Route { + auth = Ember.inject.service('authentication') as Ember.ComputedProperty; + application = Ember.inject.controller() as Ember.ComputedProperty; + + didTransition() { + if (!this.get('auth').get('isAuthenticated')) { + this.get('application').transitionToLogin(); + } + } +} diff --git a/types/ember/test/lib/assert.ts b/types/ember/test/lib/assert.ts new file mode 100755 index 0000000000..d6748cd5bc --- /dev/null +++ b/types/ember/test/lib/assert.ts @@ -0,0 +1,5 @@ +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): void; diff --git a/types/ember/test/mixin.ts b/types/ember/test/mixin.ts new file mode 100755 index 0000000000..2c417c00da --- /dev/null +++ b/types/ember/test/mixin.ts @@ -0,0 +1,46 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +interface EditableMixin { + edit(): void; + isEditing: boolean; +} + +const EditableMixin: Ember.Mixin = Ember.Mixin.create({ + edit() { + this.get('controller'); + console.log('starting to edit'); + this.set('isEditing', true); + }, + isEditing: false +}); + +const EditableComment = Ember.Route.extend(EditableMixin, { + postId: 0, + + canEdit() { + return !this.isEditing; + }, + + tryEdit() { + if (this.canEdit()) { + this.edit(); + } + } +}); + +const comment = EditableComment.create({ + postId: 42 +}); + +comment.edit(); +comment.canEdit(); +comment.tryEdit(); +assertType(comment.isEditing); +assertType(comment.postId); + +const LiteralMixins = Ember.Object.extend({ a: 1 }, { b: 2 }, { c: 3 }); +const obj = LiteralMixins.create(); +assertType(obj.a); +assertType(obj.b); +assertType(obj.c); diff --git a/types/ember/test/object.ts b/types/ember/test/object.ts new file mode 100755 index 0000000000..cfe2c9380f --- /dev/null +++ b/types/ember/test/object.ts @@ -0,0 +1,15 @@ +import Ember from 'ember'; + +const LifetimeHooks = Ember.Object.extend({ + resource: null as {} | null, + + init() { + this._super(); + this.resource = {}; + }, + + willDestroy() { + delete this.resource; + this._super(); + } +}); diff --git a/types/ember/test/observable.ts b/types/ember/test/observable.ts new file mode 100755 index 0000000000..680b6decf7 --- /dev/null +++ b/types/ember/test/observable.ts @@ -0,0 +1,88 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +class MyComponent extends Ember.Component { + foo = 'bar'; + + init() { + this._super.apply(this, arguments); + this.addObserver('foo', this, 'fooDidChange'); + this.addObserver('foo', this, this.fooDidChange); + Ember.addObserver(this, 'foo', this, 'fooDidChange'); + Ember.addObserver(this, 'foo', this, this.fooDidChange); + this.removeObserver('foo', this, 'fooDidChange'); + this.removeObserver('foo', this, this.fooDidChange); + Ember.removeObserver(this, 'foo', this, 'fooDidChange'); + Ember.removeObserver(this, 'foo', this, this.fooDidChange); + } + + fooDidChange(sender: MyComponent, key: 'foo') { + // your code + } +} + +const myComponent = MyComponent.create(); +myComponent.addObserver('foo', null, () => {}); +myComponent.set('foo', 'baz'); + +const person = Ember.Object.create({ + name: 'Fred', + age: 29, + capitalized: Ember.computed(function() { + return this.get('name').toUpperCase(); + }) +}); + +const pojo = { name: 'Fred', age: 29 }; + +function testGet() { + assertType(Ember.get(person, 'name')); + assertType(Ember.get(person, 'age')); + assertType(Ember.get(person, 'capitalized')); + assertType(person.get('name')); + assertType(person.get('age')); + assertType(person.get('capitalized')); + assertType(Ember.get(pojo, 'name')); +} + +function testGetProperties() { + assertType<{ name: string }>(Ember.getProperties(person, 'name')); + assertType<{ name: string, age: number }>(Ember.getProperties(person, 'name', 'age')); + assertType<{ name: string, age: number }>(Ember.getProperties(person, [ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(Ember.getProperties(person, 'name', 'age', 'capitalized')); + assertType<{ name: string }>(person.getProperties('name')); + assertType<{ name: string, age: number }>(person.getProperties('name', 'age')); + assertType<{ name: string, age: number }>(person.getProperties([ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(person.getProperties('name', 'age', 'capitalized')); + assertType<{ name: string, age: number }>(Ember.getProperties(pojo, 'name', 'age')); +} + +function testGetWithDefault() { + assertType(Ember.getWithDefault(person, 'name', 'Joe')); + assertType(Ember.getWithDefault(person, 'age', 20)); + assertType(Ember.getWithDefault(person, 'capitalized', 'JOE')); + assertType(person.getWithDefault('name', 'Joe')); + assertType(person.getWithDefault('age', 20)); + assertType(person.getWithDefault('capitalized', 'JOE')); + assertType(Ember.getWithDefault(pojo, 'name', 'JOE')); +} + +function testSet() { + assertType(Ember.set(person, 'name', 'Joe')); + assertType(Ember.set(person, 'age', 35)); + assertType(Ember.set(person, 'capitalized', 'JOE')); + assertType(person.set('name', 'Joe')); + assertType(person.set('age', 35)); + assertType(person.set('capitalized', 'JOE')); + assertType(Ember.set(pojo, 'name', 'Joe')); +} + +function testSetProperties() { + assertType<{ name: string }>(Ember.setProperties(person, { name: 'Joe' })); + assertType<{ name: string, age: number }>(Ember.setProperties(person, { name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(Ember.setProperties(person, { name: 'Joe', capitalized: 'JOE' })); + assertType<{ name: string }>(person.setProperties({ name: 'Joe' })); + assertType<{ name: string, age: number }>(person.setProperties({ name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(person.setProperties({ name: 'Joe', capitalized: 'JOE' })); + assertType<{ name: string, age: number }>(Ember.setProperties(pojo, { name: 'Joe', age: 35 })); +} diff --git a/types/ember/test/reopen.ts b/types/ember/test/reopen.ts new file mode 100755 index 0000000000..6c13ca4155 --- /dev/null +++ b/types/ember/test/reopen.ts @@ -0,0 +1,65 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +type Person = typeof Person.prototype; +const Person = Ember.Object.extend({ + name: '', + sayHello() { + alert(`Hello. My name is ${this.get('name')}`); + } +}); + +assertType(Person.reopen()); + +assertType(Person.create().name); +assertType(Person.create().sayHello()); + +const Person2 = Person.reopenClass({ + species: 'Homo sapiens', + + createPerson(name: string): Person { + return Person.create({ name }); + } +}); + +assertType(Person2.create().name); +assertType(Person2.create().sayHello()); +assertType(Person2.species); + +let tom = Person2.create({ + name: 'Tom Dale' +}); +let yehuda = Person2.createPerson('Yehuda Katz'); + +tom.sayHello(); // "Hello. My name is Tom Dale" +yehuda.sayHello(); // "Hello. My name is Yehuda Katz" +alert(Person2.species); // "Homo sapiens" + +const Person3 = Person2.reopen({ + goodbyeMessage: 'goodbye', + + sayGoodbye() { + alert(`${this.get('goodbyeMessage')}, ${this.get('name')}`); + } +}); + +const person3 = Person3.create(); +person3.get('name'); +person3.get('goodbyeMessage'); +person3.sayHello(); +person3.sayGoodbye(); + +interface AutoResizeMixin { resizable: true; } +declare const AutoResizeMixin: Ember.Mixin; + +const ResizableTextArea = Ember.TextArea.reopen(AutoResizeMixin, { + scaling: 1.0 +}); +const text = ResizableTextArea.create(); +assertType(text.resizable); +assertType(text.scaling); + +const Reopened = Ember.Object.reopenClass({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(Reopened.a); +assertType(Reopened.b); +assertType(Reopened.c); diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts new file mode 100755 index 0000000000..22193bd88d --- /dev/null +++ b/types/ember/test/route.ts @@ -0,0 +1,87 @@ +import Route from '@ember/routing/route'; +import Object from '@ember/object'; +import Array from '@ember/array'; +import Ember from 'ember'; // currently needed for Transition + +interface Post extends Ember.Object {} + +interface Posts extends Array {} + +Route.extend({ + beforeModel(transition: Ember.Transition) { + this.transitionTo('someOtherRoute'); + }, +}); + +Route.extend({ + afterModel(posts: Posts, transition: Ember.Transition) { + if (posts.length === 1) { + this.transitionTo('post.show', posts.firstObject); + } + }, +}); + +Route.extend({ + actions: { + showModal(evt: { modalName: string }) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application', + }); + }, + hideModal(evt: { modalName: string }) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application', + }); + }, + }, +}); + +Ember.Route.extend({ + model() { + return this.modelFor('post'); + }, +}); + +Route.extend({ + queryParams: { + memberQp: { refreshModel: true }, + }, +}); + +Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName', + }); + }, +}); + +Route.extend({ + renderTemplate(controller: Ember.Controller, model: {}) { + this.render('posts', { + view: 'someView', // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.into` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model, // the model to set on `options.controller`. + }); + }, +}); + +Route.extend({ + resetController(controller: Ember.Controller, isExiting: boolean, transition: boolean) { + if (isExiting) { + // controller.set('page', 1); + } + }, +}); + +Route.extend({ + setupController(controller: Ember.Controller, model: {}) { + this._super(controller, model); + this.controllerFor('application').set('model', model); + }, +}); diff --git a/types/ember/test/router.ts b/types/ember/test/router.ts new file mode 100755 index 0000000000..a4aa89af1a --- /dev/null +++ b/types/ember/test/router.ts @@ -0,0 +1,23 @@ +import Ember from 'ember'; + +const AppRouter = Ember.Router.extend({ +}); + +AppRouter.map(function() { + this.route('index', { path: '/' }); + this.route('about'); + this.route('favorites', { path: '/favs' }); + this.route('posts', function() { + this.route('index', { path: '/' }); + this.route('new'); + this.route('post', { path: '/post/:post_id', resetNamespace: true }); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + this.route('photo', { path: '/photo/:id' }, function() { + this.route('comment', { path: '/comment/:id' }); + }); + this.route('not-found', { path: '/*path' }); + this.mount('my-engine'); +}); diff --git a/types/ember/test/run.ts b/types/ember/test/run.ts new file mode 100755 index 0000000000..8d1c82e6e3 --- /dev/null +++ b/types/ember/test/run.ts @@ -0,0 +1,204 @@ +import Ember from 'ember'; +import RSVP from 'rsvp'; +import { run } from '@ember/runloop'; +import { assertType } from "./lib/assert"; + +assertType(Ember.run.queues); + +function testRun() { + let r = run(function() { + // code to be executed within a RunLoop + return 123; + }); + assertType(r); + + function destroyApp(application: Ember.Application) { + Ember.run(application, 'destroy'); + run(application, function() { + this.destroy(); + }); + } +} + +function testBind() { + Ember.Component.extend({ + init() { + const bound = Ember.run.bind(this, this.setupEditor); + bound(); + }, + + editor: null as string | null, + + setupEditor(editor: string) { + this.set('editor', editor); + } + }); +} + +function testCancel() { + const myContext = {}; + + let runNext = run.next(myContext, function() { + // will not be executed + }); + + run.cancel(runNext); + + let runLater = run.later(myContext, function() { + // will not be executed + }, 500); + + run.cancel(runLater); + + let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + let runOnce = run.once(myContext, function() { + // will not be executed + }); + + run.cancel(runOnce); + + let throttle = run.throttle(myContext, function() { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + let debounce = run.debounce(myContext, function() { + // will not be executed + }, 1); + + run.cancel(debounce); + + let debounceImmediate = run.debounce(myContext, function() { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be canceled + run.cancel(debounceImmediate); +} + +function testDebounce() { + function runIt() { + } + + let myContext = { name: 'debounce' }; + + run.debounce(runIt, 150); + run.debounce(myContext, runIt, 150); + run.debounce(myContext, runIt, 150, true); + + Ember.Component.extend({ + searchValue: 'test', + fetchResults(value: string) {}, + + actions: { + handleTyping() { + // the fetchResults function is passed into the component from its parent + Ember.run.debounce(this, this.get('fetchResults'), this.get('searchValue'), 250); + } + } + }); +} + +function testBegin() { + run.begin(); + // code to be executed within a RunLoop + run.end(); +} + +function testJoin() { + run.join(function() { + // creates a new run-loop + }); + + run(function() { + // creates a new run-loop + run.join(function() { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. + }); + }); + + new RSVP.Promise(function(resolve) { + Ember.run.later(function() { + resolve({ msg: 'Hold Your Horses' }); + }, 3000); + }); +} + +function testLater() { + const myContext = {}; + run.later(myContext, function() { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); +} + +function testNext() { + const myContext = {}; + run.next(myContext, function() { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); +} + +function testOnce() { + Ember.Component.extend({ + init() { + Ember.run.once(this, 'processFullName'); + }, + + processFullName() { + } + }); +} + +function testSchedule() { + Ember.Component.extend({ + init() { + run.schedule('sync', this, function() { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, function() { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + } + }); + + Ember.run.schedule('actions', () => { + // Do more things + }); +} + +function testScheduleOnce() { + function sayHi() { + console.log('hi'); + } + + const myContext = {}; + run(function() { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + run.scheduleOnce('actions', myContext, function() { + console.log('Closure'); + }); +} + +function testThrottle() { + function runIt() { + } + + let myContext = { name: 'throttle' }; + + run.throttle(runIt, 150); + run.throttle(myContext, runIt, 150); +} diff --git a/types/ember/test/test.ts b/types/ember/test/test.ts new file mode 100755 index 0000000000..6cd1b2b908 --- /dev/null +++ b/types/ember/test/test.ts @@ -0,0 +1,32 @@ +import Ember from 'ember'; + +let pending = 0; +Ember.Test.registerWaiter(() => pending !== 0); + +declare const MyDb: { + hasPendingTransactions(): boolean; +}; +Ember.Test.registerWaiter(MyDb, MyDb.hasPendingTransactions); + +Ember.Test.promise(function(resolve) { + window.setTimeout(resolve, 500); +}); + +Ember.Test.registerHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); +}); + +Ember.Test.registerAsyncHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); +}); + +Ember.Test.registerAsyncHelper('waitForPromise', (app, promise) => { + return new Ember.Test.Promise((resolve) => { + Ember.Test.adapter.asyncStart(); + + promise.then(() => { + Ember.run.schedule('afterRender', null, resolve); + Ember.Test.adapter.asyncEnd(); + }); + }); +}); diff --git a/types/ember/test/transition.ts b/types/ember/test/transition.ts new file mode 100755 index 0000000000..3a64675c24 --- /dev/null +++ b/types/ember/test/transition.ts @@ -0,0 +1,28 @@ +import Ember from 'ember'; + +Ember.Route.extend({ + beforeModel(transition: Ember.Transition) { + if (new Date() > new Date('January 1, 1980')) { + alert('Sorry, you need a time machine to enter this route.'); + transition.abort(); + } + } +}); + +Ember.Controller.extend({ + previousTransition: null, + + actions: { + login() { + // Log the user in, then reattempt previous transition if it exists. + let previousTransition = this.get('previousTransition'); + if (previousTransition) { + this.set('previousTransition', null); + previousTransition.retry(); + } else { + // Default back to homepage + this.transitionToRoute('index'); + } + } + } +}); diff --git a/types/ember/test/utils.ts b/types/ember/test/utils.ts new file mode 100755 index 0000000000..d729d472b8 --- /dev/null +++ b/types/ember/test/utils.ts @@ -0,0 +1,71 @@ +import Ember from 'ember'; +import * as utils from '@ember/utils'; +import { assertType } from "./lib/assert"; + +function testIsNoneType() { + const maybeUndefined: string | undefined = 'not actually undefined'; + if (utils.isNone(maybeUndefined)) { + return; + } + + const anotherString = maybeUndefined + 'another string'; +} + +function testMerge() { + assertType<{ first: string, last: string }>( + Ember.merge({ first: 'Tom' }, { last: 'Dale' }) + ); +} + +function testAssign() { + assertType<{ first: string, middle: string, last: string }>( + Ember.assign({ first: 'Tom' }, { middle: 'M' }, { last: 'Dale' }) + ); +} + +function testOnError() { + Ember.onerror = function(error) { + Ember.$.post('/report-error', { + stack: error.stack, + otherInformation: 'whatever app state you want to provide' + }); + }; +} + +function testMakeArray() { + assertType(Ember.makeArray()); + assertType(Ember.makeArray(null)); + assertType(Ember.makeArray(undefined)); + assertType(Ember.makeArray('lindsay')); + assertType(Ember.makeArray([1, 2, 42])); +} + +function testDeprecateFunc() { + function newMethod(first: string, second: number): string { + return ''; + } + + let oldMethod = Ember.deprecateFunc('Please use the new method', { id: 'deprecated.id', until: '6.0' }, newMethod); + assertType(newMethod('first', 123)); + assertType(oldMethod('first', 123)); +} + +function testDefineProperty() { + const contact = {}; + + // ES5 compatible mode + Ember.defineProperty(contact, 'firstName', { + writable: true, + configurable: false, + enumerable: true, + value: 'Charles' + }); + + // define a simple property + Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); + + // define a computed property + Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + })); +} diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json old mode 100644 new mode 100755 index b73838d20e..c0aab2e780 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -1,23 +1,49 @@ { "compilerOptions": { "module": "commonjs", + "target": "es5", "lib": [ "es6", "dom" ], "noImplicitAny": true, - "noImplicitThis": false, + "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "ember-tests.ts" + "test/lib/assert.ts", + "test/application.ts", + "test/ember-tests.ts", + "test/event.ts", + "test/extend.ts", + "test/create.ts", + "test/object.ts", + "test/observable.ts", + "test/mixin.ts", + "test/reopen.ts", + "test/detect.ts", + "test/detect-instance.ts", + "test/array.ts", + "test/array-ext.ts", + "test/array-proxy.ts", + "test/helper.ts", + "test/computed.ts", + "test/component.ts", + "test/function-ext.ts", + "test/inject.ts", + "test/utils.ts", + "test/transition.ts", + "test/router.ts", + "test/run.ts", + "test/test.ts", + "test/controller.ts", + "test/route.ts" ] } diff --git a/types/ember/tslint.json b/types/ember/tslint.json old mode 100644 new mode 100755 index 309f39a5d1..78e2a5a753 --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -4,11 +4,24 @@ // Heavy use of Function type in this older package. "ban-types": false, "jsdoc-format": false, - "no-any-union": false, "no-misused-new": false, - // not sure what this means + + // these are disabled because of rfc176 module exports + "strict-export-declare-modifiers": false, "no-single-declare-module": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false + "no-declare-current-package": false, + "no-self-import": false, + + // We use interfaces in a number of places to express things (including + // mixins in particular, but also including extending a global + // interface) which TS currently can't express correctly. + "no-empty-interface": false, + + "no-duplicate-imports": false, + "no-unnecessary-qualifier": false, + "prefer-const": false, + "no-void-expression": false, + "only-arrow-functions": false, + "no-submodule-imports": false } } diff --git a/types/ember/v1/tsconfig.json b/types/ember/v1/tsconfig.json index a03fae9fbe..7be1f0660b 100644 --- a/types/ember/v1/tsconfig.json +++ b/types/ember/v1/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/types/emissary/tsconfig.json b/types/emissary/tsconfig.json index 99a5433b1e..b6d04f07a7 100644 --- a/types/emissary/tsconfig.json +++ b/types/emissary/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/emojione/tsconfig.json b/types/emojione/tsconfig.json index a772ceb6dd..f74fb50d6f 100644 --- a/types/emojione/tsconfig.json +++ b/types/emojione/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/empower/tsconfig.json b/types/empower/tsconfig.json index 25ea756fdd..9d9d553fc0 100644 --- a/types/empower/tsconfig.json +++ b/types/empower/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/emscripten/tsconfig.json b/types/emscripten/tsconfig.json index d12d0b996a..d17ea9a00a 100644 --- a/types/emscripten/tsconfig.json +++ b/types/emscripten/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/encoding-japanese/tsconfig.json b/types/encoding-japanese/tsconfig.json index f3e5ea83dd..b3b7a2861f 100644 --- a/types/encoding-japanese/tsconfig.json +++ b/types/encoding-japanese/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/end-of-stream/tsconfig.json b/types/end-of-stream/tsconfig.json index 4f06f62e73..b46ee0c768 100644 --- a/types/end-of-stream/tsconfig.json +++ b/types/end-of-stream/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "end-of-stream-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/engine.io-client/tsconfig.json b/types/engine.io-client/tsconfig.json index e98b3db085..cb3a024a3e 100644 --- a/types/engine.io-client/tsconfig.json +++ b/types/engine.io-client/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "engine.io-client-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/engine.io/tsconfig.json b/types/engine.io/tsconfig.json index b003e2f8e4..b31b3394b0 100644 --- a/types/engine.io/tsconfig.json +++ b/types/engine.io/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "engine.io-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/enhanced-resolve/tsconfig.json b/types/enhanced-resolve/tsconfig.json index 23f724b261..9c87f7e7a1 100644 --- a/types/enhanced-resolve/tsconfig.json +++ b/types/enhanced-resolve/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ent/tsconfig.json b/types/ent/tsconfig.json index 4c9289ae86..53249c7605 100644 --- a/types/ent/tsconfig.json +++ b/types/ent/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/entities/tsconfig.json b/types/entities/tsconfig.json index 7a68bc361b..1a88ad9778 100644 --- a/types/entities/tsconfig.json +++ b/types/entities/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "entities-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/env-to-object/tsconfig.json b/types/env-to-object/tsconfig.json index 316a2acdf6..2e59eff3e4 100644 --- a/types/env-to-object/tsconfig.json +++ b/types/env-to-object/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/envify/tsconfig.json b/types/envify/tsconfig.json index a3f80b63ec..381ca464c9 100644 --- a/types/envify/tsconfig.json +++ b/types/envify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts new file mode 100644 index 0000000000..9be474c2d8 --- /dev/null +++ b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts @@ -0,0 +1,4 @@ +import { configure } from 'enzyme'; +import * as Adapter from 'enzyme-adapter-react-15'; + +configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-15/index.d.ts b/types/enzyme-adapter-react-15/index.d.ts new file mode 100644 index 0000000000..b0b289d08d --- /dev/null +++ b/types/enzyme-adapter-react-15/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for enzyme-adapter-react-15 1.0 +// Project: https://github.com/airbnb/enzyme +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EnzymeAdapter } from 'enzyme'; + +declare class ReactFifteenAdapter extends EnzymeAdapter { +} + +declare namespace ReactFifteenAdapter { +} + +export = ReactFifteenAdapter; diff --git a/types/enzyme-adapter-react-15/tsconfig.json b/types/enzyme-adapter-react-15/tsconfig.json new file mode 100644 index 0000000000..23f0d0d292 --- /dev/null +++ b/types/enzyme-adapter-react-15/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-15-tests.ts" + ] +} diff --git a/types/enzyme-adapter-react-15/tslint.json b/types/enzyme-adapter-react-15/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/enzyme-adapter-react-15/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts new file mode 100644 index 0000000000..b8acf7f719 --- /dev/null +++ b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts @@ -0,0 +1,4 @@ +import { configure } from 'enzyme'; +import * as Adapter from 'enzyme-adapter-react-16'; + +configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-16/index.d.ts b/types/enzyme-adapter-react-16/index.d.ts new file mode 100644 index 0000000000..39aa6c03a6 --- /dev/null +++ b/types/enzyme-adapter-react-16/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for enzyme-adapter-react-16 1.0 +// Project: https://github.com/airbnb/enzyme +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EnzymeAdapter } from 'enzyme'; + +declare class ReactSixteenAdapter extends EnzymeAdapter { +} + +declare namespace ReactSixteenAdapter { +} + +export = ReactSixteenAdapter; diff --git a/types/enzyme-adapter-react-16/tsconfig.json b/types/enzyme-adapter-react-16/tsconfig.json new file mode 100644 index 0000000000..1c1c8e15f9 --- /dev/null +++ b/types/enzyme-adapter-react-16/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-16-tests.ts" + ] +} diff --git a/types/enzyme-adapter-react-16/tslint.json b/types/enzyme-adapter-react-16/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/enzyme-adapter-react-16/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/enzyme-to-json/tsconfig.json b/types/enzyme-to-json/tsconfig.json index 257f8797e0..948a88349a 100644 --- a/types/enzyme-to-json/tsconfig.json +++ b/types/enzyme-to-json/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ @@ -21,4 +22,4 @@ "index.d.ts", "enzyme-to-json-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 4087c539a7..63e716c50b 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -109,6 +109,10 @@ function ShallowWrapperTest() { const diveWrapper: ShallowWrapper = shallowWrapper.dive({ context: { foobar: 'barfoo' } }); } + function test_hostNodes() { + shallowWrapper.hostNodes(); + } + function test_equals() { boolVal = shallowWrapper.equals(
); } @@ -206,6 +210,14 @@ function ShallowWrapperTest() { reactElements = shallowWrapper.getNodes(); } + function test_getElement() { + reactElement = shallowWrapper.getElement(); + } + + function test_getElements() { + reactElements = shallowWrapper.getElements(); + } + function test_getDOMNode() { domElement = shallowWrapper.getDOMNode(); } @@ -417,6 +429,10 @@ function ReactWrapperTest() { reactWrapper.detach(); } + function test_hostNodes() { + reactWrapper.hostNodes(); + } + function test_find() { elementWrapper = reactWrapper.find('.selector'); reactWrapper = reactWrapper.find(MyComponent); @@ -545,6 +561,14 @@ function ReactWrapperTest() { reactElements = reactWrapper.getNodes(); } + function test_getElement() { + reactElement = reactWrapper.getElement(); + } + + function test_getElements() { + reactElements = reactWrapper.getElements(); + } + function test_getDOMNode() { domElement = reactWrapper.getDOMNode(); } diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index c2f99f3d19..cb5caa4f3c 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Enzyme 2.8 +// Type definitions for Enzyme 3.1 // Project: https://github.com/airbnb/enzyme // Definitions by: Marian Palkus // Cap3 @@ -148,6 +148,16 @@ export interface CommonWrapper

{ */ getNodes(): Array>; + /** + * Returns the wrapper's underlying node. + */ + getElement(): ReactElement; + + /** + * Returns the wrapper's underlying node. + */ + getElements(): Array>; + /** * Returns the outer most DOMComponent of the current wrapper. */ @@ -422,6 +432,14 @@ export interface ShallowWrapper

extends CommonWrapper { */ dive(options?: ShallowRendererProps): ShallowWrapper; + /** + * Strips out all the not host-nodes from the list of nodes + * + * This method is useful if you want to check for the presence of host nodes + * (actually rendered HTML elements) ignoring the React nodes. + */ + hostNodes(): ShallowWrapper; + /** * Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. @@ -480,6 +498,14 @@ export interface ReactWrapper

extends CommonWrapper { */ detach(): void; + /** + * Strips out all the not host-nodes from the list of nodes + * + * This method is useful if you want to check for the presence of host nodes + * (actually rendered HTML elements) ignoring the React nodes. + */ + hostNodes(): ReactWrapper; + /** * Find every node in the render tree that matches the provided selector. * @param selector The selector to match. @@ -613,9 +639,13 @@ export function mount(node: ReactElement

, options?: MountRendererProps) */ export function render(node: ReactElement

, options?: any): Cheerio; +// See https://github.com/airbnb/enzyme/blob/v3.1.0/packages/enzyme/src/EnzymeAdapter.js +export class EnzymeAdapter { +} + /** * Configure enzyme to use the correct adapter for the react verstion * This is enabling the Enzyme configuration with adapters in TS * @param options */ -export function configure(options: { adapter: any }): void; +export function configure(options: { adapter: EnzymeAdapter }): void; diff --git a/types/enzyme/tsconfig.json b/types/enzyme/tsconfig.json index 83f549d65c..096b64a111 100644 --- a/types/enzyme/tsconfig.json +++ b/types/enzyme/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ diff --git a/types/eonasdan-bootstrap-datetimepicker/tsconfig.json b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json index 2f6f00a099..d2f659f25f 100644 --- a/types/eonasdan-bootstrap-datetimepicker/tsconfig.json +++ b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/epiceditor/tsconfig.json b/types/epiceditor/tsconfig.json index 410f7bee8d..ccd9f7cce0 100644 --- a/types/epiceditor/tsconfig.json +++ b/types/epiceditor/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/epub/tsconfig.json b/types/epub/tsconfig.json index 9a409c3ae1..90ba263b21 100644 --- a/types/epub/tsconfig.json +++ b/types/epub/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/eq.js/tsconfig.json b/types/eq.js/tsconfig.json index 6cd21718b8..3d35e3fefa 100644 --- a/types/eq.js/tsconfig.json +++ b/types/eq.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/error-stack-parser/tsconfig.json b/types/error-stack-parser/tsconfig.json index 11e1863b89..98f3beb1a5 100644 --- a/types/error-stack-parser/tsconfig.json +++ b/types/error-stack-parser/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/errorhandler/tsconfig.json b/types/errorhandler/tsconfig.json index fd9a3b1665..dc08f31d21 100644 --- a/types/errorhandler/tsconfig.json +++ b/types/errorhandler/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/es6-collections/tsconfig.json b/types/es6-collections/tsconfig.json index b09ee9b48b..c2b2ba64d7 100644 --- a/types/es6-collections/tsconfig.json +++ b/types/es6-collections/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/es6-error/tsconfig.json b/types/es6-error/tsconfig.json index f0becf44db..1205819cd3 100644 --- a/types/es6-error/tsconfig.json +++ b/types/es6-error/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/es6-promise/tsconfig.json b/types/es6-promise/tsconfig.json index bc50e7c4fb..8b3cc9da2a 100644 --- a/types/es6-promise/tsconfig.json +++ b/types/es6-promise/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/es6-promisify/tsconfig.json b/types/es6-promisify/tsconfig.json index d28d909997..707e6094d3 100644 --- a/types/es6-promisify/tsconfig.json +++ b/types/es6-promisify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "es6-promisify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/es6-shim/tsconfig.json b/types/es6-shim/tsconfig.json index 02c35aee5a..f11dcede04 100644 --- a/types/es6-shim/tsconfig.json +++ b/types/es6-shim/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "es6-shim-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/es6-weak-map/tsconfig.json b/types/es6-weak-map/tsconfig.json index 4a80116224..2652a8f513 100644 --- a/types/es6-weak-map/tsconfig.json +++ b/types/es6-weak-map/tsconfig.json @@ -1,4 +1,3 @@ - { "compilerOptions": { "module": "commonjs", @@ -8,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +20,4 @@ "index.d.ts", "es6-weak-map-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/escape-html/tsconfig.json b/types/escape-html/tsconfig.json index 7c08568a1e..336fcb1583 100644 --- a/types/escape-html/tsconfig.json +++ b/types/escape-html/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/escape-latex/tsconfig.json b/types/escape-latex/tsconfig.json index 8a925ce6a2..2c782b99a5 100644 --- a/types/escape-latex/tsconfig.json +++ b/types/escape-latex/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/escape-string-regexp/tsconfig.json b/types/escape-string-regexp/tsconfig.json index 9017be036c..46d2b8fec7 100644 --- a/types/escape-string-regexp/tsconfig.json +++ b/types/escape-string-regexp/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/escodegen/tsconfig.json b/types/escodegen/tsconfig.json index 7df2dba0cf..4755f2604a 100644 --- a/types/escodegen/tsconfig.json +++ b/types/escodegen/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/eslint-plugin-prettier/tsconfig.json b/types/eslint-plugin-prettier/tsconfig.json index 17f2f98666..67ba3c86f6 100644 --- a/types/eslint-plugin-prettier/tsconfig.json +++ b/types/eslint-plugin-prettier/tsconfig.json @@ -1,15 +1,23 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": ["index.d.ts", "eslint-plugin-prettier-tests.ts"] -} + "files": [ + "index.d.ts", + "eslint-plugin-prettier-tests.ts" + ] +} \ No newline at end of file diff --git a/types/esprima-walk/tsconfig.json b/types/esprima-walk/tsconfig.json index f91f558c64..7314e2d509 100644 --- a/types/esprima-walk/tsconfig.json +++ b/types/esprima-walk/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/esprima/tsconfig.json b/types/esprima/tsconfig.json index e70c3e04a4..2ac3b4bb46 100644 --- a/types/esprima/tsconfig.json +++ b/types/esprima/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/esprima/v2/tsconfig.json b/types/esprima/v2/tsconfig.json index 7de8cc1403..a3c195ca3c 100644 --- a/types/esprima/v2/tsconfig.json +++ b/types/esprima/v2/tsconfig.json @@ -1,27 +1,28 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "paths": { - "esprima": [ - "esprima/v2" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "esprima": [ + "esprima/v2" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true }, - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "esprima-tests.ts" - ] + "files": [ + "index.d.ts", + "esprima-tests.ts" + ] } \ No newline at end of file diff --git a/types/esri-leaflet-geocoder/tsconfig.json b/types/esri-leaflet-geocoder/tsconfig.json index d42bd2b388..6bdfac4c4d 100644 --- a/types/esri-leaflet-geocoder/tsconfig.json +++ b/types/esri-leaflet-geocoder/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "esri-leaflet-geocoder-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/esri-leaflet/tsconfig.json b/types/esri-leaflet/tsconfig.json index f342a7b92c..596c74f0a2 100644 --- a/types/esri-leaflet/tsconfig.json +++ b/types/esri-leaflet/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "esri-leaflet-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/estraverse/tsconfig.json b/types/estraverse/tsconfig.json index 45cfe5301c..0a199a8857 100644 --- a/types/estraverse/tsconfig.json +++ b/types/estraverse/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/estree/index.d.ts b/types/estree/index.d.ts index 23c5b19f86..068cbfd8ce 100644 --- a/types/estree/index.d.ts +++ b/types/estree/index.d.ts @@ -21,23 +21,28 @@ // but it has the notable advantage of making ESTree much easier to use as // an end user. -interface BaseNode { +interface BaseNodeWithoutComments { // Every leaf interface that extends BaseNode must specify a type property. // The type property should be a string literal. For example, Identifier // has: `type: "Identifier"` - - leadingComments?: Array; - trailingComments?: Array; + type: string; loc?: SourceLocation | null; range?: [number, number]; } + +interface BaseNode extends BaseNodeWithoutComments { + leadingComments?: Array; + trailingComments?: Array; +} + export type Node = Identifier | Literal | Program | Function | SwitchCase | CatchClause | VariableDeclarator | Statement | Expression | Property | AssignmentProperty | Super | TemplateElement | SpreadElement | Pattern | ClassBody | Class | MethodDefinition | ModuleDeclaration | ModuleSpecifier; -export interface Comment { +export interface Comment extends BaseNodeWithoutComments { + type: "Line" | "Block"; value: string; } @@ -74,13 +79,13 @@ interface BaseFunction extends BaseNode { export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression; - export type Statement = ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration; + interface BaseStatement extends BaseNode { } export interface EmptyStatement extends BaseStatement { @@ -186,6 +191,7 @@ export interface DebuggerStatement extends BaseStatement { export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration; + interface BaseDeclaration extends BaseStatement { } export interface FunctionDeclaration extends BaseFunction, BaseDeclaration { @@ -214,6 +220,7 @@ type Expression = CallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression; + export interface BaseExpression extends BaseNode { } export interface ThisExpression extends BaseExpression { @@ -254,7 +261,7 @@ export interface SequenceExpression extends BaseExpression { export interface UnaryExpression extends BaseExpression { type: "UnaryExpression"; operator: UnaryOperator; - prefix: boolean; + prefix: true; argument: Expression; } @@ -317,6 +324,7 @@ export interface MemberExpression extends BaseExpression, BasePattern { export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression; + interface BasePattern extends BaseNode { } export interface SwitchCase extends BaseNode { @@ -341,17 +349,17 @@ export type Literal = SimpleLiteral | RegExpLiteral; export interface SimpleLiteral extends BaseNode, BaseExpression { type: "Literal"; value: string | boolean | number | null; - raw: string; + raw?: string; } export interface RegExpLiteral extends BaseNode, BaseExpression { type: "Literal"; - value: RegExp; + value?: RegExp | null; regex: { pattern: string; flags: string; }; - raw: string; + raw?: string; } export type UnaryOperator = diff --git a/types/estree/tsconfig.json b/types/estree/tsconfig.json index cdee8b7fa3..9e10c93348 100644 --- a/types/estree/tsconfig.json +++ b/types/estree/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/etag/tsconfig.json b/types/etag/tsconfig.json index e79f28c8be..5df46bdfe9 100644 --- a/types/etag/tsconfig.json +++ b/types/etag/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "etag-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ethjs-signer/tsconfig.json b/types/ethjs-signer/tsconfig.json index 202b9ca11a..b9548b9847 100644 --- a/types/ethjs-signer/tsconfig.json +++ b/types/ethjs-signer/tsconfig.json @@ -7,11 +7,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], - "types": [ ], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/eureka-js-client/tsconfig.json b/types/eureka-js-client/tsconfig.json index 5cb950ba75..8a981b029d 100644 --- a/types/eureka-js-client/tsconfig.json +++ b/types/eureka-js-client/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/evaporate/tsconfig.json b/types/evaporate/tsconfig.json index d0668e49d9..9164730455 100644 --- a/types/evaporate/tsconfig.json +++ b/types/evaporate/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/event-emitter/tsconfig.json b/types/event-emitter/tsconfig.json index 7b8352ee4d..ef667ae292 100644 --- a/types/event-emitter/tsconfig.json +++ b/types/event-emitter/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -23,4 +24,4 @@ "unify.d.ts", "event-emitter-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/event-kit/README.md b/types/event-kit/README.md new file mode 100644 index 0000000000..90835ef13e --- /dev/null +++ b/types/event-kit/README.md @@ -0,0 +1,22 @@ +## Event Kit Type Definitions + +TypeScript type definitions for [event-kit](https://github.com/atom/event-kit), which is published [under the same name](https://www.npmjs.com/package/event-kit) on NPM. + +### Usage Notes + +#### Exports + +The three classes exported from this module are: [CompositeDisposable](https://github.com/atom/event-kit/blob/master/src/composite-disposable.coffee), [Disposable](https://github.com/atom/event-kit/blob/master/src/disposable.coffee), and [Emitter](https://github.com/atom/event-kit/blob/master/src/emitter.coffee). + +```ts +import { CompositeDisposable, Disposable, Emitter } from "event-kit"; +let subscriptions = new CompositeDisposable(); +``` + +#### The EventKit Namespace + +All types used by "event-kit" can be referenced from the EventKit namespace. + +```ts +function example(disposable: EventKit.DisposableLike) {} +``` diff --git a/types/event-kit/event-kit-tests.ts b/types/event-kit/event-kit-tests.ts index 4b4a0d4e7c..0cc6028fd6 100644 --- a/types/event-kit/event-kit-tests.ts +++ b/types/event-kit/event-kit-tests.ts @@ -1,57 +1,83 @@ - - import { Disposable, CompositeDisposable, Emitter } from "event-kit"; -// Emitter +declare let bool: boolean; +declare let subscription: EventKit.Disposable; +declare let subscriptions: EventKit.CompositeDisposable; +declare let emitter: EventKit.Emitter; +// NPM Usage Tests ============================================================ class User { - private emitter: Emitter; + private readonly emitter: EventKit.Emitter; name: string; constructor() { this.emitter = new Emitter(); } - onDidChangeName(callback: (name: string) => void): Disposable { - return this.emitter.on('did-change-name', callback); + onDidChangeName(callback: (value: string) => void) { + return this.emitter.on("did-change-name", callback); } - setName(name: string): void { - if (this.name != name) { + setName(name: string) { + if (name !== this.name) { this.name = name; - this.emitter.emit('did-change-name', name); + this.emitter.emit("did-change-name", name); } + return name; } - destroy(): void { - this.emitter.clear(); + destroy() { this.emitter.dispose(); } } -// Disposable - -var disposable = new Disposable(() => { - // cleanup -}); -disposable.dispose(); - -var user = new User(); -var subscription = user.onDidChangeName((name: string) => { - console.log('User name change to: ' + name); -}); -if(Disposable.isDisposable(subscription)) {} +const user = new User(); +subscription = user.onDidChangeName(name => console.log("My name is #{name}")); subscription.dispose(); -// CompositeDisposable +// Disposable ================================================================= +bool = subscription.disposed; +if (subscription.disposalAction) subscription.disposalAction(); +subscription.dispose(); + +// CompositeDisposable ======================================================== +// Properties +bool = subscriptions.disposed; + +// Construction and Lifecycle +subscriptions = new CompositeDisposable(); +new CompositeDisposable(subscription); +new CompositeDisposable(subscription, subscription); +new CompositeDisposable({ dispose() {} }); -var subscriptions = new CompositeDisposable(); -subscriptions.add( - user.onDidChangeName((name: string) => { - console.log('subscriber #1'); - }), - user.onDidChangeName((name: string) => { - console.log('subscriber #2'); - }) -); subscriptions.dispose(); + +// Managing Disposables +subscriptions.add(subscription); +subscriptions.add( + subscription, + { dispose() {} } +); + +subscriptions.remove(subscription); +subscriptions.remove({ dispose() {} }); + +subscriptions.delete(subscription); +subscriptions.delete({ dispose() {} }); + +subscriptions.clear(); + +// Emitter ==================================================================== +bool = emitter.disposed; + +emitter.clear(); +emitter.dispose(); + +// Event Subscription +subscription = emitter.on("test-event", value => {}); +emitter.once("test-event", value => {}); +subscription = emitter.preempt("test-event", value => {}); + +// Event Emission +emitter.emit("test-event"); +emitter.emit("test-event", 42); diff --git a/types/event-kit/index.d.ts b/types/event-kit/index.d.ts index 74f270c40f..0df33472b1 100644 --- a/types/event-kit/index.d.ts +++ b/types/event-kit/index.d.ts @@ -1,91 +1,130 @@ -// Type definitions for event-kit v1.2.0 +// Type definitions for event-kit 2.x // Project: https://github.com/atom/event-kit -// Definitions by: Vadim Macagon +// Definitions by: GlenCFL // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -export = AtomEventKit; +declare global { + namespace EventKit { + /** The static side to each exported class. Should generally only be used internally. */ + namespace Statics { + /* tslint:disable:no-unnecessary-qualifier */ + /** The static side to the Disposable class. */ + interface Disposable { + /** Ensure that Object correctly implements the Disposable contract. */ + isDisposable(object: object): boolean; -declare namespace AtomEventKit { - interface IDisposable { - dispose(): void; + /** Construct a Disposable. */ + new (disposableAction?: () => void): EventKit.Disposable; + } + + /** The static side to the CompositeDisposable class. */ + interface CompositeDisposable { + /** Construct an instance, optionally with one or more disposables. */ + new (...disposables: DisposableLike[]): EventKit.CompositeDisposable; + } + + /** The static side to the Emitter class. */ + interface Emitter { + /** Construct an emitter. */ + new (): EventKit.Emitter; + } + /* tslint:enable:no-unnecessary-qualifier */ + } + + interface DisposableLike { + dispose(): void; + } + + /** A handle to a resource that can be disposed. */ + interface Disposable extends DisposableLike { + disposed: boolean; + + /** A callback which will be called within dispose(). */ + disposalAction?(): void; + + /** Perform the disposal action, indicating that the resource associated + * with this disposable is no longer needed. + */ + dispose(): void; + } + + /** An object that aggregates multiple Disposable instances together into a + * single disposable, so they can all be disposed as a group. + */ + interface CompositeDisposable extends DisposableLike { + disposed: boolean; + + /** Dispose all disposables added to this composite disposable. + * If this object has already been disposed, this method has no effect. + */ + dispose(): void; + + // Managing Disposables + /** Add disposables to be disposed when the composite is disposed. + * If this object has already been disposed, this method has no effect. + */ + add(...disposables: DisposableLike[]): void; + + /** Remove a previously added disposable. */ + remove(disposable: DisposableLike): void; + + /** Alias to CompositeDisposable::remove. */ + delete(disposable: DisposableLike): void; + + /** Clear all disposables. They will not be disposed by the next call to + * dispose. + */ + clear(): void; + } + + /** Utility class to be used when implementing event-based APIs that allows + * for handlers registered via ::on to be invoked with calls to ::emit. + */ + interface Emitter extends DisposableLike { + disposed: boolean; + + /** Clear out any existing subscribers. */ + clear(): void; + + /** Unsubscribe all handlers. */ + dispose(): boolean; + + // Event Subscription + /** Registers a handler to be invoked whenever the given event is emitted. */ + // tslint:disable-next-line:no-any + on(eventName: string, handler: (value: any) => void): Disposable; + + /** Register the given handler function to be invoked the next time an event + * with the given name is emitted via ::emit. + */ + // tslint:disable-next-line:no-any + once(eventName: string, handler: (value: any) => void): Disposable; + + /** Register the given handler function to be invoked before all other + * handlers existing at the time of subscription whenever events by the + * given name are emitted via ::emit. + */ + // tslint:disable-next-line:no-any + preempt(eventName: string, handler: (value: any) => void): Disposable; + + // Event Emission + /** Invoke handlers registered via ::on for the given event name. */ + // tslint:disable-next-line:no-any + emit(eventName: string, value?: any): void; + } } - - /** Static side of the Disposable class. */ - interface DisposableStatic { - prototype: Disposable; - new (disposalAction: Function): Disposable; - /** - * Ensure that Object correctly implements the Disposable. - */ - isDisposable(object: Object): boolean; - } - - /** Instance side of the Disposable class. */ - interface Disposable extends IDisposable { - disposed: boolean; - - constructor: DisposableStatic; - } - - /** A class that represent a handle to a resource that can be disposed. */ - var Disposable: DisposableStatic; - - /** Static side of the CompositeDisposable class. */ - interface CompositeDisposableStatic { - prototype: CompositeDisposable; - new (...disposables: IDisposable[]): CompositeDisposable; - } - - /** Instance side of the CompositeDisposable class. */ - interface CompositeDisposable extends IDisposable { - disposed: boolean; - - constructor: CompositeDisposableStatic; - add(...disposables: IDisposable[]): void; - remove(disposable: IDisposable): void; - clear(): void; - } - - /** - * A class that aggregates multiple [[Disposable]] instances together into a single disposable, - * so that they can all be disposed as a group. - */ - var CompositeDisposable: CompositeDisposableStatic; - - /** Static side of the Emitter class. */ - interface EmitterStatic { - prototype: Emitter; - new (): Emitter; - } - - /** Instance side of the Emitter class. */ - interface Emitter { - isDisposed: boolean; - - constructor: EmitterStatic; - /** - * Clear out any existing subscribers. - */ - clear(): void; - /** - * Unsubscribe all handlers. - */ - dispose(): void; - /** - * Registers a handler to be invoked whenever the given event is emitted. - * @return An object that will unregister the handler when disposed. - */ - on(eventName: string, handler: (value: any) => void, unshift?: boolean): Disposable; - /** - * Registers a handler to be invoked *before* all previously registered handlers for - * the given event. - * @return An object that will unregister the handler when disposed. - */ - preempt(eventName: string, handler: (value: any) => void): Disposable; - /** Invokes any registered handlers for the given event. */ - emit(eventName: string, value: any): void; - } - - /** A utility class for implementing event-based APIs. */ - var Emitter: EmitterStatic; } + +/** A handle to a resource that can be disposed. */ +export const Disposable: EventKit.Statics.Disposable; + +/** An object that aggregates multiple Disposable instances together into a + * single disposable, so they can all be disposed as a group. + */ +export const CompositeDisposable: EventKit.Statics.CompositeDisposable; + +/** Utility class to be used when implementing event-based APIs that allows + * for handlers registered via ::on to be invoked with calls to ::emit. + */ +export const Emitter: EventKit.Statics.Emitter; diff --git a/types/event-kit/tsconfig.json b/types/event-kit/tsconfig.json index 1682f77cb6..0097bf6ba3 100644 --- a/types/event-kit/tsconfig.json +++ b/types/event-kit/tsconfig.json @@ -7,7 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/event-kit/tslint.json b/types/event-kit/tslint.json new file mode 100644 index 0000000000..4b036f727a --- /dev/null +++ b/types/event-kit/tslint.json @@ -0,0 +1,37 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Custom rules. + "class-name": true, + "indent": [true, "tabs"], + "jsdoc-format": true, + "max-line-length": [true, 100], + "quotemark": [true, "double", "avoid-escape"], + "trailing-comma": [true, { + "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, + "singleline": { "objects": "never", "arrays": "never", "functions": "never" } + }], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type", + "check-typecast", + "check-rest-spread", + "check-preblock" + ], + // Soon to be defaults. + "arrow-return-shorthand": [true, "multiline"], + "no-any": true, + "no-floating-promises": true, + "no-unbound-method": true, + "no-unsafe-any": true, + "number-literal-format": true, + "restrict-plus-operands": true, + "return-undefined": true, + "switch-final-break": true + } +} diff --git a/types/event-kit/.editorconfig b/types/event-kit/v1/.editorconfig similarity index 100% rename from types/event-kit/.editorconfig rename to types/event-kit/v1/.editorconfig diff --git a/types/event-kit/v1/event-kit-tests.ts b/types/event-kit/v1/event-kit-tests.ts new file mode 100644 index 0000000000..4b4a0d4e7c --- /dev/null +++ b/types/event-kit/v1/event-kit-tests.ts @@ -0,0 +1,57 @@ + + +import { Disposable, CompositeDisposable, Emitter } from "event-kit"; + +// Emitter + +class User { + private emitter: Emitter; + name: string; + + constructor() { + this.emitter = new Emitter(); + } + + onDidChangeName(callback: (name: string) => void): Disposable { + return this.emitter.on('did-change-name', callback); + } + + setName(name: string): void { + if (this.name != name) { + this.name = name; + this.emitter.emit('did-change-name', name); + } + } + + destroy(): void { + this.emitter.clear(); + this.emitter.dispose(); + } +} + +// Disposable + +var disposable = new Disposable(() => { + // cleanup +}); +disposable.dispose(); + +var user = new User(); +var subscription = user.onDidChangeName((name: string) => { + console.log('User name change to: ' + name); +}); +if(Disposable.isDisposable(subscription)) {} +subscription.dispose(); + +// CompositeDisposable + +var subscriptions = new CompositeDisposable(); +subscriptions.add( + user.onDidChangeName((name: string) => { + console.log('subscriber #1'); + }), + user.onDidChangeName((name: string) => { + console.log('subscriber #2'); + }) +); +subscriptions.dispose(); diff --git a/types/event-kit/v1/index.d.ts b/types/event-kit/v1/index.d.ts new file mode 100644 index 0000000000..74f270c40f --- /dev/null +++ b/types/event-kit/v1/index.d.ts @@ -0,0 +1,91 @@ +// Type definitions for event-kit v1.2.0 +// Project: https://github.com/atom/event-kit +// Definitions by: Vadim Macagon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = AtomEventKit; + +declare namespace AtomEventKit { + interface IDisposable { + dispose(): void; + } + + /** Static side of the Disposable class. */ + interface DisposableStatic { + prototype: Disposable; + new (disposalAction: Function): Disposable; + /** + * Ensure that Object correctly implements the Disposable. + */ + isDisposable(object: Object): boolean; + } + + /** Instance side of the Disposable class. */ + interface Disposable extends IDisposable { + disposed: boolean; + + constructor: DisposableStatic; + } + + /** A class that represent a handle to a resource that can be disposed. */ + var Disposable: DisposableStatic; + + /** Static side of the CompositeDisposable class. */ + interface CompositeDisposableStatic { + prototype: CompositeDisposable; + new (...disposables: IDisposable[]): CompositeDisposable; + } + + /** Instance side of the CompositeDisposable class. */ + interface CompositeDisposable extends IDisposable { + disposed: boolean; + + constructor: CompositeDisposableStatic; + add(...disposables: IDisposable[]): void; + remove(disposable: IDisposable): void; + clear(): void; + } + + /** + * A class that aggregates multiple [[Disposable]] instances together into a single disposable, + * so that they can all be disposed as a group. + */ + var CompositeDisposable: CompositeDisposableStatic; + + /** Static side of the Emitter class. */ + interface EmitterStatic { + prototype: Emitter; + new (): Emitter; + } + + /** Instance side of the Emitter class. */ + interface Emitter { + isDisposed: boolean; + + constructor: EmitterStatic; + /** + * Clear out any existing subscribers. + */ + clear(): void; + /** + * Unsubscribe all handlers. + */ + dispose(): void; + /** + * Registers a handler to be invoked whenever the given event is emitted. + * @return An object that will unregister the handler when disposed. + */ + on(eventName: string, handler: (value: any) => void, unshift?: boolean): Disposable; + /** + * Registers a handler to be invoked *before* all previously registered handlers for + * the given event. + * @return An object that will unregister the handler when disposed. + */ + preempt(eventName: string, handler: (value: any) => void): Disposable; + /** Invokes any registered handlers for the given event. */ + emit(eventName: string, value: any): void; + } + + /** A utility class for implementing event-based APIs. */ + var Emitter: EmitterStatic; +} diff --git a/types/turf/v2/tsconfig.json b/types/event-kit/v1/tsconfig.json similarity index 73% rename from types/turf/v2/tsconfig.json rename to types/event-kit/v1/tsconfig.json index 17dfbed06a..ba260dd683 100644 --- a/types/turf/v2/tsconfig.json +++ b/types/event-kit/v1/tsconfig.json @@ -2,26 +2,28 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../../", "typeRoots": [ "../../" ], - "types": [], "paths": { - "turf": [ - "turf/v2" + "event-kit": [ + "event-kit/v1" ] }, + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "turf-tests.ts" + "event-kit-tests.ts" ] } \ No newline at end of file diff --git a/types/event-loop-lag/tsconfig.json b/types/event-loop-lag/tsconfig.json index 839fd4263e..39962c46ae 100644 --- a/types/event-loop-lag/tsconfig.json +++ b/types/event-loop-lag/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/event-stream/tsconfig.json b/types/event-stream/tsconfig.json index 768497bcd8..93e6b0c016 100644 --- a/types/event-stream/tsconfig.json +++ b/types/event-stream/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "paths": { - "q": [ "q/v0" ] + "q": [ + "q/v0" + ] }, "types": [], "noEmit": true, diff --git a/types/event-to-promise/tsconfig.json b/types/event-to-promise/tsconfig.json index 7ec7626f4c..d47bd1672d 100644 --- a/types/event-to-promise/tsconfig.json +++ b/types/event-to-promise/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/evernote/index.d.ts b/types/evernote/index.d.ts index 65765259c3..a6bff784ab 100644 --- a/types/evernote/index.d.ts +++ b/types/evernote/index.d.ts @@ -2,8 +2,9 @@ // Project: https://www.npmjs.com/package/evernote // Definitions by: Zachary Collins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -import * as Thrift from 'thrift'; +import { Thrift } from 'thrift'; declare namespace Evernote { interface Callback { diff --git a/types/evernote/tsconfig.json b/types/evernote/tsconfig.json index ee72e55520..2c89a52715 100644 --- a/types/evernote/tsconfig.json +++ b/types/evernote/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/exceljs/tsconfig.json b/types/exceljs/tsconfig.json index f9cb219d06..a477befe57 100644 --- a/types/exceljs/tsconfig.json +++ b/types/exceljs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "exceljs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/execa/index.d.ts b/types/execa/index.d.ts index df2c0d9d83..c74c60672d 100644 --- a/types/execa/index.d.ts +++ b/types/execa/index.d.ts @@ -55,8 +55,8 @@ declare namespace execa { function stderr(file: string, options?: Partial): Promise; function stderr(file: string, args?: string[], options?: Partial): Promise; function shell(command: string, options?: Partial): ExecaChildProcess; - function sync(file: string, options?: Partial): ExecaReturns; - function sync(file: string, args?: string[], options?: Partial): ExecaReturns; + function sync(file: string, options?: Partial): ExecaReturns; + function sync(file: string, args?: string[], options?: Partial): ExecaReturns; function shellSync(command: string, options?: Partial): ExecaReturns; } diff --git a/types/execa/tsconfig.json b/types/execa/tsconfig.json index 276a55194a..2d20077a4f 100644 --- a/types/execa/tsconfig.json +++ b/types/execa/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "execa-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/exit-hook/tsconfig.json b/types/exit-hook/tsconfig.json index 3eb97da053..34396672b0 100644 --- a/types/exit-hook/tsconfig.json +++ b/types/exit-hook/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "exit-hook-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/exit/tsconfig.json b/types/exit/tsconfig.json index 1966c83028..4343e78761 100644 --- a/types/exit/tsconfig.json +++ b/types/exit/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/exorcist/tsconfig.json b/types/exorcist/tsconfig.json index d7f4d9cfd2..c32fd613f3 100644 --- a/types/exorcist/tsconfig.json +++ b/types/exorcist/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/expect.js/tsconfig.json b/types/expect.js/tsconfig.json index a74bc1bdda..c8f60ed6e5 100644 --- a/types/expect.js/tsconfig.json +++ b/types/expect.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/expect/tsconfig.json b/types/expect/tsconfig.json index a034e6b04d..33e71dad4c 100644 --- a/types/expect/tsconfig.json +++ b/types/expect/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/expectations/tsconfig.json b/types/expectations/tsconfig.json index e114451de7..857a8a1eef 100644 --- a/types/expectations/tsconfig.json +++ b/types/expectations/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/expr-eval/tsconfig.json b/types/expr-eval/tsconfig.json index 73b68bb278..01f1b1e4e3 100644 --- a/types/expr-eval/tsconfig.json +++ b/types/expr-eval/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-brute-memcached/tsconfig.json b/types/express-brute-memcached/tsconfig.json index 2518dc464a..c49c399e0d 100644 --- a/types/express-brute-memcached/tsconfig.json +++ b/types/express-brute-memcached/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-brute-mongo/tsconfig.json b/types/express-brute-mongo/tsconfig.json index 40a6ef01df..9d21f88e3c 100644 --- a/types/express-brute-mongo/tsconfig.json +++ b/types/express-brute-mongo/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-brute-redis/tsconfig.json b/types/express-brute-redis/tsconfig.json index 387e065dfb..a033b8f228 100644 --- a/types/express-brute-redis/tsconfig.json +++ b/types/express-brute-redis/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "express-brute-redis-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-brute/tsconfig.json b/types/express-brute/tsconfig.json index 30be640387..30bf0ccf14 100644 --- a/types/express-brute/tsconfig.json +++ b/types/express-brute/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-debug/tsconfig.json b/types/express-debug/tsconfig.json index f3fa1043b9..9763943be8 100644 --- a/types/express-debug/tsconfig.json +++ b/types/express-debug/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-domain-middleware/tsconfig.json b/types/express-domain-middleware/tsconfig.json index 59b736e887..454fedea14 100644 --- a/types/express-domain-middleware/tsconfig.json +++ b/types/express-domain-middleware/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-enforces-ssl/tsconfig.json b/types/express-enforces-ssl/tsconfig.json index 2fdb6a3472..9e071e54fb 100644 --- a/types/express-enforces-ssl/tsconfig.json +++ b/types/express-enforces-ssl/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "express-enforces-ssl-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-fileupload/tsconfig.json b/types/express-fileupload/tsconfig.json index 53c878d430..ecbd735cea 100644 --- a/types/express-fileupload/tsconfig.json +++ b/types/express-fileupload/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "express-fileupload-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-flash-2/tsconfig.json b/types/express-flash-2/tsconfig.json index 79fba18d61..6a0ef5a28b 100644 --- a/types/express-flash-2/tsconfig.json +++ b/types/express-flash-2/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-formidable/tsconfig.json b/types/express-formidable/tsconfig.json index 59c0860d7f..9deeebd96f 100644 --- a/types/express-formidable/tsconfig.json +++ b/types/express-formidable/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-graphql/tsconfig.json b/types/express-graphql/tsconfig.json index 8cec14e03c..7924c82706 100644 --- a/types/express-graphql/tsconfig.json +++ b/types/express-graphql/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "express-graphql-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-handlebars/tsconfig.json b/types/express-handlebars/tsconfig.json index 9be12b0d0b..9c6da1ba25 100644 --- a/types/express-handlebars/tsconfig.json +++ b/types/express-handlebars/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-jwt/tsconfig.json b/types/express-jwt/tsconfig.json index d0c13dcb3e..f91064aba5 100644 --- a/types/express-jwt/tsconfig.json +++ b/types/express-jwt/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-less/tsconfig.json b/types/express-less/tsconfig.json index 558ccc0e96..c8e44f8204 100644 --- a/types/express-less/tsconfig.json +++ b/types/express-less/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-minify/tsconfig.json b/types/express-minify/tsconfig.json index d6317db044..65c999883e 100644 --- a/types/express-minify/tsconfig.json +++ b/types/express-minify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts new file mode 100644 index 0000000000..21a5028b27 --- /dev/null +++ b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts @@ -0,0 +1,26 @@ +import * as express from 'express'; +import * as mongoSanitize from 'express-mongo-sanitize'; + +const app: express.Express = express(); + +app.use(mongoSanitize()); + +app.use(mongoSanitize({ + replaceWith: '_' +})); + +interface TestPayload { + foo: string; +} + +const testPayload: TestPayload = { + foo: 'bar' +}; + +const sanitize1: TestPayload = mongoSanitize.sanitize(testPayload); + +const sanitize2: TestPayload = mongoSanitize.sanitize(testPayload, { + replaceWith: '_' +}); + +const isCorrect: boolean = mongoSanitize.has(testPayload); diff --git a/types/express-mongo-sanitize/index.d.ts b/types/express-mongo-sanitize/index.d.ts new file mode 100644 index 0000000000..354b6830dd --- /dev/null +++ b/types/express-mongo-sanitize/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for express-mongo-sanitize 1.3 +// Project: https://github.com/fiznool/express-mongo-sanitize#readme +// Definitions by: Eric Byers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import express = require('express'); + +interface MongoSanitizeOptions { + replaceWith: any; +} + +declare namespace expressMongoSanitize { + function sanitize(payload: T, options?: MongoSanitizeOptions): T; + function has(payload: any): boolean; +} + +declare function expressMongoSanitize(options?: MongoSanitizeOptions): (req: express.Request, res: express.Response, next: express.NextFunction) => void; + +export = expressMongoSanitize; diff --git a/types/express-mongo-sanitize/tsconfig.json b/types/express-mongo-sanitize/tsconfig.json new file mode 100644 index 0000000000..0834820a85 --- /dev/null +++ b/types/express-mongo-sanitize/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "express-mongo-sanitize-tests.ts" + ] +} diff --git a/types/express-mongo-sanitize/tslint.json b/types/express-mongo-sanitize/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-mongo-sanitize/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-mung/tsconfig.json b/types/express-mung/tsconfig.json index 063b52f52d..9dd04b84e6 100644 --- a/types/express-mung/tsconfig.json +++ b/types/express-mung/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-myconnection/tsconfig.json b/types/express-myconnection/tsconfig.json index 5f0d2ca2b6..b68ca7cb51 100644 --- a/types/express-myconnection/tsconfig.json +++ b/types/express-myconnection/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-mysql-session/tsconfig.json b/types/express-mysql-session/tsconfig.json index f897d59bc8..f6d45a934d 100644 --- a/types/express-mysql-session/tsconfig.json +++ b/types/express-mysql-session/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-openapi/tsconfig.json b/types/express-openapi/tsconfig.json index d6fea1fa8a..a6cf4f3530 100644 --- a/types/express-openapi/tsconfig.json +++ b/types/express-openapi/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-partials/tsconfig.json b/types/express-partials/tsconfig.json index 173210c180..72e02dcdee 100644 --- a/types/express-partials/tsconfig.json +++ b/types/express-partials/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-rate-limit/tsconfig.json b/types/express-rate-limit/tsconfig.json index ca3c32c3bb..7dfb99a1d4 100644 --- a/types/express-rate-limit/tsconfig.json +++ b/types/express-rate-limit/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "express-rate-limit-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-rate-limit-tests.ts" + ] +} \ No newline at end of file diff --git a/types/express-route-fs/tsconfig.json b/types/express-route-fs/tsconfig.json index 48849326c7..550f0d3b31 100644 --- a/types/express-route-fs/tsconfig.json +++ b/types/express-route-fs/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-sanitized/tsconfig.json b/types/express-sanitized/tsconfig.json index 2a1865d32c..9924f49f46 100644 --- a/types/express-sanitized/tsconfig.json +++ b/types/express-sanitized/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "express-sanitized-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-serve-static-core/tsconfig.json b/types/express-serve-static-core/tsconfig.json index cdb77c3573..73c2b38c7d 100644 --- a/types/express-serve-static-core/tsconfig.json +++ b/types/express-serve-static-core/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-session/tsconfig.json b/types/express-session/tsconfig.json index 674aaf8385..14c2e75bd5 100644 --- a/types/express-session/tsconfig.json +++ b/types/express-session/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-unless/tsconfig.json b/types/express-unless/tsconfig.json index 2eaf41b0d5..44038c38d3 100644 --- a/types/express-unless/tsconfig.json +++ b/types/express-unless/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express-useragent/tsconfig.json b/types/express-useragent/tsconfig.json index 804b3434a8..3bbc5c5520 100644 --- a/types/express-useragent/tsconfig.json +++ b/types/express-useragent/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/express/tsconfig.json b/types/express/tsconfig.json index 009cb9ec00..b38c24658e 100644 --- a/types/express/tsconfig.json +++ b/types/express/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/extend/extend-tests.ts b/types/extend/extend-tests.ts index 38e816f020..0bf977e6e8 100644 --- a/types/extend/extend-tests.ts +++ b/types/extend/extend-tests.ts @@ -1,38 +1,43 @@ -import extend = require('extend'); -declare function assert(cond: boolean): void; +/// +import * as assert from 'assert'; +import * as extend from 'extend'; -var objectBase = { +const objectBase = { test: 'base' }; -var objectOne = { +const objectOne = { test: 'one', iamone: true }; -var objectTwo = { +const objectTwo = { test: 2, iamtwo: true }; -var objectThree = { +const objectThree = { iamthree: true, depth: { innerType: 'deep' } }; -var extended = extend(objectBase, objectOne); +type ExtendedType = typeof objectBase & typeof objectOne; +const extended: ExtendedType = extend(objectBase, objectOne); assert(extended.test === 'one'); -assert(extended.iamone === true); +assert(extended.iamone); -var moreExtended = extend(objectBase, objectOne, objectTwo); +type MoreExtendedType = typeof objectBase & typeof objectOne & typeof objectTwo; +const moreExtended: MoreExtendedType = extend(objectBase, objectOne, objectTwo); assert(moreExtended.test === 2); -assert(moreExtended.iamone === true); -assert(moreExtended.iamtwo === true); +assert(moreExtended.iamone); +assert(moreExtended.iamtwo); -var deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree); -assert(deepExtended.iamone === true); -assert(moreExtended.iamtwo === true); -assert(deepExtended.iamthree === true); -assert(deepExtended.depth.innerType === 'one'); \ No newline at end of file +type DeepExtendedType = typeof objectBase & typeof objectOne & + typeof objectTwo & typeof objectThree; +const deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree); +assert(deepExtended.iamone); +assert(deepExtended.iamtwo); +assert(deepExtended.iamthree); +assert(deepExtended.depth.innerType === 'deep'); diff --git a/types/extend/index.d.ts b/types/extend/index.d.ts index e0af478a47..b94d1a7cb1 100644 --- a/types/extend/index.d.ts +++ b/types/extend/index.d.ts @@ -1,9 +1,20 @@ -// Type definitions for extend v2.0.0 +// Type definitions for extend 3.0 // Project: https://www.npmjs.com/package/extend // Definitions by: Stefan Steinhart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function extend(deepOrObject: boolean | Object, ...objectN: Object[]): any; -declare namespace extend { } +declare function extend(deep: boolean, target: T, source: U): T & U; +declare function extend(deep: boolean, target: T, source1: U, source2: V): T & U & V; +declare function extend(deep: boolean, target: T, source1: U, source2: V, + source3: W): T & U & V & W; +declare function extend(deep: boolean, target: T, source1: U, source2: V, + source3: W, source4: X): T & U & V & W & X; +declare function extend(target: T, source: U): T & U; +declare function extend(target: T, source1: U, source2: V): T & U & V; +declare function extend(target: T, source1: U, source2: V, source3: W): T & U & V & W; +declare function extend(target: T, source1: U, source2: V, + source3: W, source4: X): T & U & V & W & X; +declare function extend(deep: boolean, target: any, ...sources: any[]): any; +declare function extend(target: any, ...sources: any[]): any; +declare namespace extend {} export = extend; diff --git a/types/extend/tsconfig.json b/types/extend/tsconfig.json index 7e5d04a155..dce058009d 100644 --- a/types/extend/tsconfig.json +++ b/types/extend/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/extend/tslint.json b/types/extend/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extend/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/extended-listbox/tsconfig.json b/types/extended-listbox/tsconfig.json index 2943719a7f..38eda11579 100644 --- a/types/extended-listbox/tsconfig.json +++ b/types/extended-listbox/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/extjs/tsconfig.json b/types/extjs/tsconfig.json index 77e9863d6a..16cf9bcee6 100644 --- a/types/extjs/tsconfig.json +++ b/types/extjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/extract-stack/tsconfig.json b/types/extract-stack/tsconfig.json index ea1f60704b..26f0c50479 100644 --- a/types/extract-stack/tsconfig.json +++ b/types/extract-stack/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "extract-stack-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts b/types/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts index ca992ea3ef..06fc528cff 100644 --- a/types/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts +++ b/types/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts @@ -1,10 +1,7 @@ -import { optimize, Configuration, Plugin } from 'webpack' - -import * as ExtractTextPlugin from 'extract-text-webpack-plugin' - - -let configuration: Configuration +import webpack = require('webpack'); +import ExtractTextPlugin = require('extract-text-webpack-plugin'); +let configuration: webpack.Configuration; configuration = { // The standard entry point and output config @@ -58,7 +55,7 @@ configuration = { configuration = { // ... plugins: [ - new optimize.CommonsChunkPlugin({ + new webpack.optimize.CommonsChunkPlugin({ name: "commons", filename: "commons.js", }), @@ -85,15 +82,15 @@ configuration = { }; // multiple extract instances -let extractCSS = new ExtractTextPlugin('stylesheets/[name].css'); -let extractLESS = new ExtractTextPlugin('stylesheets/[name].less'); +const extractCSS: ExtractTextPlugin = new ExtractTextPlugin('stylesheets/[name].css'); +const extractLESS: ExtractTextPlugin = new ExtractTextPlugin('stylesheets/[name].less'); configuration = { // ... module: { rules: [ - { test: /\.scss$/i, use: extractCSS.extract(['css','sass']) }, - { test: /\.less$/i, use: extractLESS.extract(['css','less']) }, + { test: /\.scss$/i, use: extractCSS.extract(['css', 'sass']) }, + { test: /\.less$/i, use: extractLESS.extract(['css', 'less']) }, ] }, plugins: [ diff --git a/types/extract-text-webpack-plugin/index.d.ts b/types/extract-text-webpack-plugin/index.d.ts index 0897d7b594..962698568a 100644 --- a/types/extract-text-webpack-plugin/index.d.ts +++ b/types/extract-text-webpack-plugin/index.d.ts @@ -1,49 +1,56 @@ -// Type definitions for extract-text-webpack-plugin 2.1.0 +// Type definitions for extract-text-webpack-plugin 3.0 // Project: https://github.com/webpack-contrib/extract-text-webpack-plugin // Definitions by: flying-sheep , kayo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { Plugin, OldLoader, NewLoader } from 'webpack' +import webpack = require('webpack'); + +export = ExtractTextPlugin; /** * extract-text-webpack-plugin has no support for .options instead of .query yet. * See https://github.com/webpack/extract-text-webpack-plugin/issues/281 */ -type Loader = string | OldLoader | NewLoader - -interface ExtractPluginOptions { - /** the filename of the result file. May contain `[name]`, `[id]` and `[contenthash]` */ - filename: string - /** extract from all additional chunks too (by default it extracts only from the initial chunk(s)) */ - allChunks?: boolean - /** disables the plugin */ - disable?: boolean - /** Unique ident for this plugin instance. (For advanced usage only, by default automatically generated) */ - id?: string -} - -interface ExtractOptions { - /** the loader(s) that should be used for converting the resource to a css exporting module */ - use: Loader | Loader[] - /** the loader(s) that should be used when the css is not extracted (i.e. in an additional chunk when `allChunks: false`) */ - fallback?: Loader | Loader[] - /** override the `publicPath` setting for this loader */ - publicPath?: string -} +type Loader = string | webpack.OldLoader | webpack.NewLoader; /** * Use an `ExtractTextPlugin` instance and a loader returned by `extract` in concert to write files to disk instead of loading them into others. * Usage example at https://github.com/webpack/extract-text-webpack-plugin#usage-example-with-css */ -interface ExtractTextPlugin extends Plugin { +declare class ExtractTextPlugin extends webpack.Plugin { /** Create a plugin instance defining the extraction target file(s) for the files loaded by `extract` */ - new (options: string | ExtractPluginOptions): ExtractTextPlugin + constructor(options: string | ExtractTextPlugin.PluginOptions); /** - * Creates an extracting loader from an existing loader. + * Creates an extracting loader from an existing loader (static). * Use the resulting loader in `module.rules`/`module.loaders`. + * @see {@link https://www.npmjs.com/package/extract-text-webpack-plugin#extract} */ - extract: (loader: Loader | Loader[] | ExtractOptions) => Loader[] + static extract: (loader: Loader | Loader[] | ExtractTextPlugin.LoaderOptions) => Loader[]; + /** + * Creates an extracting loader from an existing loader (instance). + * Use the resulting loader in `module.rules`/`module.loaders`. + * @see {@link https://www.npmjs.com/package/extract-text-webpack-plugin#multiple-instances} + */ + extract: (loader: Loader | Loader[] | ExtractTextPlugin.LoaderOptions) => Loader[]; } -declare const extractTextPlugin: ExtractTextPlugin -export = extractTextPlugin +declare namespace ExtractTextPlugin { + interface PluginOptions { + /** the filename of the result file. May contain `[name]`, `[id]` and `[contenthash]` */ + filename: string; + /** extract from all additional chunks too (by default it extracts only from the initial chunk(s)) */ + allChunks?: boolean; + /** disables the plugin */ + disable?: boolean; + /** Unique ident for this plugin instance. (For advanced usage only, by default automatically generated) */ + id?: string; + } + interface LoaderOptions { + /** the loader(s) that should be used for converting the resource to a css exporting module */ + use: Loader | Loader[]; + /** the loader(s) that should be used when the css is not extracted (i.e. in an additional chunk when `allChunks: false`) */ + fallback?: Loader | Loader[]; + /** override the `publicPath` setting for this loader */ + publicPath?: string; + } +} diff --git a/types/extract-text-webpack-plugin/tsconfig.json b/types/extract-text-webpack-plugin/tsconfig.json index b5e248c21d..dc6516b37e 100644 --- a/types/extract-text-webpack-plugin/tsconfig.json +++ b/types/extract-text-webpack-plugin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/extract-text-webpack-plugin/tslint.json b/types/extract-text-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extract-text-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/extract-zip/tsconfig.json b/types/extract-zip/tsconfig.json index fc69a3fbc0..821ad3b5b3 100644 --- a/types/extract-zip/tsconfig.json +++ b/types/extract-zip/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/eyes/tsconfig.json b/types/eyes/tsconfig.json index 7711a38e68..e0effcdb85 100644 --- a/types/eyes/tsconfig.json +++ b/types/eyes/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/f1/tsconfig.json b/types/f1/tsconfig.json index 501e1649db..e54cd01b58 100644 --- a/types/f1/tsconfig.json +++ b/types/f1/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fabric/tsconfig.json b/types/fabric/tsconfig.json index ab7021e0c9..fc7ce8ddc9 100644 --- a/types/fabric/tsconfig.json +++ b/types/fabric/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/facebook-js-sdk/tsconfig.json b/types/facebook-js-sdk/tsconfig.json index a37eb513c6..2ac8efade5 100644 --- a/types/facebook-js-sdk/tsconfig.json +++ b/types/facebook-js-sdk/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/facebook-pixel/tsconfig.json b/types/facebook-pixel/tsconfig.json index cfbd7e82da..c4cc9bd7fa 100644 --- a/types/facebook-pixel/tsconfig.json +++ b/types/facebook-pixel/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/faker/tsconfig.json b/types/faker/tsconfig.json index 0589e5dc54..33d32cb266 100644 --- a/types/faker/tsconfig.json +++ b/types/faker/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "faker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/faker/v3/tsconfig.json b/types/faker/v3/tsconfig.json index b95cdea472..5cfa258457 100644 --- a/types/faker/v3/tsconfig.json +++ b/types/faker/v3/tsconfig.json @@ -7,12 +7,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "faker": [ "faker/v3" ] + "faker": [ + "faker/v3" + ] }, "types": [], "noEmit": true, @@ -22,4 +25,4 @@ "index.d.ts", "faker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/falcor-express/tsconfig.json b/types/falcor-express/tsconfig.json index 8c31012eff..0f4a36624a 100644 --- a/types/falcor-express/tsconfig.json +++ b/types/falcor-express/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/falcor-http-datasource/tsconfig.json b/types/falcor-http-datasource/tsconfig.json index 8f7327c1f0..114a1e5046 100644 --- a/types/falcor-http-datasource/tsconfig.json +++ b/types/falcor-http-datasource/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/falcor-json-graph/tsconfig.json b/types/falcor-json-graph/tsconfig.json index b746208c00..2753b64668 100644 --- a/types/falcor-json-graph/tsconfig.json +++ b/types/falcor-json-graph/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/falcor-router/tsconfig.json b/types/falcor-router/tsconfig.json index dbcf71fc2c..4f37ee59be 100644 --- a/types/falcor-router/tsconfig.json +++ b/types/falcor-router/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/falcor/tsconfig.json b/types/falcor/tsconfig.json index 450a570778..94084a9884 100644 --- a/types/falcor/tsconfig.json +++ b/types/falcor/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/famous/tsconfig.json b/types/famous/tsconfig.json index efe289fcb5..e2760ecc02 100644 --- a/types/famous/tsconfig.json +++ b/types/famous/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fancybox/tsconfig.json b/types/fancybox/tsconfig.json index 0ed6ebd223..e8011cdd21 100644 --- a/types/fancybox/tsconfig.json +++ b/types/fancybox/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/farbtastic/tsconfig.json b/types/farbtastic/tsconfig.json index 4783d61749..91f8048ddb 100644 --- a/types/farbtastic/tsconfig.json +++ b/types/farbtastic/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fast-diff/tsconfig.json b/types/fast-diff/tsconfig.json index e89403e0ef..0c6f0c4ae2 100644 --- a/types/fast-diff/tsconfig.json +++ b/types/fast-diff/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "fast-diff-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fast-levenshtein/tsconfig.json b/types/fast-levenshtein/tsconfig.json index 1c4790a9ac..1cb0e8b022 100644 --- a/types/fast-levenshtein/tsconfig.json +++ b/types/fast-levenshtein/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fast-list/tsconfig.json b/types/fast-list/tsconfig.json index a639b60ffe..ce90acb3cd 100644 --- a/types/fast-list/tsconfig.json +++ b/types/fast-list/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "fast-list-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fast-stats/tsconfig.json b/types/fast-stats/tsconfig.json index ac2826ea03..c845c63f47 100644 --- a/types/fast-stats/tsconfig.json +++ b/types/fast-stats/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fastclick/tsconfig.json b/types/fastclick/tsconfig.json index 7a0765f6e8..494a7b78d7 100644 --- a/types/fastclick/tsconfig.json +++ b/types/fastclick/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/favico.js/tsconfig.json b/types/favico.js/tsconfig.json index 38c83f7668..15047d8dbf 100644 --- a/types/favico.js/tsconfig.json +++ b/types/favico.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fb/tsconfig.json b/types/fb/tsconfig.json index 73e4d7ebac..9e8582a781 100644 --- a/types/fb/tsconfig.json +++ b/types/fb/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fbemitter/tsconfig.json b/types/fbemitter/tsconfig.json index a5fab49d7d..8032d97e7f 100644 --- a/types/fbemitter/tsconfig.json +++ b/types/fbemitter/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/featherlight/tsconfig.json b/types/featherlight/tsconfig.json index d675953e89..32c72beb9f 100644 --- a/types/featherlight/tsconfig.json +++ b/types/featherlight/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fecha/tsconfig.json b/types/fecha/tsconfig.json index 581630d1b6..8582f99228 100644 --- a/types/fecha/tsconfig.json +++ b/types/fecha/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "fecha-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feedme/feedme-tests.ts b/types/feedme/feedme-tests.ts new file mode 100644 index 0000000000..5efce41168 --- /dev/null +++ b/types/feedme/feedme-tests.ts @@ -0,0 +1,63 @@ +import FeedMe = require("feedme"); +import * as http from "http"; + +http.get('https://nodejs.org/en/feed/blog.xml', (res) => { + const feedme = new FeedMe(true); + const feedmeWithoutBuffer = new FeedMe(); + + res.pipe(feedme); + + feedme.on('end', () => { + const document: FeedMe.Document = feedme.done(); + + const metatype: FeedMe.Type = document.type; + // "#version": string; + const metatitle: string = document.title; + const metadescription: string = document.description; + const metadate: string = document.date; + const metapubdate: string = document.pubdate; + const metalink: string = document.link; + const metaxmlurl: string = document.xmlurl; + const metaauthor: string = document.author; + const metalanguage: string = document.language; + const metaimage: FeedMe.Image = document.image; + const metafavicon: string = document.favicon; + const metacopyright: string = document.copyright; + const metagenerator: string = document.generator; + const metacategories: string[] = document.categories; + + switch (document.type) { + case "atom": + case "json": + case "rss 0.90": + case "rss 0.91": + case "rss 0.92": + case "rss 0.93": + case "rss 0.94": + case "rss 1.0": + case "rss 2.0": + break; + } + + const misc: string = document["misc"]; + }); + + feedme.on('item', (item) => { + const title: string = item.title; + const description: string = item.description; + const summary: string = item.summary; + const date: string = item.date; + const pubdate: string = item.pubdate; + const link: string = item.link; + const origlink: string = item.origlink; + const author: string = item.author; + const guid: FeedMe.Guid | string = item.guid; + const comments: string = item.comments; + const image: FeedMe.Image = item.image; + const categories: string[] = item.categories; + const enclosures: string[] = item.enclosures; + const meta: FeedMe.Meta = item.meta; + + const misc: string = item["misc"]; + }); +}); diff --git a/types/feedme/index.d.ts b/types/feedme/index.d.ts new file mode 100644 index 0000000000..35859cd698 --- /dev/null +++ b/types/feedme/index.d.ts @@ -0,0 +1,109 @@ +// Type definitions for feedme 1.0 +// Project: https://github.com/fent/feedme.js +// Definitions by: Peter Harris +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { EventEmitter } from 'events'; +import { Writable, Readable } from 'stream'; + +declare class FeedMe extends Writable { + /** + * Creates a new instance of the FeedMe parser. + * + * @param buffer Can be true if you want the parser to buffer the entire feed document as a JSON object, letting you use the FeedMe#done() method. + */ + constructor(buffer?: boolean); + + /** + * Can only be used if buffer is true. It returns the feed as a Javascript object, should be called after end is emitted from the parser. + * Subelements are put as children objects with their names as keys. When one object has more than one child of the same name, they are + * put into an array. Items are always put into an array. + */ + done(): FeedMe.Document; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close" | "drain" | "finish", listener: () => void): this; + on(event: "pipe" | "unpipe", listener: (src: Readable) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "item", listener: (item: FeedMe.Item) => void): this; + on(event: "type", listener: (type: FeedMe.Type) => void): this; +} + +declare namespace FeedMe { + type Type = "atom" | "rss 0.90" | "rss 0.91" | "rss 0.92" | "rss 0.93" | "rss 0.94" | "rss 1.0" | "rss 2.0" | "json"; + + interface Document extends Meta { + items: Item[]; + } + + interface Attrs { + name: string; + value: any; + prefix: string; + local: string; + uri: string; + } + + interface NS { + [key: string]: string; + } + + interface Image { + url: string; + title: string; + link: string; + width: string; + height: string; + } + + interface Meta { + [key: string]: any; + + // "#ns": NS[]; + "type": Type; + // "#version": string; + title: string; + description: string; + date: string; + pubdate: string; + lastbuilddate: string; + link: string; + xmlurl: string; + author: string; + language: string; + image: Image; + favicon: string; + copyright: string; + generator: string; + categories: string[]; + } + + interface Item { + [key: string]: any; + + title: string; + description: string; + summary: string; + date: string; + pubdate: string; + link: string; + origlink: string; + author: string; + guid: string | Guid; + comments: string; + image: Image; + categories: string[]; + enclosures: string[]; + // meta: Meta; + } + + interface Guid { + ispermalink: string; + text: string; + } +} + +export = FeedMe; diff --git a/types/feedme/tsconfig.json b/types/feedme/tsconfig.json new file mode 100644 index 0000000000..aa5f186309 --- /dev/null +++ b/types/feedme/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes" : false + }, + "files": [ + "index.d.ts", + "feedme-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feedme/tslint.json b/types/feedme/tslint.json new file mode 100644 index 0000000000..1fa97d3027 --- /dev/null +++ b/types/feedme/tslint.json @@ -0,0 +1,11 @@ +{ + "defaultSeverity": "error", + "extends": "dtslint/dt.json", + "jsRules": {}, + "rules": { + // "ban-types": false, + // "no-single-declare-module": false, + // "no-var": false + }, + "rulesDirectory": [] +} \ No newline at end of file diff --git a/types/fetch-jsonp/tsconfig.json b/types/fetch-jsonp/tsconfig.json index 05c3f994ed..885a787152 100644 --- a/types/fetch-jsonp/tsconfig.json +++ b/types/fetch-jsonp/tsconfig.json @@ -1,20 +1,26 @@ { - "compilerOptions": { - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "module": "commonjs", - "lib": ["es6", "dom"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitThis": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "fetch-jsonp-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noUnusedLocals": true, + "noUnusedParameters": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "fetch-jsonp-tests.ts" + ] +} \ No newline at end of file diff --git a/types/fetch-mock/tsconfig.json b/types/fetch-mock/tsconfig.json index 8d38620419..0c410ec0ae 100644 --- a/types/fetch-mock/tsconfig.json +++ b/types/fetch-mock/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fetch.io/tsconfig.json b/types/fetch.io/tsconfig.json index 8b05d3ca33..b47cf8f3bf 100644 --- a/types/fetch.io/tsconfig.json +++ b/types/fetch.io/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "fetch.io-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ffi/tsconfig.json b/types/ffi/tsconfig.json index 5c4d36cac2..3e89d06e94 100644 --- a/types/ffi/tsconfig.json +++ b/types/ffi/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ffmpeg-static/tsconfig.json b/types/ffmpeg-static/tsconfig.json index 94c7a336b8..8a1635e82c 100644 --- a/types/ffmpeg-static/tsconfig.json +++ b/types/ffmpeg-static/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "ffmpeg-static-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ffprobe-static/tsconfig.json b/types/ffprobe-static/tsconfig.json index 726a8e0feb..fab3495614 100644 --- a/types/ffprobe-static/tsconfig.json +++ b/types/ffprobe-static/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "ffprobe-static-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fhir/tsconfig.json b/types/fhir/tsconfig.json index 4b7b598ca3..8b4970200f 100644 --- a/types/fhir/tsconfig.json +++ b/types/fhir/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fibers/tsconfig.json b/types/fibers/tsconfig.json index c9412a5365..99e4865e3c 100644 --- a/types/fibers/tsconfig.json +++ b/types/fibers/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/field/tsconfig.json b/types/field/tsconfig.json index cad072ad2d..219fa4963d 100644 --- a/types/field/tsconfig.json +++ b/types/field/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/figures/tsconfig.json b/types/figures/tsconfig.json index 595779c25d..720529ea45 100644 --- a/types/figures/tsconfig.json +++ b/types/figures/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "figures-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/file-exists/tsconfig.json b/types/file-exists/tsconfig.json index 4d4cd410b7..ffdee8351c 100644 --- a/types/file-exists/tsconfig.json +++ b/types/file-exists/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "file-exists-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/file-saver/tsconfig.json b/types/file-saver/tsconfig.json index 7eae381719..1dc5a6f8f4 100644 --- a/types/file-saver/tsconfig.json +++ b/types/file-saver/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/file-type/tsconfig.json b/types/file-type/tsconfig.json index 022412fea2..499b81459c 100644 --- a/types/file-type/tsconfig.json +++ b/types/file-type/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/file-url/tsconfig.json b/types/file-url/tsconfig.json index a40e050026..4a6e413ce0 100644 --- a/types/file-url/tsconfig.json +++ b/types/file-url/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/filenamify/tsconfig.json b/types/filenamify/tsconfig.json index aec1f33988..0d41b23a0d 100644 --- a/types/filenamify/tsconfig.json +++ b/types/filenamify/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "filenamify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/filesize/tsconfig.json b/types/filesize/tsconfig.json index e2992f2eb7..350e88d4ad 100644 --- a/types/filesize/tsconfig.json +++ b/types/filesize/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/filesystem/tsconfig.json b/types/filesystem/tsconfig.json index ad6c29ed09..6512ab1028 100644 --- a/types/filesystem/tsconfig.json +++ b/types/filesystem/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/filewriter/tsconfig.json b/types/filewriter/tsconfig.json index 24fee2ed61..7cba1a1289 100644 --- a/types/filewriter/tsconfig.json +++ b/types/filewriter/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fill-pdf/tsconfig.json b/types/fill-pdf/tsconfig.json index f171cd8944..4cbe1dad24 100644 --- a/types/fill-pdf/tsconfig.json +++ b/types/fill-pdf/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/finalhandler/tsconfig.json b/types/finalhandler/tsconfig.json index 75f6e6276e..dd03198a83 100644 --- a/types/finalhandler/tsconfig.json +++ b/types/finalhandler/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/finch/tsconfig.json b/types/finch/tsconfig.json index 886dab1e7a..dfb658a6b2 100644 --- a/types/finch/tsconfig.json +++ b/types/finch/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/find-up/tsconfig.json b/types/find-up/tsconfig.json index 104004639a..ea6bf9d1ad 100644 --- a/types/find-up/tsconfig.json +++ b/types/find-up/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "find-up-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/findup-sync/tsconfig.json b/types/findup-sync/tsconfig.json index 5835f70080..fd44ee7c99 100644 --- a/types/findup-sync/tsconfig.json +++ b/types/findup-sync/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fingerprintjs/tsconfig.json b/types/fingerprintjs/tsconfig.json index 2538e47fab..35166934d4 100644 --- a/types/fingerprintjs/tsconfig.json +++ b/types/fingerprintjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fingerprintjs2/tsconfig.json b/types/fingerprintjs2/tsconfig.json index 30131c07dc..b274c3c488 100644 --- a/types/fingerprintjs2/tsconfig.json +++ b/types/fingerprintjs2/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "fingerprintjs2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/firebase-client/tsconfig.json b/types/firebase-client/tsconfig.json index b439fb8310..4510d3f56d 100644 --- a/types/firebase-client/tsconfig.json +++ b/types/firebase-client/tsconfig.json @@ -8,12 +8,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "paths": { - "q": [ "q/v0" ] + "q": [ + "q/v0" + ] }, "types": [], "noEmit": true, diff --git a/types/firebase-token-generator/tsconfig.json b/types/firebase-token-generator/tsconfig.json index 9c0c0251ad..e6620557a2 100644 --- a/types/firebase-token-generator/tsconfig.json +++ b/types/firebase-token-generator/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/firebase/tsconfig.json b/types/firebase/tsconfig.json index 306e8bdb6e..4695310ec3 100644 --- a/types/firebase/tsconfig.json +++ b/types/firebase/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/firebird/firebird-tests.ts b/types/firebird/firebird-tests.ts index 96600a7f2d..d248fe427c 100644 --- a/types/firebird/firebird-tests.ts +++ b/types/firebird/firebird-tests.ts @@ -119,4 +119,4 @@ blob._write(buffer, 10); blob._write(buffer, 10, (err: Error | null) => {}); /* Stream */ -const strm: NodeJS.ReadWriteStream = new fb.Stream(blob); +const strm = new fb.Stream(blob); diff --git a/types/firebird/index.d.ts b/types/firebird/index.d.ts index 430a3b3b60..eaa20682a6 100644 --- a/types/firebird/index.d.ts +++ b/types/firebird/index.d.ts @@ -12,6 +12,8 @@ * Original document is [here](https://www.npmjs.com/package/firebird). */ declare module 'firebird' { + import * as stream from 'stream'; + /** * @see createConnection() method will create Firebird Connection object for you */ @@ -453,24 +455,14 @@ declare module 'firebird' { * You may pipe strm to/from NodeJS Stream objects (fs or socket). * You may also look at [NodeJS Streams reference](https://nodejs.org/api/stream.html). */ - class Stream implements NodeJS.ReadWriteStream { + class Stream extends stream.Stream { constructor(blob: FBBlob); - - /* Following lines is JUST AS NodeJS.ReadStream, NodeJS.WriteStream, and NodeJS.Emmiter */ /* tslint:disable */ /* NodeJS.ReadStream */ readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: string | null): this; pause(): this; resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): this; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; /* NodeJS.WriteStream */ writable: boolean; @@ -480,22 +472,9 @@ declare module 'firebird' { end(buffer: Buffer, cb?: Function): void; end(str: string, cb?: Function): void; end(str: string, encoding?: string, cb?: Function): void; - - /* EventEmitter */ - addListener(event: string | symbol, listener: Function): this; - on(event: string | symbol, listener: Function): this; - once(event: string | symbol, listener: Function): this; - removeListener(event: string | symbol, listener: Function): this; - removeAllListeners(event?: string | symbol): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string | symbol): Function[]; - emit(event: string | symbol, ...args: any[]): boolean; - listenerCount(type: string | symbol): number; - prependListener(event: string | symbol, listener: Function): this; - prependOnceListener(event: string | symbol, listener: Function): this; - eventNames(): (string | symbol)[]; + destroy(error?: Error): void; /* tslint:enable */ + check_destroyed(): void; } } diff --git a/types/firebird/tsconfig.json b/types/firebird/tsconfig.json index 705913437a..e5e2d1b6ac 100644 --- a/types/firebird/tsconfig.json +++ b/types/firebird/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "firebird-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/firefox/tsconfig.json b/types/firefox/tsconfig.json index b9172a1c32..44ef93219e 100644 --- a/types/firefox/tsconfig.json +++ b/types/firefox/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/firmata/tsconfig.json b/types/firmata/tsconfig.json index 3b0d4b97cb..bf87f0bba2 100644 --- a/types/firmata/tsconfig.json +++ b/types/firmata/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "firmata-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "firmata-tests.ts" + ] } \ No newline at end of file diff --git a/types/first-mate/README.md b/types/first-mate/README.md new file mode 100644 index 0000000000..e83328a13e --- /dev/null +++ b/types/first-mate/README.md @@ -0,0 +1,22 @@ +## First Mate Type Definitions + +TypeScript type definitions for [First Mate](https://github.com/atom/first-mate), which is published as "[first-mate](https://www.npmjs.com/package/first-mate)" on NPM. + +### Usage Notes + +#### Exports + +The three classes exported from this module are: [Grammar](https://github.com/atom/first-mate/blob/master/src/grammar.coffee), [GrammarRegistry](https://github.com/atom/first-mate/blob/master/src/grammar-registry.coffee), and [ScopeSelector](https://github.com/atom/first-mate/blob/master/src/scope-selector.coffee). + +```ts +import { Grammar, GrammarRegistry, ScopeSelector } from "first-mate"; +let selector = new ScopeSelector("a | b"); +``` + +#### The FirstMate Namespace + +Many of the types used by First Mate can be referenced from the FirstMate namespace. + +```ts +function example(grammar: FirstMate.Grammar) {} +``` diff --git a/types/first-mate/first-mate-tests.ts b/types/first-mate/first-mate-tests.ts index 1f7fe0fc76..b0fd70d4e2 100644 --- a/types/first-mate/first-mate-tests.ts +++ b/types/first-mate/first-mate-tests.ts @@ -1,10 +1,93 @@ +import { GrammarRegistry, Grammar, ScopeSelector } from "first-mate"; +declare let subscription: EventKit.Disposable; +declare let grammar: FirstMate.Grammar; +declare let grammars: FirstMate.Grammar[]; -import { GrammarRegistry, Grammar, IToken } from "first-mate"; +// NPM Examples =============================================================== +const selector = new ScopeSelector("a | b"); +selector.matches(["c"]); // # false +selector.matches(["a"]); // # true -var registry = new GrammarRegistry({ maxTokensPerLine: 100 }); -var grammar = registry.loadGrammarSync('javascript.json'); -var result = grammar.tokenizeLine('var text = "hello world";'); +const registry = new GrammarRegistry(); +grammar = registry.loadGrammarSync("./spec/fixtures/javascript.json"); +const { line, tags } = grammar.tokenizeLine("var offset = 3;"); +// Convert compact tags representation into convenient, space-inefficient tokens. +const tokens = registry.decodeTokens(line, tags); +for (const { value, scopes } of tokens) { + console.log(`Token text: '${value}' with scopes: ${scopes}`); +} + +// General Usage ============================================================== +let str: string; + +new GrammarRegistry({ maxTokensPerLine: 100 }); +registry.loadGrammarSync("javascript.json"); +const result = grammar.tokenizeLine('var text = "hello world";'); result.tokens.forEach((token) => { - console.log("Token text: '" + token.value + "' with scopes: " + token.scopes); + console.log(`Token text: '${token.value}' with scopes: ${token.scopes}`); +}); + +new ScopeSelector("source.file"); +let prefix = selector.getPrefix("test"); +if (prefix) { + str = prefix.charAt(0); +} +prefix = selector.getPrefix(["test", "test"]); + +str = selector.toCssSelector(); +str = selector.toCssSyntaxSelector(); + +// Grammar ==================================================================== +subscription = grammar.onDidUpdate(() => {}); + +const tokenizeLinesResult = grammar.tokenizeLines("Test String"); +for (const tokenizedLine of tokenizeLinesResult) { + for (const token of tokenizedLine) { + token.scopes; + token.value; + } +} + +grammar.tokenizeLine("Test String"); +const tokenizeLineResult = grammar.tokenizeLine("Test String", null, false); +tokenizeLineResult.line; +tokenizeLineResult.tags; +tokenizeLineResult.tokens; +grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack); +grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack, false); + +// Grammar Registry =========================================================== +// Event Subscription +subscription = registry.onDidAddGrammar(grammar => grammar.name); +subscription = registry.onDidUpdateGrammar(grammar => grammar.name); + +// Managing Grammars +grammars = registry.getGrammars(); + +let potentialGrammar = registry.grammarForScopeName("scope.test"); +if (potentialGrammar) grammar = potentialGrammar; + +subscription = registry.addGrammar(grammar); + +potentialGrammar = registry.removeGrammarForScopeName("scope.test"); + +grammar = registry.readGrammarSync("/test/path"); + +registry.readGrammar("/test/path", (error, grammar) => { + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } +}); + +grammar = registry.loadGrammarSync("/test/path"); + +registry.loadGrammar("/test/path", (error, grammar) => { + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } }); diff --git a/types/first-mate/index.d.ts b/types/first-mate/index.d.ts index 8087fe06f4..cf812b6add 100644 --- a/types/first-mate/index.d.ts +++ b/types/first-mate/index.d.ts @@ -1,107 +1,258 @@ -// Type definitions for first-mate v4.1.7 +// Type definitions for first-mate 7.x // Project: https://github.com/atom/first-mate/ -// Definitions by: Vadim Macagon +// Definitions by: GlenCFL // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// -import * as AtomEventKit from "event-kit"; -export = AtomFirstMate; +declare global { + /** TextMate helpers. */ + namespace FirstMate { + /** Objects that appear as parameters to functions. */ + namespace Options { + interface Grammar { + name?: string; + fileTypes?: ReadonlyArray; + scopeName?: string; + foldingStopMarker?: string; + maxTokensPerLine?: number; + maxLineLength?: number; -declare namespace AtomFirstMate { - type Disposable = AtomEventKit.Disposable; + injections?: object; + injectionSelector?: ScopeSelector; + patterns?: ReadonlyArray; + repository?: object; + firstLineMatch?: boolean; + } + } - interface IToken { - value: string; - scopes: string[]; + /** The static side to each exported class. Should generally only be used internally. */ + namespace Statics { + /* tslint:disable:no-unnecessary-qualifier */ + /** The static side to the Grammar class. */ + interface Grammar { + new (registry: FirstMate.GrammarRegistry, options?: FirstMate.Options.Grammar): + FirstMate.Grammar; + } + + /** The static side to the GrammarRegistry class. */ + interface GrammarRegistry { + new (options?: { maxTokensPerLine?: number, maxLineLength?: number }): + FirstMate.GrammarRegistry; + } + + /** The static side to the ScopeSelector class. */ + interface ScopeSelector { + /** Create a new scope selector. + * @param source The string to parse as a scope selector. + * @return A newly constructed ScopeSelector. + */ + new (source: string): FirstMate.ScopeSelector; + } + /* tslint:enable:no-unnecessary-qualifier */ + } + + /** Data structures that are used within classes. */ + namespace Structures { + interface GrammarToken { + value: string; + scopes: string[]; + } + + /** Result returned by `Grammar.tokenizeLine`. */ + interface TokenizeLineResult { + /** The string of text that was tokenized. */ + line: string; + + /** An array of integer scope ids and strings. Positive ids indicate the + * beginning of a scope, and negative tags indicate the end. To resolve ids + * to scope names, call {GrammarRegistry::scopeForId} with the absolute + * value of the id. + */ + tags: Array; + + /** This is a dynamic property. Invoking it will incur additional overhead, + * but will automatically translate the `tags` into token objects with `value` + * and `scopes` properties. + */ + tokens: GrammarToken[]; + + /** An array of rules representing the tokenized state at the end of the line. + * These should be passed back into this method when tokenizing the next line + * in the file. + */ + ruleStack: GrammarRule[]; + } + + interface GrammarRule { + // https://github.com/atom/first-mate/blob/v7.0.7/src/rule.coffee + // This is private. Don't go down the rabbit hole. + rule: object; + scopeName: string; + contentScopeName: string; + } + } + + /** Grammar that tokenizes lines of text. */ + interface Grammar { + name: string; + fileTypes: string[]; + scopeName: string; + maxTokensPerLine: number; + maxLineLength: number; + + // Event Subscription + onDidUpdate(callback: () => void): EventKit.Disposable; + + // Tokenizing + /** Tokenize all lines in the given text. + * @param text A string containing one or more lines. + * @return An array of token arrays for each line tokenized. + */ + tokenizeLines(text: string): Structures.GrammarToken[][]; + + /** Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack?: null, firstLine?: boolean): + Structures.TokenizeLineResult; + /** Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack: Structures.GrammarRule[], firstLine?: false): + Structures.TokenizeLineResult; + } + + /** Instance side of GrammarRegistry class. */ + interface GrammarRegistry { + maxTokensPerLine: number; + maxLineLength: number; + + // Event Subscription + /** Invoke the given callback when a grammar is added to the registry. + * @param callback The callback to be invoked whenever a grammar is added. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidAddGrammar(callback: (grammar: Grammar) => void): EventKit.Disposable; + + /** Invoke the given callback when a grammar is updated due to a grammar it + * depends on being added or removed from the registry. + * @param callback The callback to be invoked whenever a grammar is updated. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidUpdateGrammar(callback: (grammar: Grammar) => void): EventKit.Disposable; + + // Managing Grammars + /** Get all the grammars in this registry. + * @return A non-empty array of Grammar instances. + */ + getGrammars(): Grammar[]; + + /** Get a grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return A Grammar or undefined. + */ + grammarForScopeName(scopeName: string): Grammar|undefined; + + /** Add a grammar to this registry. + * A 'grammar-added' event is emitted after the grammar is added. + * @param grammar The Grammar to add. This should be a value previously returned + * from ::readGrammar or ::readGrammarSync. + * @return Returns a Disposable on which `.dispose()` can be called to remove + * the grammar. + */ + addGrammar(grammar: Grammar): EventKit.Disposable; + + /** Remove the given grammar from this registry. + * @param grammar The grammar to remove. This should be a grammar previously + * added to the registry from ::addGrammar. + */ + removeGrammar(grammar: Grammar): void; + + /** Remove the grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return Returns the removed Grammar or undefined. + */ + removeGrammarForScopeName(scopeName: string): Grammar|undefined; + + /** Read a grammar synchronously but don't add it to the registry. + * @param grammarPath The absolute file path to a grammar. + * @return The newly loaded Grammar. + */ + readGrammarSync(grammarPath: string): Grammar; + + /** Read a grammar asynchronously but don't add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in. + */ + readGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** Read a grammar synchronously and add it to this registry. + * @param grammarPath The absolute file path to the grammar. + * @return The newly loaded Grammar. + */ + loadGrammarSync(grammarPath: string): Grammar; + + /** Read a grammar asynchronously and add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in + * and added to the registry. + */ + loadGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** Convert compact tags representation into convenient, space-inefficient tokens. + * @param lineText The text of the tokenized line. + * @param tags The tags returned from a call to Grammar::tokenizeLine(). + * @return An array of Token instances decoded from the given tags. + */ + decodeTokens(lineText: string, tags: Array): Structures.GrammarToken[]; + } + + interface ScopeSelector { + /** Check if this scope selector matches the scopes. + * @param scopes A single scope or an array of them to be compared against. + * @return A boolean indicating whether or not this ScopeSelector matched. + */ + matches(scopes: string|ReadonlyArray): boolean; + + /** Gets the prefix of this scope selector. + * @param scopes The scopes to match a prefix against. + * @return The matching prefix, if there is one. + */ + getPrefix(scopes: string|ReadonlyArray): string|undefined; + + /** Convert this TextMate scope selector to a CSS selector. + * @return A string with the CSSSelector representation of this ScopeSelector. + */ + toCssSelector(): string; + + /** Convert this TextMate scope selector to a CSS selector, prefixing scopes + * with `syntax--`. + * @return A string with the syntax-specific CSSSelector representation of this + * ScopeSelector. + */ + toCssSyntaxSelector(): string; + } } +} - /** Result returned by `Grammar.tokenizeLine`. */ - interface TokenizeLineResult { - /** Text that was tokenized. */ - line: string; - tags: any[]; - /** - * This is a dynamic property that will only be available if `Grammar.tokenizeLine` was called - * with `compatibilityMode` set to `true` (the default). - */ - tokens?: IToken[]; - /** - * The tokenized state at the end of the line. This should be passed back into `tokenizeLine` - * when tokenizing the next line in the file/buffer. - */ - ruleStack: Rule[] - } +/** Registry containing one or more grammars. */ +export const GrammarRegistry: FirstMate.Statics.GrammarRegistry; - /** Instance side of Rule class. */ - interface Rule { - } +export const ScopeSelector: FirstMate.Statics.ScopeSelector; - /** Static side of Grammar class. */ - interface GrammarStatic { - prototype: Grammar; - new (registry: GrammarRegistry, options?: any): Grammar; - } - - /** Instance side of Grammar class. */ - interface Grammar { - constructor: GrammarStatic; - onDidUpdate(callback: Function): Disposable; - /** - * Tokenizes all lines in a string. - * - * @param text A string containing one or more lines. - * @return An array of token arrays, one token array per line. - */ - tokenizeLines(text: string): Array>; - /** - * Tokenizes a line of text. - * - * @param line Text to be tokenized. - * @param firstLine Indicates whether `line` is the first line in the file/buffer, - * defaults to `false`. - * @param compatibilityMode `true` by default. - * @return An object containing tokens for the given line. - */ - tokenizeLine( - line: string, ruleStack?: Rule[], firstLine?: boolean, compatibilityMode?: boolean - ): TokenizeLineResult; - } - - /** Grammar that tokenizes lines of text. */ - var Grammar: GrammarStatic; - - /** Static side of GrammarRegistry class. */ - interface GrammarRegistryStatic { - prototype: GrammarRegistry; - new (options?: { maxTokensPerLine: number }): GrammarRegistry; - } - - /** Instance side of GrammarRegistry class. */ - interface GrammarRegistry { - constructor: GrammarRegistryStatic; - - // Event Subscription - - onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable; - onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable; - - // Managing Grammars - - getGrammars(): Grammar[]; - grammarForScopeName(scopeName: string): Grammar; - addGrammar(grammar: Grammar): Disposable; - removeGrammarForScopeName(scopeName: string): Grammar; - readGrammarSync(grammarPath: string): Grammar; - readGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void; - loadGrammarSync(grammarPath: string): Grammar; - loadGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void; - grammarOverrideForPath(filePath: string): Grammar; - setGrammarOverrideForPath(filePath: string, scopeName: string): Grammar; - clearGrammarOverrides(): void; - selectGrammar(filePath: string, fileContents: string): Grammar; - } - - /** Registry containing one or more grammars. */ - var GrammarRegistry: GrammarRegistryStatic; -} \ No newline at end of file +/** Grammar that tokenizes lines of text. */ +export const Grammar: FirstMate.Statics.Grammar; diff --git a/types/first-mate/tsconfig.json b/types/first-mate/tsconfig.json index b8ae8bf954..3d6aadabec 100644 --- a/types/first-mate/tsconfig.json +++ b/types/first-mate/tsconfig.json @@ -7,7 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/first-mate/tslint.json b/types/first-mate/tslint.json new file mode 100644 index 0000000000..4b036f727a --- /dev/null +++ b/types/first-mate/tslint.json @@ -0,0 +1,37 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Custom rules. + "class-name": true, + "indent": [true, "tabs"], + "jsdoc-format": true, + "max-line-length": [true, 100], + "quotemark": [true, "double", "avoid-escape"], + "trailing-comma": [true, { + "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, + "singleline": { "objects": "never", "arrays": "never", "functions": "never" } + }], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type", + "check-typecast", + "check-rest-spread", + "check-preblock" + ], + // Soon to be defaults. + "arrow-return-shorthand": [true, "multiline"], + "no-any": true, + "no-floating-promises": true, + "no-unbound-method": true, + "no-unsafe-any": true, + "number-literal-format": true, + "restrict-plus-operands": true, + "return-undefined": true, + "switch-final-break": true + } +} diff --git a/types/first-mate/.editorconfig b/types/first-mate/v4/.editorconfig similarity index 100% rename from types/first-mate/.editorconfig rename to types/first-mate/v4/.editorconfig diff --git a/types/first-mate/v4/first-mate-tests.ts b/types/first-mate/v4/first-mate-tests.ts new file mode 100644 index 0000000000..1f7fe0fc76 --- /dev/null +++ b/types/first-mate/v4/first-mate-tests.ts @@ -0,0 +1,10 @@ + + +import { GrammarRegistry, Grammar, IToken } from "first-mate"; + +var registry = new GrammarRegistry({ maxTokensPerLine: 100 }); +var grammar = registry.loadGrammarSync('javascript.json'); +var result = grammar.tokenizeLine('var text = "hello world";'); +result.tokens.forEach((token) => { + console.log("Token text: '" + token.value + "' with scopes: " + token.scopes); +}); diff --git a/types/first-mate/v4/index.d.ts b/types/first-mate/v4/index.d.ts new file mode 100644 index 0000000000..81b7d96c04 --- /dev/null +++ b/types/first-mate/v4/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for first-mate v4.1.7 +// Project: https://github.com/atom/first-mate/ +// Definitions by: Vadim Macagon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as AtomEventKit from "event-kit"; +export = AtomFirstMate; + +declare namespace AtomFirstMate { + type Disposable = AtomEventKit.Disposable; + + interface IToken { + value: string; + scopes: string[]; + } + + /** Result returned by `Grammar.tokenizeLine`. */ + interface TokenizeLineResult { + /** Text that was tokenized. */ + line: string; + tags: any[]; + /** + * This is a dynamic property that will only be available if `Grammar.tokenizeLine` was called + * with `compatibilityMode` set to `true` (the default). + */ + tokens?: IToken[]; + /** + * The tokenized state at the end of the line. This should be passed back into `tokenizeLine` + * when tokenizing the next line in the file/buffer. + */ + ruleStack: Rule[] + } + + /** Instance side of Rule class. */ + interface Rule { + } + + /** Static side of Grammar class. */ + interface GrammarStatic { + prototype: Grammar; + new (registry: GrammarRegistry, options?: any): Grammar; + } + + /** Instance side of Grammar class. */ + interface Grammar { + constructor: GrammarStatic; + onDidUpdate(callback: Function): Disposable; + /** + * Tokenizes all lines in a string. + * + * @param text A string containing one or more lines. + * @return An array of token arrays, one token array per line. + */ + tokenizeLines(text: string): Array>; + /** + * Tokenizes a line of text. + * + * @param line Text to be tokenized. + * @param firstLine Indicates whether `line` is the first line in the file/buffer, + * defaults to `false`. + * @param compatibilityMode `true` by default. + * @return An object containing tokens for the given line. + */ + tokenizeLine( + line: string, ruleStack?: Rule[], firstLine?: boolean, compatibilityMode?: boolean + ): TokenizeLineResult; + } + + /** Grammar that tokenizes lines of text. */ + var Grammar: GrammarStatic; + + /** Static side of GrammarRegistry class. */ + interface GrammarRegistryStatic { + prototype: GrammarRegistry; + new (options?: { maxTokensPerLine: number }): GrammarRegistry; + } + + /** Instance side of GrammarRegistry class. */ + interface GrammarRegistry { + constructor: GrammarRegistryStatic; + + // Event Subscription + + onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable; + onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable; + + // Managing Grammars + + getGrammars(): Grammar[]; + grammarForScopeName(scopeName: string): Grammar; + addGrammar(grammar: Grammar): Disposable; + removeGrammarForScopeName(scopeName: string): Grammar; + readGrammarSync(grammarPath: string): Grammar; + readGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void; + loadGrammarSync(grammarPath: string): Grammar; + loadGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void; + grammarOverrideForPath(filePath: string): Grammar; + setGrammarOverrideForPath(filePath: string, scopeName: string): Grammar; + clearGrammarOverrides(): void; + selectGrammar(filePath: string, fileContents: string): Grammar; + } + + /** Registry containing one or more grammars. */ + var GrammarRegistry: GrammarRegistryStatic; +} diff --git a/types/first-mate/v4/tsconfig.json b/types/first-mate/v4/tsconfig.json new file mode 100644 index 0000000000..59868ddb2c --- /dev/null +++ b/types/first-mate/v4/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "event-kit": [ + "event-kit/v1" + ], + "first-mate": [ + "first-mate/v4" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "first-mate-tests.ts" + ] +} \ No newline at end of file diff --git a/types/fixed-data-table/tsconfig.json b/types/fixed-data-table/tsconfig.json index 622eaa1d36..02ba840d0b 100644 --- a/types/fixed-data-table/tsconfig.json +++ b/types/fixed-data-table/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [ diff --git a/types/flake-idgen/tsconfig.json b/types/flake-idgen/tsconfig.json index 32c2e540f0..0275fb0c23 100644 --- a/types/flake-idgen/tsconfig.json +++ b/types/flake-idgen/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flat/tsconfig.json b/types/flat/tsconfig.json index 19684cdd32..7cc1467b3f 100644 --- a/types/flat/tsconfig.json +++ b/types/flat/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flatbuffers/tsconfig.json b/types/flatbuffers/tsconfig.json index 9d60089890..fe3421fa5b 100644 --- a/types/flatbuffers/tsconfig.json +++ b/types/flatbuffers/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flatpickr/tsconfig.json b/types/flatpickr/tsconfig.json index f74514f614..7980eb3627 100644 --- a/types/flatpickr/tsconfig.json +++ b/types/flatpickr/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flatpickr/v2/tsconfig.json b/types/flatpickr/v2/tsconfig.json index 704678c0fd..844aea45cd 100644 --- a/types/flatpickr/v2/tsconfig.json +++ b/types/flatpickr/v2/tsconfig.json @@ -8,12 +8,15 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" ], "paths": { - "flatpickr": [ "flatpickr/v2" ] + "flatpickr": [ + "flatpickr/v2" + ] }, "types": [], "noEmit": true, @@ -23,4 +26,4 @@ "index.d.ts", "flatpickr-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/flexslider/tsconfig.json b/types/flexslider/tsconfig.json index 12c0cc9692..4ced617dd6 100644 --- a/types/flexslider/tsconfig.json +++ b/types/flexslider/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "flexslider-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/flickity/FlickityEvents.ts b/types/flickity/FlickityEvents.ts deleted file mode 100644 index 4beb5989b6..0000000000 --- a/types/flickity/FlickityEvents.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Event Constants for Flickity v1.1.1 -// Project: http://flickity.metafizzy.co/ -// Definitions by: Chris McGrath -// Definitions: https://github.com/clmcgrath/ -class FlickityEvents { - - /** - * Triggered when a cell is selected. - */ - static cellSelect: string = "cellSelect"; - - /** - * Triggered when the slider is settled at its end position. - */ - static settle: string = "settle"; - - /** - * Triggered when dragging starts and the slider starts moving. - */ - static dragStart: string = "dragStart"; - - /** - * Triggered when dragging moves and the slider moves. - */ - static dragMove: string = "dragMove"; - - /** - * Triggered when dragging ends. - */ - static dragEnd: string = "dragEnd"; - - /** - * Triggered when the user's pointer (mouse, touch, pointer) presses down. - */ - static pointerDown: string = "pointerDown"; - - /** - * Triggered when the user's pointer moves. - */ - static pointerMove: string = "pointerMove"; - - /** - * Triggered when the user's pointer unpresses. - */ - static pointerUp: string = "pointerUp"; - - /** - * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. - * Info: click events are hard to detect with draggable UI, as they are triggered whenever a user drags. Flickity's staticClick event resolves this, as it is triggered when the user has not dragged. - */ - static staticClick: string = "staticClick"; - - /** - * Triggered after an image has been loaded with lazyLoad. - */ - static lazyLoad: string = "lazyLoad"; -} diff --git a/types/flickity/UNUSED_FILES.txt b/types/flickity/UNUSED_FILES.txt deleted file mode 100644 index 38f951f166..0000000000 --- a/types/flickity/UNUSED_FILES.txt +++ /dev/null @@ -1 +0,0 @@ -FlickityEvents.ts \ No newline at end of file diff --git a/types/flickity/flickity-tests.ts b/types/flickity/flickity-tests.ts index b4ecf51997..63943119b4 100644 --- a/types/flickity/flickity-tests.ts +++ b/types/flickity/flickity-tests.ts @@ -1,14 +1,8 @@ -// Type definition tests for Flickity v1.1.1 -// Project: http://flickity.metafizzy.co/ -// Definitions by: Chris McGrath -// Definitions: https://github.com/clmcgrath/ +/// -/// +// jQuery tests -//jQuery tests - -var $flickity: JQuery = $("#flickity-selector").flickity( - { +let $flickity = $("#flickity-selector").flickity({ initialIndex: 0, accessibility: true, asNavFor: "#nav-bar", @@ -35,12 +29,12 @@ var $flickity: JQuery = $("#flickity-selector").flickity( }); $flickity.flickity("next") - .flickity('select', 4); + .flickity("select", 4); -//Vanilla jQuery tests -var flikty: Flickity = new Flickity("#flickity-gallery"); +// Vanilla jQuery tests +let flikty: Flickity = new Flickity("#flickity-gallery"); -var flikty2: Flickity = +let flikty2: Flickity = new Flickity("#flickity-gallery", { initialIndex: 0, @@ -68,10 +62,10 @@ var flikty2: Flickity = rightToLeft: false }); -//ES6 element selector for tests -var element = document.querySelector("#gallery"); -var nodeList = document.querySelectorAll("#gallery"); -var cellElements: Array = flikty2.getCellElements(); +// ES6 element selector for tests +let element = document.querySelector("#gallery"); +let nodeList = document.querySelectorAll("#gallery"); +let cellElements: Element[] = flikty2.getCellElements(); flikty2.select(1, true); flikty2.select(1); @@ -102,33 +96,47 @@ flikty2.destroy(); flikty2.reloadCells(); -//event handlers +// event handlers flikty2.on("cellSelect", (evt, ele) => { - //do something + // do something }); flikty2.off("cellSelect", (evt, ele, pntr, vctr) => { - //do something + // do something }); flikty2.once("cellSelect", (evt, ele, pntr) => { - //do something + // do something }); flikty2.listener("myCustomEvent", (evt: Event) => { - //do something + // do something }); -//static get data methods +// static get data methods -var jQdata = jQuery.fn.data('flickity')(); -jQdata = $.fn.data('flickity')(); +let jQdata = jQuery.fn.data("flickity")(); +jQdata = $.fn.data("flickity")(); -var jsData = Flickity.data("#gallery"); +let jsData = Flickity.data("#gallery"); jsData = Flickity.data("#gallery"); -//property tests -var selectedIndex: number = flikty2.selectedIndex; +// property tests +let selectedIndex: number = flikty2.selectedIndex; -var selectedElement: Element = flikty2.selectedElement; -var cells: Array = flikty2.cells; +let selectedElement: Element = flikty2.selectedElement; +let cells: Element[] = flikty2.cells; + +// arrow shape tests +let flikty3: Flickity = new Flickity("#flickity-gallery", { + arrowShape: "M 0,50 L 60,00 L 50,30 L 80,30 L 80,70 L 50,70 L 60,100 Z" +}); + +let flikty4: Flickity = new Flickity(new HTMLElement(), { + arrowShape: { + x0: 10, + x1: 60, y1: 50, + x2: 70, y2: 40, + x3: 30 + } +}); diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index 24a873761d..fda440b1fe 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -1,409 +1,513 @@ -// Type definitions for Flickity v1.1.1 +// Type definitions for Flickity 2.0 // Project: http://flickity.metafizzy.co/ -// Definitions by: Chris McGrath -// Definitions: https://github.com/clmcgrath/ +// Definitions by: Chris McGrath +// Michael Wagner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +export as namespace Flickity; +export = Flickity; -interface JQuery { - /** - * initialize fickity plugin - */ - flickity: FlickityJquery; +declare global { + interface JQuery { + flickity(options?: FlickityOptions): this; + flickity(command: string, ...params: any[]): this; + } } -interface FlickityJquery { - (options?: FlickityOptions): JQuery; - (command: string, ...params: any[]): JQuery; +declare namespace Flickity { + type FlickityEvents = + /** + * Triggered when a slide is selected. + * This event was previously cellSelect in Flickity v1. cellSelect will continue to work in Flickity v2. + */ + "select" | "cellSelect" | + /** + * Triggered when the slider is settled at its end position. + */ + "settle" | + /** + * Triggered when the slider moves. + */ + "scroll" | + /** + * Triggered when dragging starts and the slider starts moving. + */ + "dragStart" | + /** + * Triggered when dragging moves and the slider moves. + */ + "dragMove" | + /** + * Triggered when dragging ends. + */ + "dragEnd" | + /** + * Triggered when the user's pointer (mouse, touch, pointer) presses down. + */ + "pointerDown" | + /** + * Triggered when the user's pointer moves. + */ + "pointerMove" | + /** + * Triggered when the user's pointer unpresses. + */ + "pointerUp" | + /** + * Triggered when the user's pointer is pressed and unpressed and has not moved enough to start dragging. + */ + "staticClick" | + /** + * Triggered after an image has been loaded with lazyLoad. + */ + "lazyLoad" | + /** + * Triggered after a background image has been loaded with bgLazyLoad. + */ + "bgLazyLoad"; } declare class Flickity { /** - * Initializes an new instance of Flickity . - * - * @param element Element selector string - * @param options (IFlickityOptions) Flickity options - */ - constructor(selector: string, options?: FlickityOptions); - /** - * Initializes an new instance of Flickity . - * - * @param element Container Element to initialize Flickity on - * @param options (IFlickityOptions) Flickity options - */ - constructor(element: Element, options?: FlickityOptions); + * Initializes an new instance of Flickity . + * + * @param element Element selector string or container Element to initialize Flickity on + * @param options (IFlickityOptions) Flickity options + */ + constructor(selector: string | Element, options?: FlickityOptions); - //properties + // properties /** - * @type integer - * The selected cell index. - */ + * @type integer + * The selected cell index. + */ selectedIndex: number; /** - * @type Element - * The selected cell element. - */ + * @type Element + * The selected cell element. + */ selectedElement: Element; /** - * @type Element[] - * The array of cells. Use cells.length for the total number of cells. - */ + * @type Element[] + * The array of cells. Use cells.length for the total number of cells. + */ cells: Element[]; + /** + * The array of slides. Useful for groupCells. A slide contains multiple cells. + * If groupCells is disabled, then each slide is a cell, so they are one in the same. + */ + slides: Element[]; + + /** + * An array of elements in the selected slide. Useful for groupCells. + */ + selectedElements: Element[]; + // static methods /** - * (static) Get the Flickity instance via selector. - * - * @param element Element selector string - */ - static data(element: string): Flickity; - - /** - * (static) Get the Flickity instance via its element. - * - * @param element The element - */ - static data(element: Element): Flickity; - + * (static) Get the Flickity instance. + * + * @param element Element selector string + */ + static data(element: string | Element): Flickity; // instance methods /** - * Select a cell. - * - * @param index Integer Zero-based index of the cell to select. - * @param isWrapped (Optional) If true, the last cell will be selected if at the first cell. - * @param isInstant (Optional) If true, immediately view the selected cell without animation. - */ + * Select a cell. + * + * @param index Integer Zero-based index of the cell to select. + * @param isWrapped (Optional) If true, the last cell will be selected if at the first cell. + * @param isInstant (Optional) If true, immediately view the selected cell without animation. + */ select(index: number, isWrapped?: boolean, isInstant?: boolean): void; /** - * Select the previous cell. - * - * @param isWrapped (Optional) If true, the first cell will be selected if at the last cell. - */ + * Select the previous cell. + * + * @param isWrapped (Optional) If true, the first cell will be selected if at the last cell. + */ previous(isWrapped?: boolean): void; /** - * Select the next cell. - * @param isWrapped (Optional) If true, the first cell will be selected if at the first cell. - */ + * Select the next cell. + * @param isWrapped (Optional) If true, the first cell will be selected if at the first cell. + */ next(isWrapped?: boolean): void; /** - * Resize the gallery and re-position cells. - */ + * Select a slide of a cell. Useful for groupCells. + * + * @param {number | string} index Zero-based index OR selector string of the cell to select. + * @param {boolean} [isWrapped] Optional. If true, the last slide will be selected if at the first slide. + * @param {boolean} [isInstant] If true, immediately view the selected slide without animation. + * @memberof Flickity + */ + selectCell(index: number | string, isWrapped?: boolean, isInstant?: boolean): void; + + /** + * Resize the gallery and re-position cells. + */ resize(): void; /** - * Position cells at selected position. - * Trigger reposition after the size of a cell has been changed. - */ + * Position cells at selected position. + * Trigger reposition after the size of a cell has been changed. + */ reposition(): void; /** - * Prepend elements and create cells to the beginning of the gallery. - * - * @param elements JQuery, Element[], Element, or NodeList - */ - prepend(elements: Element | NodeList): void; + * Prepend elements and create cells to the beginning of the gallery. + * + * @param elements JQuery, Element[], Element, or NodeList + */ + prepend(elements: JQuery | Element[] | Element | NodeList): void; /** - * Append elements and create cells to the end of the gallery. - * - * @param elements JQuery, Element[], Element, or NodeList - */ - append(elements: Element | NodeList): void; + * Append elements and create cells to the end of the gallery. + * + * @param elements JQuery, Element[], Element, or NodeList + */ + append(elements: JQuery | Element[] | Element | NodeList): void; /** - * Insert elements into the gallery and create cells. - * - * @param elements Element[], Element, or NodeList - * @param index Integer: Zero-based index to insert elements. - */ - insert(elements: Element[] | Element | NodeList, index: number): void; + * Insert elements into the gallery and create cells. + * + * @param elements Element[], Element, or NodeList + * @param index Integer: Zero-based index to insert elements. + */ + insert(elements: JQuery | Element[] | Element | NodeList, index: number): void; /** - * Remove cells from gallery and remove elements from DOM. - * - * @param elements Element[], Element, or NodeList - */ - remove(elements: Element[] | Element | NodeList): void; + * Remove cells from gallery and remove elements from DOM. + * + * @param elements Element[], Element, or NodeList + */ + remove(elements: JQuery | Element[] | Element | NodeList): void; /** - * Remove Flickity functionality completely. destroy will return the element back to its pre-initialized state. - */ + * Starts auto-play. Setting autoPlay will automatically start auto-play on initialization. You do not need to start auto-play with playPlayer. + */ + playPlayer(): void; + + /** + * Stops auto-play and cancels pause. + */ + stopPlayer(): void; + + /** + * Pauses auto-play. + */ + pausePlayer(): void; + + /** + * Resumes auto-play if paused. + */ + unpausePlayer(): void; + + /** + * Remove Flickity functionality completely. destroy will return the element back to its pre-initialized state. + */ destroy(): void; /** - * Re-collect all cell elements in flickity-slider. - */ + * Re-collect all cell elements in flickity-slider. + */ reloadCells(): void; /** - * Get the elements of the cells. - * @returns Element[] - */ - getCellElements() : Element[]; + * Get the elements of the cells. + * @returns Element[] + */ + getCellElements(): Element[]; - //event listeners + // event listeners /** - * Add new classic event listener - */ + * Add new classic event listener + */ listener(...params: any[]): void; /** - * bind event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - on(eventname: string, callback: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: number) => any): void; + * bind event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + on(eventname: Flickity.FlickityEvents, callback: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: number) => any): void; /** - * bind event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - on(eventname: string, callback: (event?: Event, pointer?: Element | Touch, moveVector?: Object) => any): void; + * bind event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + on(eventname: Flickity.FlickityEvents, callback: (event?: Event, pointer?: Element | Touch, moveVector?: { x: number, y: number }) => any): void; /** - * bind event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - on(eventname: string, callback: (eventt?: Event, cellElement?: Element) => any) : void; + * bind event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + on(eventname: Flickity.FlickityEvents, callback: (event?: Event, cellElement?: Element) => any): void; /** - * bind event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - on(eventname: string, callback: (event?: Event, pointer?: Element | Touch) => any): void; + * bind event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + on(eventname: Flickity.FlickityEvents, callback: (event?: Event, pointer?: Element | Touch) => any): void; /** - * Remove event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - off(eventname: string, callback: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: number) => any): void; + * Remove event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + off(eventname: Flickity.FlickityEvents, callback: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: number) => any): void; /** - * Remove event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - off(eventname: string, callback: (event?: Event, pointer?: Element | Touch, moveVector?: Object) => any): void; + * Remove event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + off(eventname: Flickity.FlickityEvents, callback: (event?: Event, pointer?: Element | Touch, moveVector?: Object) => any): void; /** - * Remove event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - off(eventname: string, callback: (event?: Event, cellElement?: Element) => any): void; + * Remove event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + off(eventname: Flickity.FlickityEvents, callback: (event?: Event, cellElement?: Element) => any): void; /** - * Remove event listener - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ - off(eventname: string, callback: (event?: Event, pointer?: Element | Touch) => any): void; - + * Remove event listener + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ + off(eventname: Flickity.FlickityEvents, callback: (event?: Event, pointer?: Element | Touch) => any): void; /** - * one time event handler - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ + * one time event handler + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ once(eventname: string, callback: (event?: Event, pointer?: Element | Touch, cellElement?: Element, cellIndex?: number) => any): void; /** - * one time event handler - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ + * one time event handler + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ once(eventname: string, callback: (event?: Event, pointer?: Element | Touch, moveVector?: Object) => any): void; /** - * one time event handler - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ + * one time event handler + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ once(eventname: string, callback: (event?: Event, cellElement?: Element) => any): void; /** - * one time event handler - * @param eventName name of event (@see FlickityEvents class for filckity supported events) - * @param callback callback funtion to execute when event fires - */ + * one time event handler + * @param eventName name of event (@see Flickity.FlickityEvents class for filckity supported events) + * @param callback callback funtion to execute when event fires + */ once(eventname: string, callback: (event?: Event, pointer?: Element | Touch) => any): void; } interface FlickityOptions { - /** - * Specify selector for cell elements. cellSelector is useful if you have other elements in your gallery elements that are not cells. - * - * default: '.gallery-cell' - */ + * Specify selector for cell elements. cellSelector is useful if you have other elements in your gallery elements that are not cells. + * + * default: '.gallery-cell' + */ cellSelector?: string; /** - * Zero-based index of the initial selected cell. - * - * default: 2 - */ + * Zero-based index of the initial selected cell. + */ initialIndex?: number; /** - * Enable keyboard navigation. Users can tab to a Flickity gallery, and pressing left & right keys to change cells. - * - * default: true - */ + * Enable keyboard navigation. Users can tab to a Flickity gallery, and pressing left & right keys to change cells. + * + * default: true + */ accessibility?: boolean; /** - * Sets the height of the gallery to the height of the tallest cell. Set to false if you prefer to size the gallery with CSS, rather than using the size of cells. - * - * default: true - */ + * Sets the height of the gallery to the height of the tallest cell. Set to false if you prefer to size the gallery with CSS, rather than using the size of cells. + * + * default: true + */ setGallerySize?: boolean; /** - * Adjusts sizes and positions when window is resized. - * - * default: true - */ + * Adjusts sizes and positions when window is resized. + * + * default: true + */ resize?: boolean; /** - * Align cells within the gallery element. - * opttions: 'left', 'center', 'right' - * - * default: 'center' - */ + * Align cells within the gallery element. + * opttions: 'left', 'center', 'right' + * + * default: 'center' + */ cellAlign?: string; /** - * Contains cells to gallery element to prevent excess scroll at beginning or end. Has no effect if wrapAround is enabled - * - * default: true - */ + * Contains cells to gallery element to prevent excess scroll at beginning or end. Has no effect if wrapAround is enabled + * + * default: true + */ contain?: boolean; /** - * Unloaded images have no size, which can throw off cell positions. To fix this, the imagesLoaded option re-positions cells once their images have loaded. - * - * default: true - */ + * Unloaded images have no size, which can throw off cell positions. To fix this, the imagesLoaded option re-positions cells once their images have loaded. + * + * default: true + */ imagesLoaded?: boolean; /** - * Sets positioning in percent values, rather than pixel values. If your cells do not have percent widths, we recommended percentPosition: false. - * - * default: false - */ + * Sets positioning in percent values, rather than pixel values. If your cells do not have percent widths, we recommended percentPosition: false. + * + * default: false + */ percentPosition?: boolean; /** - * Enables right-to-left layout. - * - * default: false - */ + * Enables right-to-left layout. + * + * default: false + */ rightToLeft?: boolean; /** - * Enables dragging and flicking - * - * default: true - */ + * Enables dragging and flicking + * + * default: true + */ draggable?: boolean; /** - * Enables content to be freely scrolled and flicked without aligning cells to an end position. - * Enable freeScroll and wrapAround and you can flick forever, man. - * - * default: false - */ + * Enables content to be freely scrolled and flicked without aligning cells to an end position. + * Enable freeScroll and wrapAround and you can flick forever, man. + * + * default: false + */ freeScroll?: boolean; /** - * At the end of cells, wrap-around to the other end for infinite scrolling. - * - * default: false - */ + * At the end of cells, wrap-around to the other end for infinite scrolling. + * + * default: false + */ wrapAround?: boolean; /** - * Loads cell images when a cell is selected. - * Set the image's URL to load with data-flickity-lazyload. - * - * default: false - */ + * Groups cells together in slides. Flicking, page dots, and previous/next buttons are mapped to group slides, not individual cells. + * `is-selected` class is added to the multiple cells in the selected slide. + * If set to true, group cells that fit in carousel viewport. + * If set to a number, group cells by that number. + * If set to a percent string, group cells that fit in the percent of the width of the carousel viewport. + */ + groupCells?: boolean | number | string; + + /** + * Loads cell images when a cell is selected. + * Set the image's URL to load with the `data-flickity-lazyload` attribute. + * If set to `true`, lazyloads image in selected slide + * If set to a number n, load images in selected slide and next n slides and previous n slides. + * + * default: false + */ lazyLoad?: boolean | number; /** - * Automatically advances to the next cell. - * - * default: false - */ + * Loads cell background image when a cell is selected. + * Set the background image's URL to load with the `data-flickity-bg-lazyload` attribute. + * If set to `true`, lazyloads background image in selected slide + * If set to a number n, load background images in selected slide and next n slides and previous n slides. + * bgLazyLoad requires the flickity-bg-lazyload package. This package is not included and must be installed separately. + */ + bgLazyLoad?: boolean | number; + + /** + * Automatically advances to the next cell. + * + * default: false + */ autoPlay?: boolean | number; /** - * You can enable and disable Flickity with CSS. watchCSS option watches the content of :after of the gallery element. Flickity is enabled if :after content is 'flickity'. - * note: IE8 and Android 2.3 do not support watching :after. Flickity will be disabled when watchCSS: true. Set watchCSS: 'fallbackOn' to enable Flickity for these browsers. - * - * default: false - */ + * Changes height of carousel to fit height of selected slide. + */ + adaptiveHeight?: boolean; + + /** + * You can enable and disable Flickity with CSS. watchCSS option watches the content of :after of the gallery element. Flickity is enabled if :after content is 'flickity'. + * note: IE8 and Android 2.3 do not support watching :after. Flickity will be disabled when watchCSS: true. Set watchCSS: 'fallbackOn' to enable Flickity for these browsers. + * + * default: false + */ watchCSS?: boolean | string; /** - * Use one Flickity gallery as navigation for another. - * - * default: disabled - */ + * Use one Flickity gallery as navigation for another. + * + * default: disabled + */ asNavFor?: string; /** - * selectedAttraction attracts the position of the slider to the selected cell. Higher attraction makes the slider move faster. Lower makes it move slower. - * - * default: 0.025 - */ + * The number of pixels a mouse or touch has to move before dragging begins. Increase dragThreshold to allow for more wiggle room for vertical page scrolling on touch devices. + * + * default: 3 + */ + dragThreshold?: number; + + /** + * selectedAttraction attracts the position of the slider to the selected cell. Higher attraction makes the slider move faster. Lower makes it move slower. + * + * default: 0.025 + */ selectedAttraction?: number; /** - * riction slows the movement of slider. Higher friction makes the slider feel stickier and less bouncy. Lower friction makes the slider feel looser and more wobbly. - * - * default: 0.28 - */ + * Friction slows the movement of slider. Higher friction makes the slider feel stickier and less bouncy. Lower friction makes the slider feel looser and more wobbly. + * + * default: 0.28 + */ friction?: number; /** - * Slows movement of slider when freeScroll: true. Higher friction makes the slider feel stickier. Lower friction makes the slider feel looser. - * - * default: 0.75 - */ + * Slows movement of slider when freeScroll: true. Higher friction makes the slider feel stickier. Lower friction makes the slider feel looser. + * + * default: 0.075 + */ freeScrollFriction?: number; /** - * Creates and enables previous & next buttons. - * - * default: true - */ + * Creates and enables previous & next buttons. + * + * default: true + */ prevNextButtons?: boolean; /** - * Creates and enables paging dots. - * - * default: true - */ + * Creates and enables paging dots. + * + * default: true + */ pageDots?: boolean; /** - * Draws the shape of the arrows in the previous & next buttons. - * javascript dictionary of points or path to SVG file - */ - arrowShape?: any; - + * Draws the shape of the arrows in the previous & next buttons. + * javascript dictionary of points or path to SVG file + */ + arrowShape?: string | { x0: number, x1: number, y1: number, x2: number, y2: number, x3: number }; } diff --git a/types/flickity/tsconfig.json b/types/flickity/tsconfig.json index 6123aa5990..e6d8dcef00 100644 --- a/types/flickity/tsconfig.json +++ b/types/flickity/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flickity/tslint.json b/types/flickity/tslint.json new file mode 100644 index 0000000000..6898aee207 --- /dev/null +++ b/types/flickity/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false, + "no-single-declare-module": false, + "no-var": false, + "unified-signatures": false + } + } \ No newline at end of file diff --git a/types/flight/tsconfig.json b/types/flight/tsconfig.json index ef6310f96d..18060e6903 100644 --- a/types/flight/tsconfig.json +++ b/types/flight/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flightplan/tsconfig.json b/types/flightplan/tsconfig.json index 5fe870dd59..be4eb41ec5 100644 --- a/types/flightplan/tsconfig.json +++ b/types/flightplan/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flipsnap/tsconfig.json b/types/flipsnap/tsconfig.json index d8b39baa72..435b186eb4 100644 --- a/types/flipsnap/tsconfig.json +++ b/types/flipsnap/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flot/tsconfig.json b/types/flot/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/flot/tsconfig.json +++ b/types/flot/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flowjs/tsconfig.json b/types/flowjs/tsconfig.json index b00c01cc54..e797332c13 100644 --- a/types/flowjs/tsconfig.json +++ b/types/flowjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts index e45f8ff855..53b095a8b2 100644 --- a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts +++ b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts @@ -50,3 +50,7 @@ command.clone() // Save a converted version with the original size command.save('/path/to/output-original-size.mp4'); + +ffmpeg.ffprobe('/path/to/file.avi', (err, metadata) => { + console.dir(metadata); +}); diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 65bacff53e..79d91cf7ed 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -282,10 +282,10 @@ declare namespace Ffmpeg { // ffprobe /* tslint:disable:unified-signatures */ - ffprobe(callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; - ffprobe(index: number, callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; - ffprobe(options: string[], callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; - ffprobe(index: number, options: string[], callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; + ffprobe(callback: (err: any, data: FfprobeData) => void): void; + ffprobe(index: number, callback: (err: any, data: FfprobeData) => void): void; + ffprobe(options: string[], callback: (err: any, data: FfprobeData) => void): void; + ffprobe(index: number, options: string[], callback: (err: any, data: FfprobeData) => void): void; /* tslint:enable:unified-signatures */ // recipes @@ -305,6 +305,13 @@ declare namespace Ffmpeg { clone(): FfmpegCommand; run(): void; } + + /* tslint:disable:unified-signatures */ + function ffprobe(file: string, callback: (err: any, data: FfprobeData) => void): void; + function ffprobe(file: string, index: number, callback: (err: any, data: FfprobeData) => void): void; + function ffprobe(file: string, options: string[], callback: (err: any, data: FfprobeData) => void): void; + function ffprobe(file: string, index: number, options: string[], callback: (err: any, data: FfprobeData) => void): void; + /* tslint:enable:unified-signatures */ } declare function Ffmpeg(options?: Ffmpeg.FfmpegCommandOptions): Ffmpeg.FfmpegCommand; declare function Ffmpeg(input?: string | stream.Readable, options?: Ffmpeg.FfmpegCommandOptions): Ffmpeg.FfmpegCommand; diff --git a/types/fluent-ffmpeg/tsconfig.json b/types/fluent-ffmpeg/tsconfig.json index 03dae683d6..657e97adf6 100644 --- a/types/fluent-ffmpeg/tsconfig.json +++ b/types/fluent-ffmpeg/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "fluent-ffmpeg-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fluent-ffmpeg-tests.ts" + ] +} \ No newline at end of file diff --git a/types/flux-standard-action/tsconfig.json b/types/flux-standard-action/tsconfig.json index 74ce6e361f..050e130d5a 100644 --- a/types/flux-standard-action/tsconfig.json +++ b/types/flux-standard-action/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/flux/tsconfig.json b/types/flux/tsconfig.json index 540faa9d2b..dd78eff24c 100644 --- a/types/flux/tsconfig.json +++ b/types/flux/tsconfig.json @@ -14,6 +14,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, "noEmit": true }, diff --git a/types/fluxxor/tsconfig.json b/types/fluxxor/tsconfig.json index e6bbcbc2ac..7bc0068190 100644 --- a/types/fluxxor/tsconfig.json +++ b/types/fluxxor/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fm-websync/tsconfig.json b/types/fm-websync/tsconfig.json index 1ec64935da..c0b2f14445 100644 --- a/types/fm-websync/tsconfig.json +++ b/types/fm-websync/tsconfig.json @@ -4,12 +4,14 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "lib": [ - "es6", "dom" + "es6", + "dom" ], "types": [], "noEmit": true, @@ -19,4 +21,4 @@ "index.d.ts", "fm-websync-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fontfaceobserver/tsconfig.json b/types/fontfaceobserver/tsconfig.json index e9a03f3541..3695935f67 100644 --- a/types/fontfaceobserver/tsconfig.json +++ b/types/fontfaceobserver/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fontoxml/tsconfig.json b/types/fontoxml/tsconfig.json index b7501d4042..6d62b697a0 100644 --- a/types/fontoxml/tsconfig.json +++ b/types/fontoxml/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/forever-monitor/tsconfig.json b/types/forever-monitor/tsconfig.json index 363ce2c8a0..30bf59fa63 100644 --- a/types/forever-monitor/tsconfig.json +++ b/types/forever-monitor/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "forever-monitor-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/forge-di/tsconfig.json b/types/forge-di/tsconfig.json index 4a16ed5dcf..14aa632323 100644 --- a/types/forge-di/tsconfig.json +++ b/types/forge-di/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/form-data/tsconfig.json b/types/form-data/tsconfig.json index e97ed4a2c6..d1cdfefaf0 100644 --- a/types/form-data/tsconfig.json +++ b/types/form-data/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/form-serializer/tsconfig.json b/types/form-serializer/tsconfig.json index 8041f14ca5..0e7f5bba79 100644 --- a/types/form-serializer/tsconfig.json +++ b/types/form-serializer/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/format-unicorn/tsconfig.json b/types/format-unicorn/tsconfig.json index 29d4f9a2e6..84864d0f7e 100644 --- a/types/format-unicorn/tsconfig.json +++ b/types/format-unicorn/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/formidable/tsconfig.json b/types/formidable/tsconfig.json index 4e495b8b04..e5b9877247 100644 --- a/types/formidable/tsconfig.json +++ b/types/formidable/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/forwarded/tsconfig.json b/types/forwarded/tsconfig.json index 9df0387d33..58cbcdee21 100644 --- a/types/forwarded/tsconfig.json +++ b/types/forwarded/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "forwarded-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fossil-delta/tsconfig.json b/types/fossil-delta/tsconfig.json index fa6922eea9..29b7c7e933 100644 --- a/types/fossil-delta/tsconfig.json +++ b/types/fossil-delta/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/foundation-sites/tsconfig.json b/types/foundation-sites/tsconfig.json index 60e0a90e80..301e0bc66b 100644 --- a/types/foundation-sites/tsconfig.json +++ b/types/foundation-sites/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/foundation/tsconfig.json b/types/foundation/tsconfig.json index 2c912b6c88..5ddb587b52 100644 --- a/types/foundation/tsconfig.json +++ b/types/foundation/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fpsmeter/tsconfig.json b/types/fpsmeter/tsconfig.json index 8a67eaf271..82e6284376 100644 --- a/types/fpsmeter/tsconfig.json +++ b/types/fpsmeter/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/framebus/tsconfig.json b/types/framebus/tsconfig.json index 6444134bb7..eec501f70b 100644 --- a/types/framebus/tsconfig.json +++ b/types/framebus/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "framebus-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/freedom/tsconfig.json b/types/freedom/tsconfig.json index 3be620d6cd..dd0bd2e13c 100644 --- a/types/freedom/tsconfig.json +++ b/types/freedom/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/freeport/tsconfig.json b/types/freeport/tsconfig.json index b475d43da6..f6b6ef7b66 100644 --- a/types/freeport/tsconfig.json +++ b/types/freeport/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "freeport-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fresh/tsconfig.json b/types/fresh/tsconfig.json index 94d14b21a5..298a5c3fae 100644 --- a/types/fresh/tsconfig.json +++ b/types/fresh/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "fresh-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/friendly-errors-webpack-plugin/index.d.ts b/types/friendly-errors-webpack-plugin/index.d.ts index 582dfadf57..7e2937c867 100644 --- a/types/friendly-errors-webpack-plugin/index.d.ts +++ b/types/friendly-errors-webpack-plugin/index.d.ts @@ -24,7 +24,7 @@ declare namespace FriendlyErrorsWebpackPlugin { notes: string[], }; onErrors?(severity: Severity, errors: string): void; - clearConsole?: true; + clearConsole?: boolean; additionalFormatters?: Array<(errors: WebpackError[], type: Severity) => string[]>; additionalTransformers?: Array<(error: any) => any>; } diff --git a/types/friendly-errors-webpack-plugin/tsconfig.json b/types/friendly-errors-webpack-plugin/tsconfig.json index b9077f2994..f519c3b954 100644 --- a/types/friendly-errors-webpack-plugin/tsconfig.json +++ b/types/friendly-errors-webpack-plugin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "friendly-errors-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/frisby/tsconfig.json b/types/frisby/tsconfig.json index 5ff4c5d7f1..725ebf48f1 100644 --- a/types/frisby/tsconfig.json +++ b/types/frisby/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/from/tsconfig.json b/types/from/tsconfig.json index 7aa11b5c54..649c0d1866 100644 --- a/types/from/tsconfig.json +++ b/types/from/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/from2/tsconfig.json b/types/from2/tsconfig.json index e632fe943f..641eda4cf5 100644 --- a/types/from2/tsconfig.json +++ b/types/from2/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "from2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fromjs/tsconfig.json b/types/fromjs/tsconfig.json index 92b3621ebb..4c5e05b65a 100644 --- a/types/fromjs/tsconfig.json +++ b/types/fromjs/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fromnow/tsconfig.json b/types/fromnow/tsconfig.json index 48462d06eb..56e959f305 100644 --- a/types/fromnow/tsconfig.json +++ b/types/fromnow/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-ext/tsconfig.json b/types/fs-ext/tsconfig.json index ef216c4072..18df84572d 100644 --- a/types/fs-ext/tsconfig.json +++ b/types/fs-ext/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-extra-promise-es6/tsconfig.json b/types/fs-extra-promise-es6/tsconfig.json index 877953e8d6..b7e6f664f2 100644 --- a/types/fs-extra-promise-es6/tsconfig.json +++ b/types/fs-extra-promise-es6/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-extra-promise/tsconfig.json b/types/fs-extra-promise/tsconfig.json index a233a1224c..e0f6cc3450 100644 --- a/types/fs-extra-promise/tsconfig.json +++ b/types/fs-extra-promise/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-extra/tsconfig.json b/types/fs-extra/tsconfig.json index 818b38896c..d43823dee8 100644 --- a/types/fs-extra/tsconfig.json +++ b/types/fs-extra/tsconfig.json @@ -1,22 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "fs-extra-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fs-extra-tests.ts" + ] +} \ No newline at end of file diff --git a/types/fs-finder/tsconfig.json b/types/fs-finder/tsconfig.json index 12014d7788..300e950feb 100644 --- a/types/fs-finder/tsconfig.json +++ b/types/fs-finder/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-mock/tsconfig.json b/types/fs-mock/tsconfig.json index 55e0dc8136..f468b62a55 100644 --- a/types/fs-mock/tsconfig.json +++ b/types/fs-mock/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-promise/tsconfig.json b/types/fs-promise/tsconfig.json index 0c1c0f6a74..377d4623d9 100644 --- a/types/fs-promise/tsconfig.json +++ b/types/fs-promise/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fs-readdir-recursive/tsconfig.json b/types/fs-readdir-recursive/tsconfig.json index 8578708856..d33141f321 100644 --- a/types/fs-readdir-recursive/tsconfig.json +++ b/types/fs-readdir-recursive/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "fs-readdir-recursive-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fsevents/tsconfig.json b/types/fsevents/tsconfig.json index 24f9efb3f3..2937460740 100644 --- a/types/fsevents/tsconfig.json +++ b/types/fsevents/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +20,4 @@ "index.d.ts", "fsevents-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ftdomdelegate/tsconfig.json b/types/ftdomdelegate/tsconfig.json index f68033bfb3..0220e74665 100644 --- a/types/ftdomdelegate/tsconfig.json +++ b/types/ftdomdelegate/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ftp/tsconfig.json b/types/ftp/tsconfig.json index bdae80b4ae..6a0f57a1fc 100644 --- a/types/ftp/tsconfig.json +++ b/types/ftp/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/ftpd/tsconfig.json b/types/ftpd/tsconfig.json index 16849e26c0..24702aad8b 100644 --- a/types/ftpd/tsconfig.json +++ b/types/ftpd/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fullcalendar/tsconfig.json b/types/fullcalendar/tsconfig.json index e57ff2b39c..289c13f80e 100644 --- a/types/fullcalendar/tsconfig.json +++ b/types/fullcalendar/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +21,4 @@ "index.d.ts", "fullcalendar-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fullcalendar/v1/tsconfig.json b/types/fullcalendar/v1/tsconfig.json index 2389638d1c..c6612c5858 100644 --- a/types/fullcalendar/v1/tsconfig.json +++ b/types/fullcalendar/v1/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../../", "typeRoots": [ "../../" @@ -25,4 +26,4 @@ "index.d.ts", "fullcalendar-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fullname/tsconfig.json b/types/fullname/tsconfig.json index b1bbc33f6f..a086692e32 100644 --- a/types/fullname/tsconfig.json +++ b/types/fullname/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fullpage.js/tsconfig.json b/types/fullpage.js/tsconfig.json index 0b756489f1..c8a11e250e 100644 --- a/types/fullpage.js/tsconfig.json +++ b/types/fullpage.js/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fuse/tsconfig.json b/types/fuse/tsconfig.json index 8007ac69ea..8f6b34f5d3 100644 --- a/types/fuse/tsconfig.json +++ b/types/fuse/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fusioncharts/tsconfig.json b/types/fusioncharts/tsconfig.json index 970238d9a8..f41f53056a 100644 --- a/types/fusioncharts/tsconfig.json +++ b/types/fusioncharts/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fuzzaldrin-plus/tsconfig.json b/types/fuzzaldrin-plus/tsconfig.json index 9b8024fdab..02e987df6d 100644 --- a/types/fuzzaldrin-plus/tsconfig.json +++ b/types/fuzzaldrin-plus/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fuzzaldrin/tsconfig.json b/types/fuzzaldrin/tsconfig.json index 3bc13b0278..abf333c6bf 100644 --- a/types/fuzzaldrin/tsconfig.json +++ b/types/fuzzaldrin/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fuzzyset/tsconfig.json b/types/fuzzyset/tsconfig.json index 1ca77e5aa2..4ccf3898d4 100644 --- a/types/fuzzyset/tsconfig.json +++ b/types/fuzzyset/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/fxn/tsconfig.json b/types/fxn/tsconfig.json index 3bc13b0278..abf333c6bf 100644 --- a/types/fxn/tsconfig.json +++ b/types/fxn/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gae.channel.api/tsconfig.json b/types/gae.channel.api/tsconfig.json index 4ee5f96211..37424f5ae4 100644 --- a/types/gae.channel.api/tsconfig.json +++ b/types/gae.channel.api/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gamepad/tsconfig.json b/types/gamepad/tsconfig.json index 3f6b376405..4cb63f3d80 100644 --- a/types/gamepad/tsconfig.json +++ b/types/gamepad/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gamequery/tsconfig.json b/types/gamequery/tsconfig.json index fe46c19286..9acbbdf6ea 100644 --- a/types/gamequery/tsconfig.json +++ b/types/gamequery/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gandi-livedns/tsconfig.json b/types/gandi-livedns/tsconfig.json index d63ce7bcc4..709af92138 100644 --- a/types/gandi-livedns/tsconfig.json +++ b/types/gandi-livedns/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gapi.analytics/tsconfig.json b/types/gapi.analytics/tsconfig.json index 15bf7f626b..7ea23b6882 100644 --- a/types/gapi.analytics/tsconfig.json +++ b/types/gapi.analytics/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gapi.auth2/index.d.ts b/types/gapi.auth2/index.d.ts index 4cdef77a80..c5cfff0d9e 100644 --- a/types/gapi.auth2/index.d.ts +++ b/types/gapi.auth2/index.d.ts @@ -208,7 +208,7 @@ declare namespace gapi.auth2 { login_hint?: string; app_package_name?: string; openid_realm?: string; - include_granted_scope?: boolean; + include_granted_scopes?: boolean; } /** diff --git a/types/gapi.auth2/tsconfig.json b/types/gapi.auth2/tsconfig.json index 18d8b4dc70..8757ec8333 100644 --- a/types/gapi.auth2/tsconfig.json +++ b/types/gapi.auth2/tsconfig.json @@ -8,6 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/gapi.calendar/tsconfig.json b/types/gapi.calendar/tsconfig.json index 7613ee5b3d..2d138f7ac9 100644 --- a/types/gapi.calendar/tsconfig.json +++ b/types/gapi.calendar/tsconfig.json @@ -1,18 +1,24 @@ { - "compilerOptions": { - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "module": "commonjs", - "lib": ["es6", "dom"], - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitThis": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "gapi.calendar-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.calendar-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.acceleratedmobilepageurl/gapi.client.acceleratedmobilepageurl-tests.ts b/types/gapi.client.acceleratedmobilepageurl/gapi.client.acceleratedmobilepageurl-tests.ts new file mode 100644 index 0000000000..f5bce33566 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/gapi.client.acceleratedmobilepageurl-tests.ts @@ -0,0 +1,22 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('acceleratedmobilepageurl', 'v1', () => { + /** now we can use gapi.client.acceleratedmobilepageurl */ + + run(); + }); + + async function run() { + /** + * Returns AMP URL(s) and equivalent + * [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). + */ + await gapi.client.ampUrls.batchGet({ + }); + } +}); diff --git a/types/gapi.client.acceleratedmobilepageurl/index.d.ts b/types/gapi.client.acceleratedmobilepageurl/index.d.ts new file mode 100644 index 0000000000..1c2c968f53 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/index.d.ts @@ -0,0 +1,97 @@ +// Type definitions for Google Accelerated Mobile Pages (AMP) URL API v1 1.0 +// Project: https://developers.google.com/amp/cache/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://acceleratedmobilepageurl.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Accelerated Mobile Pages (AMP) URL API v1 */ + function load(name: "acceleratedmobilepageurl", version: "v1"): PromiseLike; + function load(name: "acceleratedmobilepageurl", version: "v1", callback: () => any): void; + + const ampUrls: acceleratedmobilepageurl.AmpUrlsResource; + + namespace acceleratedmobilepageurl { + interface AmpUrl { + /** The AMP URL pointing to the publisher's web server. */ + ampUrl?: string; + /** + * The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to + * the cached document in the Google AMP Cache. + */ + cdnAmpUrl?: string; + /** The original non-AMP URL. */ + originalUrl?: string; + } + interface AmpUrlError { + /** The error code of an API call. */ + errorCode?: string; + /** An optional descriptive error message. */ + errorMessage?: string; + /** The original non-AMP URL. */ + originalUrl?: string; + } + interface BatchGetAmpUrlsRequest { + /** The lookup_strategy being requested. */ + lookupStrategy?: string; + /** + * List of URLs to look up for the paired AMP URLs. + * The URLs are case-sensitive. Up to 50 URLs per lookup + * (see [Usage Limits](/amp/cache/reference/limits)). + */ + urls?: string[]; + } + interface BatchGetAmpUrlsResponse { + /** + * For each URL in BatchAmpUrlsRequest, the URL response. The response might + * not be in the same order as URLs in the batch request. + * If BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated + * only once. + */ + ampUrls?: AmpUrl[]; + /** The errors for requested URLs that have no AMP URL. */ + urlErrors?: AmpUrlError[]; + } + interface AmpUrlsResource { + /** + * Returns AMP URL(s) and equivalent + * [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). + */ + batchGet(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.acceleratedmobilepageurl/readme.md b/types/gapi.client.acceleratedmobilepageurl/readme.md new file mode 100644 index 0000000000..788f3882c0 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/readme.md @@ -0,0 +1,42 @@ +# TypeScript typings for Accelerated Mobile Pages (AMP) URL API v1 +Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s). + +For detailed description please check [documentation](https://developers.google.com/amp/cache/). + +## Installing + +Install typings for Accelerated Mobile Pages (AMP) URL API: +``` +npm install @types/gapi.client.acceleratedmobilepageurl@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('acceleratedmobilepageurl', 'v1', () => { + // now we can use gapi.client.acceleratedmobilepageurl + // ... +}); +``` + + + +After that you can use Accelerated Mobile Pages (AMP) URL API resources: + +```typescript + +/* +Returns AMP URL(s) and equivalent +[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). +*/ +await gapi.client.ampUrls.batchGet({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.acceleratedmobilepageurl/tsconfig.json b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json new file mode 100644 index 0000000000..60d81925fe --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.acceleratedmobilepageurl-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.acceleratedmobilepageurl/tslint.json b/types/gapi.client.acceleratedmobilepageurl/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexchangebuyer/gapi.client.adexchangebuyer-tests.ts b/types/gapi.client.adexchangebuyer/gapi.client.adexchangebuyer-tests.ts new file mode 100644 index 0000000000..b180610519 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/gapi.client.adexchangebuyer-tests.ts @@ -0,0 +1,213 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexchangebuyer', 'v1.4', () => { + /** now we can use gapi.client.adexchangebuyer */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Ad Exchange buyer account configuration */ + 'https://www.googleapis.com/auth/adexchange.buyer', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets one account by ID. */ + await gapi.client.accounts.get({ + id: 1, + }); + /** Retrieves the authenticated user's list of accounts. */ + await gapi.client.accounts.list({ + }); + /** Updates an existing account. This method supports patch semantics. */ + await gapi.client.accounts.patch({ + confirmUnsafeAccountChange: true, + id: 2, + }); + /** Updates an existing account. */ + await gapi.client.accounts.update({ + confirmUnsafeAccountChange: true, + id: 2, + }); + /** Returns the billing information for one account specified by account ID. */ + await gapi.client.billingInfo.get({ + accountId: 1, + }); + /** Retrieves a list of billing information for all accounts of the authenticated user. */ + await gapi.client.billingInfo.list({ + }); + /** Returns the budget information for the adgroup specified by the accountId and billingId. */ + await gapi.client.budget.get({ + accountId: "accountId", + billingId: "billingId", + }); + /** + * Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method + * supports patch semantics. + */ + await gapi.client.budget.patch({ + accountId: "accountId", + billingId: "billingId", + }); + /** Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. */ + await gapi.client.budget.update({ + accountId: "accountId", + billingId: "billingId", + }); + /** Add a deal id association for the creative. */ + await gapi.client.creatives.addDeal({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + dealId: "dealId", + }); + /** Gets the status for a single creative. A creative will be available 30-40 minutes after submission. */ + await gapi.client.creatives.get({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + }); + /** Submit a new creative. */ + await gapi.client.creatives.insert({ + }); + /** Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. */ + await gapi.client.creatives.list({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + dealsStatusFilter: "dealsStatusFilter", + maxResults: 4, + openAuctionStatusFilter: "openAuctionStatusFilter", + pageToken: "pageToken", + }); + /** Lists the external deal ids associated with the creative. */ + await gapi.client.creatives.listDeals({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + }); + /** Remove a deal id associated with the creative. */ + await gapi.client.creatives.removeDeal({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + dealId: "dealId", + }); + /** Delete the specified deals from the proposal */ + await gapi.client.marketplacedeals.delete({ + proposalId: "proposalId", + }); + /** Add new deals for the specified proposal */ + await gapi.client.marketplacedeals.insert({ + proposalId: "proposalId", + }); + /** List all the deals for a given proposal */ + await gapi.client.marketplacedeals.list({ + pqlQuery: "pqlQuery", + proposalId: "proposalId", + }); + /** Replaces all the deals in the proposal with the passed in deals */ + await gapi.client.marketplacedeals.update({ + proposalId: "proposalId", + }); + /** Add notes to the proposal */ + await gapi.client.marketplacenotes.insert({ + proposalId: "proposalId", + }); + /** Get all the notes associated with a proposal */ + await gapi.client.marketplacenotes.list({ + pqlQuery: "pqlQuery", + proposalId: "proposalId", + }); + /** Update a given private auction proposal */ + await gapi.client.marketplaceprivateauction.updateproposal({ + privateAuctionId: "privateAuctionId", + }); + /** Retrieves the authenticated user's list of performance metrics. */ + await gapi.client.performanceReport.list({ + accountId: "accountId", + endDateTime: "endDateTime", + maxResults: 3, + pageToken: "pageToken", + startDateTime: "startDateTime", + }); + /** Deletes an existing pretargeting config. */ + await gapi.client.pretargetingConfig.delete({ + accountId: "accountId", + configId: "configId", + }); + /** Gets a specific pretargeting configuration */ + await gapi.client.pretargetingConfig.get({ + accountId: "accountId", + configId: "configId", + }); + /** Inserts a new pretargeting configuration. */ + await gapi.client.pretargetingConfig.insert({ + accountId: "accountId", + }); + /** Retrieves a list of the authenticated user's pretargeting configurations. */ + await gapi.client.pretargetingConfig.list({ + accountId: "accountId", + }); + /** Updates an existing pretargeting config. This method supports patch semantics. */ + await gapi.client.pretargetingConfig.patch({ + accountId: "accountId", + configId: "configId", + }); + /** Updates an existing pretargeting config. */ + await gapi.client.pretargetingConfig.update({ + accountId: "accountId", + configId: "configId", + }); + /** Gets the requested product by id. */ + await gapi.client.products.get({ + productId: "productId", + }); + /** Gets the requested product. */ + await gapi.client.products.search({ + pqlQuery: "pqlQuery", + }); + /** Get a proposal given its id */ + await gapi.client.proposals.get({ + proposalId: "proposalId", + }); + /** Create the given list of proposals */ + await gapi.client.proposals.insert({ + }); + /** Update the given proposal. This method supports patch semantics. */ + await gapi.client.proposals.patch({ + proposalId: "proposalId", + revisionNumber: "revisionNumber", + updateAction: "updateAction", + }); + /** Search for proposals using pql query */ + await gapi.client.proposals.search({ + pqlQuery: "pqlQuery", + }); + /** Update the given proposal to indicate that setup has been completed. */ + await gapi.client.proposals.setupcomplete({ + proposalId: "proposalId", + }); + /** Update the given proposal */ + await gapi.client.proposals.update({ + proposalId: "proposalId", + revisionNumber: "revisionNumber", + updateAction: "updateAction", + }); + /** Gets the requested publisher profile(s) by publisher accountId. */ + await gapi.client.pubprofiles.list({ + accountId: 1, + }); + } +}); diff --git a/types/gapi.client.adexchangebuyer/index.d.ts b/types/gapi.client.adexchangebuyer/index.d.ts new file mode 100644 index 0000000000..b6ee95d192 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/index.d.ts @@ -0,0 +1,1989 @@ +// Type definitions for Google Ad Exchange Buyer API v1.4 1.4 +// Project: https://developers.google.com/ad-exchange/buyer-rest +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1.4/rest + +/// + +declare namespace gapi.client { + /** Load Ad Exchange Buyer API v1.4 */ + function load(name: "adexchangebuyer", version: "v1.4"): PromiseLike; + function load(name: "adexchangebuyer", version: "v1.4", callback: () => any): void; + + const accounts: adexchangebuyer.AccountsResource; + + const billingInfo: adexchangebuyer.BillingInfoResource; + + const budget: adexchangebuyer.BudgetResource; + + const creatives: adexchangebuyer.CreativesResource; + + const marketplacedeals: adexchangebuyer.MarketplacedealsResource; + + const marketplacenotes: adexchangebuyer.MarketplacenotesResource; + + const marketplaceprivateauction: adexchangebuyer.MarketplaceprivateauctionResource; + + const performanceReport: adexchangebuyer.PerformanceReportResource; + + const pretargetingConfig: adexchangebuyer.PretargetingConfigResource; + + const products: adexchangebuyer.ProductsResource; + + const proposals: adexchangebuyer.ProposalsResource; + + const pubprofiles: adexchangebuyer.PubprofilesResource; + + namespace adexchangebuyer { + interface Account { + /** Your bidder locations that have distinct URLs. */ + bidderLocation?: Array<{ + /** + * The protocol that the bidder endpoint is using. OpenRTB protocols with prefix PROTOCOL_OPENRTB_PROTOBUF use proto buffer, otherwise use JSON. Allowed + * values: + * - PROTOCOL_ADX + * - PROTOCOL_OPENRTB_2_2 + * - PROTOCOL_OPENRTB_2_3 + * - PROTOCOL_OPENRTB_2_4 + * - PROTOCOL_OPENRTB_2_5 + * - PROTOCOL_OPENRTB_PROTOBUF_2_3 + * - PROTOCOL_OPENRTB_PROTOBUF_2_4 + * - PROTOCOL_OPENRTB_PROTOBUF_2_5 + */ + bidProtocol?: string; + /** The maximum queries per second the Ad Exchange will send. */ + maximumQps?: number; + /** + * The geographical region the Ad Exchange should send requests from. Only used by some quota systems, but always setting the value is recommended. + * Allowed values: + * - ASIA + * - EUROPE + * - US_EAST + * - US_WEST + */ + region?: string; + /** The URL to which the Ad Exchange will send bid requests. */ + url?: string; + }>; + /** The nid parameter value used in cookie match requests. Please contact your technical account manager if you need to change this. */ + cookieMatchingNid?: string; + /** The base URL used in cookie match requests. */ + cookieMatchingUrl?: string; + /** Account id. */ + id?: number; + /** Resource type. */ + kind?: string; + /** + * The maximum number of active creatives that an account can have, where a creative is active if it was inserted or bid with in the last 30 days. Please + * contact your technical account manager if you need to change this. + */ + maximumActiveCreatives?: number; + /** The sum of all bidderLocation.maximumQps values cannot exceed this. Please contact your technical account manager if you need to change this. */ + maximumTotalQps?: number; + /** The number of creatives that this account inserted or bid with in the last 30 days. */ + numberActiveCreatives?: number; + } + interface AccountsList { + /** A list of accounts. */ + items?: Account[]; + /** Resource type. */ + kind?: string; + } + interface AddOrderDealsRequest { + /** The list of deals to add */ + deals?: MarketplaceDeal[]; + /** The last known proposal revision number. */ + proposalRevisionNumber?: string; + /** Indicates an optional action to take on the proposal */ + updateAction?: string; + } + interface AddOrderDealsResponse { + /** List of deals added (in the same proposal as passed in the request) */ + deals?: MarketplaceDeal[]; + /** The updated revision number for the proposal. */ + proposalRevisionNumber?: string; + } + interface AddOrderNotesRequest { + /** The list of notes to add. */ + notes?: MarketplaceNote[]; + } + interface AddOrderNotesResponse { + notes?: MarketplaceNote[]; + } + interface BillingInfo { + /** Account id. */ + accountId?: number; + /** Account name. */ + accountName?: string; + /** + * A list of adgroup IDs associated with this particular account. These IDs may show up as part of a realtime bidding BidRequest, which indicates a bid + * request for this account. + */ + billingId?: string[]; + /** Resource type. */ + kind?: string; + } + interface BillingInfoList { + /** A list of billing info relevant for your account. */ + items?: BillingInfo[]; + /** Resource type. */ + kind?: string; + } + interface Budget { + /** The id of the account. This is required for get and update requests. */ + accountId?: string; + /** The billing id to determine which adgroup to provide budget information for. This is required for get and update requests. */ + billingId?: string; + /** The daily budget amount in unit amount of the account currency to apply for the billingId provided. This is required for update requests. */ + budgetAmount?: string; + /** The currency code for the buyer. This cannot be altered here. */ + currencyCode?: string; + /** The unique id that describes this item. */ + id?: string; + /** The kind of the resource, i.e. "adexchangebuyer#budget". */ + kind?: string; + } + interface Buyer { + /** Adx account id of the buyer. */ + accountId?: string; + } + interface ContactInformation { + /** Email address of the contact. */ + email?: string; + /** The name of the contact. */ + name?: string; + } + interface CreateOrdersRequest { + /** The list of proposals to create. */ + proposals?: Proposal[]; + /** Web property id of the seller creating these orders */ + webPropertyCode?: string; + } + interface CreateOrdersResponse { + /** The list of proposals successfully created. */ + proposals?: Proposal[]; + } + interface Creative { + /** The HTML snippet that displays the ad when inserted in the web page. If set, videoURL should not be set. */ + HTMLSnippet?: string; + /** Account id. */ + accountId?: number; + /** The link to the Ad Preferences page. This is only supported for native ads. */ + adChoicesDestinationUrl?: string; + /** Detected advertiser id, if any. Read-only. This field should not be set in requests. */ + advertiserId?: string[]; + /** The name of the company being advertised in the creative. The value provided must exist in the advertisers.txt file. */ + advertiserName?: string; + /** The agency id for this creative. */ + agencyId?: string; + /** + * The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for + * uploads. (formatted RFC 3339 timestamp). + */ + apiUploadTimestamp?: string; + /** + * List of buyer selectable attributes for the ads that may be shown from this snippet. Each attribute is represented by an integer as defined in + * buyer-declarable-creative-attributes.txt. + */ + attribute?: number[]; + /** A buyer-specific id identifying the creative in this ad. */ + buyerCreativeId?: string; + /** The set of destination urls for the snippet. */ + clickThroughUrl?: string[]; + /** Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests. */ + corrections?: Array<{ + /** All known serving contexts containing serving status information. */ + contexts?: Array<{ + /** Only set when contextType=AUCTION_TYPE. Represents the auction types this correction applies to. */ + auctionType?: string[]; + /** The type of context (e.g., location, platform, auction type, SSL-ness). */ + contextType?: string; + /** Only set when contextType=LOCATION. Represents the geo criterias this correction applies to. */ + geoCriteriaId?: number[]; + /** Only set when contextType=PLATFORM. Represents the platforms this correction applies to. */ + platform?: string[]; + }>; + /** Additional details about the correction. */ + details?: string[]; + /** The type of correction that was applied to the creative. */ + reason?: string; + }>; + /** + * Top-level deals status. Read-only. This field should not be set in requests. If disapproved, an entry for auctionType=DIRECT_DEALS (or ALL) in + * servingRestrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case it may be preferable to read from + * servingRestrictions directly. + */ + dealsStatus?: string; + /** Detected domains for this creative. Read-only. This field should not be set in requests. */ + detectedDomains?: string[]; + /** The filtering reasons for the creative. Read-only. This field should not be set in requests. */ + filteringReasons?: { + /** The date in ISO 8601 format for the data. The data is collected from 00:00:00 to 23:59:59 in PST. */ + date?: string; + /** The filtering reasons. */ + reasons?: Array<{ + /** The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange. */ + filteringCount?: string; + /** The filtering status code as defined in creative-status-codes.txt. */ + filteringStatus?: number; + }>; + }; + /** Ad height. */ + height?: number; + /** The set of urls to be called to record an impression. */ + impressionTrackingUrl?: string[]; + /** Resource type. */ + kind?: string; + /** Detected languages for this creative. Read-only. This field should not be set in requests. */ + languages?: string[]; + /** If nativeAd is set, HTMLSnippet and the videoURL outside of nativeAd should not be set. (The videoURL inside nativeAd can be set.) */ + nativeAd?: { + advertiser?: string; + /** The app icon, for app download ads. */ + appIcon?: { + height?: number; + url?: string; + width?: number; + }; + /** A long description of the ad. */ + body?: string; + /** A label for the button that the user is supposed to click. */ + callToAction?: string; + /** The URL that the browser/SDK will load when the user clicks the ad. */ + clickLinkUrl?: string; + /** The URL to use for click tracking. */ + clickTrackingUrl?: string; + /** A short title for the ad. */ + headline?: string; + /** A large image. */ + image?: { + height?: number; + url?: string; + width?: number; + }; + /** The URLs are called when the impression is rendered. */ + impressionTrackingUrl?: string[]; + /** A smaller image, for the advertiser logo. */ + logo?: { + height?: number; + url?: string; + width?: number; + }; + /** The price of the promoted app including the currency info. */ + price?: string; + /** The app rating in the app store. Must be in the range [0-5]. */ + starRating?: number; + /** The URL to the app store to purchase/download the promoted app. */ + store?: string; + /** The URL of the XML VAST for a native ad. Note this is a separate field from resource.video_url. */ + videoURL?: string; + }; + /** + * Top-level open auction status. Read-only. This field should not be set in requests. If disapproved, an entry for auctionType=OPEN_AUCTION (or ALL) in + * servingRestrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case it may be preferable to read from + * ServingRestrictions directly. + */ + openAuctionStatus?: string; + /** + * Detected product categories, if any. Each category is represented by an integer as defined in ad-product-categories.txt. Read-only. This field should + * not be set in requests. + */ + productCategories?: number[]; + /** + * All restricted categories for the ads that may be shown from this snippet. Each category is represented by an integer as defined in the + * ad-restricted-categories.txt. + */ + restrictedCategories?: number[]; + /** + * Detected sensitive categories, if any. Each category is represented by an integer as defined in ad-sensitive-categories.txt. Read-only. This field + * should not be set in requests. + */ + sensitiveCategories?: number[]; + /** + * The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a + * platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests. See the examples in the Creatives + * guide for more details. + */ + servingRestrictions?: Array<{ + /** All known contexts/restrictions. */ + contexts?: Array<{ + /** Only set when contextType=AUCTION_TYPE. Represents the auction types this restriction applies to. */ + auctionType?: string[]; + /** The type of context (e.g., location, platform, auction type, SSL-ness). */ + contextType?: string; + /** + * Only set when contextType=LOCATION. Represents the geo criterias this restriction applies to. Impressions are considered to match a context if either + * the user location or publisher location matches a given geoCriteriaId. + */ + geoCriteriaId?: number[]; + /** Only set when contextType=PLATFORM. Represents the platforms this restriction applies to. */ + platform?: string[]; + }>; + /** + * The reasons for disapproval within this restriction, if any. Note that not all disapproval reasons may be categorized, so it is possible for the + * creative to have a status of DISAPPROVED or CONDITIONALLY_APPROVED with an empty list for disapproval_reasons. In this case, please reach out to your + * TAM to help debug the issue. + */ + disapprovalReasons?: Array<{ + /** Additional details about the reason for disapproval. */ + details?: string[]; + /** The categorized reason for disapproval. */ + reason?: string; + }>; + /** Why the creative is ineligible to serve in this context (e.g., it has been explicitly disapproved or is pending review). */ + reason?: string; + }>; + /** List of vendor types for the ads that may be shown from this snippet. Each vendor type is represented by an integer as defined in vendors.txt. */ + vendorType?: number[]; + /** The version for this creative. Read-only. This field should not be set in requests. */ + version?: number; + /** The URL to fetch a video ad. If set, HTMLSnippet and the nativeAd should not be set. Note, this is different from resource.native_ad.video_url above. */ + videoURL?: string; + /** Ad width. */ + width?: number; + } + interface CreativeDealIds { + /** A list of external deal ids and ARC approval status. */ + dealStatuses?: Array<{ + /** ARC approval status. */ + arcStatus?: string; + /** External deal ID. */ + dealId?: string; + /** Publisher ID. */ + webPropertyId?: number; + }>; + /** Resource type. */ + kind?: string; + } + interface CreativesList { + /** A list of creatives. */ + items?: Creative[]; + /** Resource type. */ + kind?: string; + /** Continuation token used to page through creatives. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface DealServingMetadata { + /** + * True if alcohol ads are allowed for this deal (read-only). This field is only populated when querying for finalized orders using the method + * GetFinalizedOrderDeals + */ + alcoholAdsAllowed?: boolean; + /** Tracks which parties (if any) have paused a deal. (readonly, except via PauseResumeOrderDeals action) */ + dealPauseStatus?: DealServingMetadataDealPauseStatus; + } + interface DealServingMetadataDealPauseStatus { + buyerPauseReason?: string; + /** If the deal is paused, records which party paused the deal first. */ + firstPausedBy?: string; + hasBuyerPaused?: boolean; + hasSellerPaused?: boolean; + sellerPauseReason?: string; + } + interface DealTerms { + /** Visibilty of the URL in bid requests. */ + brandingType?: string; + /** + * Indicates that this ExternalDealId exists under at least two different AdxInventoryDeals. Currently, the only case that the same ExternalDealId will + * exist is programmatic cross sell case. + */ + crossListedExternalDealIdType?: string; + /** Description for the proposed terms of the deal. */ + description?: string; + /** Non-binding estimate of the estimated gross spend for this deal Can be set by buyer or seller. */ + estimatedGrossSpend?: Price; + /** Non-binding estimate of the impressions served per day Can be set by buyer or seller. */ + estimatedImpressionsPerDay?: string; + /** The terms for guaranteed fixed price deals. */ + guaranteedFixedPriceTerms?: DealTermsGuaranteedFixedPriceTerms; + /** The terms for non-guaranteed auction deals. */ + nonGuaranteedAuctionTerms?: DealTermsNonGuaranteedAuctionTerms; + /** The terms for non-guaranteed fixed price deals. */ + nonGuaranteedFixedPriceTerms?: DealTermsNonGuaranteedFixedPriceTerms; + /** The terms for rubicon non-guaranteed deals. */ + rubiconNonGuaranteedTerms?: DealTermsRubiconNonGuaranteedTerms; + /** For deals with Cost Per Day billing, defines the timezone used to mark the boundaries of a day (buyer-readonly) */ + sellerTimeZone?: string; + } + interface DealTermsGuaranteedFixedPriceTerms { + /** External billing info for this Deal. This field is relevant when external billing info such as price has a different currency code than DFP/AdX. */ + billingInfo?: DealTermsGuaranteedFixedPriceTermsBillingInfo; + /** Fixed price for the specified buyer. */ + fixedPrices?: PricePerBuyer[]; + /** Guaranteed impressions as a percentage. This is the percentage of guaranteed looks that the buyer is guaranteeing to buy. */ + guaranteedImpressions?: string; + /** Count of guaranteed looks. Required for deal, optional for product. For CPD deals, buyer changes to guaranteed_looks will be ignored. */ + guaranteedLooks?: string; + /** Count of minimum daily looks for a CPD deal. For CPD deals, buyer should negotiate on this field instead of guaranteed_looks. */ + minimumDailyLooks?: string; + } + interface DealTermsGuaranteedFixedPriceTermsBillingInfo { + /** + * The timestamp (in ms since epoch) when the original reservation price for the deal was first converted to DFP currency. This is used to convert the + * contracted price into buyer's currency without discrepancy. + */ + currencyConversionTimeMs?: string; + /** The DFP line item id associated with this deal. For features like CPD, buyers can retrieve the DFP line item for billing reconciliation. */ + dfpLineItemId?: string; + /** + * The original contracted quantity (# impressions) for this deal. To ensure delivery, sometimes the publisher will book the deal with a impression + * buffer, such that guaranteed_looks is greater than the contracted quantity. However clients are billed using the original contracted quantity. + */ + originalContractedQuantity?: string; + /** The original reservation price for the deal, if the currency code is different from the one used in negotiation. */ + price?: Price; + } + interface DealTermsNonGuaranteedAuctionTerms { + /** True if open auction buyers are allowed to compete with invited buyers in this private auction (buyer-readonly). */ + autoOptimizePrivateAuction?: boolean; + /** Reserve price for the specified buyer. */ + reservePricePerBuyers?: PricePerBuyer[]; + } + interface DealTermsNonGuaranteedFixedPriceTerms { + /** Fixed price for the specified buyer. */ + fixedPrices?: PricePerBuyer[]; + } + interface DealTermsRubiconNonGuaranteedTerms { + /** Optional price for Rubicon priority access in the auction. */ + priorityPrice?: Price; + /** Optional price for Rubicon standard access in the auction. */ + standardPrice?: Price; + } + interface DeleteOrderDealsRequest { + /** List of deals to delete for a given proposal */ + dealIds?: string[]; + /** The last known proposal revision number. */ + proposalRevisionNumber?: string; + /** Indicates an optional action to take on the proposal */ + updateAction?: string; + } + interface DeleteOrderDealsResponse { + /** List of deals deleted (in the same proposal as passed in the request) */ + deals?: MarketplaceDeal[]; + /** The updated revision number for the proposal. */ + proposalRevisionNumber?: string; + } + interface DeliveryControl { + creativeBlockingLevel?: string; + deliveryRateType?: string; + frequencyCaps?: DeliveryControlFrequencyCap[]; + } + interface DeliveryControlFrequencyCap { + maxImpressions?: number; + numTimeUnits?: number; + timeUnitType?: string; + } + interface Dimension { + dimensionType?: string; + dimensionValues?: DimensionDimensionValue[]; + } + interface DimensionDimensionValue { + /** Id of the dimension. */ + id?: number; + /** Name of the dimension mainly for debugging purposes, except for the case of CREATIVE_SIZE. For CREATIVE_SIZE, strings are used instead of ids. */ + name?: string; + /** + * Percent of total impressions for a dimension type. e.g. {dimension_type: 'GENDER', [{dimension_value: {id: 1, name: 'MALE', percentage: 60}}]} Gender + * MALE is 60% of all impressions which have gender. + */ + percentage?: number; + } + interface EditAllOrderDealsRequest { + /** + * List of deals to edit. Service may perform 3 different operations based on comparison of deals in this list vs deals already persisted in database: 1. + * Add new deal to proposal If a deal in this list does not exist in the proposal, the service will create a new deal and add it to the proposal. + * Validation will follow AddOrderDealsRequest. 2. Update existing deal in the proposal If a deal in this list already exist in the proposal, the service + * will update that existing deal to this new deal in the request. Validation will follow UpdateOrderDealsRequest. 3. Delete deals from the proposal (just + * need the id) If a existing deal in the proposal is not present in this list, the service will delete that deal from the proposal. Validation will + * follow DeleteOrderDealsRequest. + */ + deals?: MarketplaceDeal[]; + /** If specified, also updates the proposal in the batch transaction. This is useful when the proposal and the deals need to be updated in one transaction. */ + proposal?: Proposal; + /** The last known revision number for the proposal. */ + proposalRevisionNumber?: string; + /** Indicates an optional action to take on the proposal */ + updateAction?: string; + } + interface EditAllOrderDealsResponse { + /** List of all deals in the proposal after edit. */ + deals?: MarketplaceDeal[]; + /** The latest revision number after the update has been applied. */ + orderRevisionNumber?: string; + } + interface GetOffersResponse { + /** The returned list of products. */ + products?: Product[]; + } + interface GetOrderDealsResponse { + /** List of deals for the proposal */ + deals?: MarketplaceDeal[]; + } + interface GetOrderNotesResponse { + /** + * The list of matching notes. The notes for a proposal are ordered from oldest to newest. If the notes span multiple proposals, they will be grouped by + * proposal, with the notes for the most recently modified proposal appearing first. + */ + notes?: MarketplaceNote[]; + } + interface GetOrdersResponse { + /** The list of matching proposals. */ + proposals?: Proposal[]; + } + interface GetPublisherProfilesByAccountIdResponse { + /** Profiles for the requested publisher */ + profiles?: PublisherProfileApiProto[]; + } + interface MarketplaceDeal { + /** Buyer private data (hidden from seller). */ + buyerPrivateData?: PrivateData; + /** The time (ms since epoch) of the deal creation. (readonly) */ + creationTimeMs?: string; + /** Specifies the creative pre-approval policy (buyer-readonly) */ + creativePreApprovalPolicy?: string; + /** Specifies whether the creative is safeFrame compatible (buyer-readonly) */ + creativeSafeFrameCompatibility?: string; + /** A unique deal-id for the deal (readonly). */ + dealId?: string; + /** Metadata about the serving status of this deal (readonly, writes via custom actions) */ + dealServingMetadata?: DealServingMetadata; + /** + * The set of fields around delivery control that are interesting for a buyer to see but are non-negotiable. These are set by the publisher. This message + * is assigned an id of 100 since some day we would want to model this as a protobuf extension. + */ + deliveryControl?: DeliveryControl; + /** The external deal id assigned to this deal once the deal is finalized. This is the deal-id that shows up in serving/reporting etc. (readonly) */ + externalDealId?: string; + /** Proposed flight end time of the deal (ms since epoch) This will generally be stored in a granularity of a second. (updatable) */ + flightEndTimeMs?: string; + /** Proposed flight start time of the deal (ms since epoch) This will generally be stored in a granularity of a second. (updatable) */ + flightStartTimeMs?: string; + /** Description for the deal terms. (buyer-readonly) */ + inventoryDescription?: string; + /** Indicates whether the current deal is a RFP template. RFP template is created by buyer and not based on seller created products. */ + isRfpTemplate?: boolean; + /** True, if the buyside inventory setup is complete for this deal. (readonly, except via OrderSetupCompleted action) */ + isSetupComplete?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#marketplaceDeal". */ + kind?: string; + /** The time (ms since epoch) when the deal was last updated. (readonly) */ + lastUpdateTimeMs?: string; + /** The name of the deal. (updatable) */ + name?: string; + /** The product-id from which this deal was created. (readonly, except on create) */ + productId?: string; + /** The revision number of the product that the deal was created from (readonly, except on create) */ + productRevisionNumber?: string; + /** + * Specifies the creative source for programmatic deals, PUBLISHER means creative is provided by seller and ADVERTISR means creative is provided by buyer. + * (buyer-readonly) + */ + programmaticCreativeSource?: string; + proposalId?: string; + /** Optional Seller contact information for the deal (buyer-readonly) */ + sellerContacts?: ContactInformation[]; + /** The shared targeting visible to buyers and sellers. Each shared targeting entity is AND'd together. (updatable) */ + sharedTargetings?: SharedTargeting[]; + /** The syndication product associated with the deal. (readonly, except on create) */ + syndicationProduct?: string; + /** The negotiable terms of the deal. (updatable) */ + terms?: DealTerms; + webPropertyCode?: string; + } + interface MarketplaceDealParty { + /** The buyer/seller associated with the deal. One of buyer/seller is specified for a deal-party. */ + buyer?: Buyer; + /** The buyer/seller associated with the deal. One of buyer/seller is specified for a deal party. */ + seller?: Seller; + } + interface MarketplaceLabel { + /** The accountId of the party that created the label. */ + accountId?: string; + /** The creation time (in ms since epoch) for the label. */ + createTimeMs?: string; + /** Information about the party that created the label. */ + deprecatedMarketplaceDealParty?: MarketplaceDealParty; + /** The label to use. */ + label?: string; + } + interface MarketplaceNote { + /** The role of the person (buyer/seller) creating the note. (readonly) */ + creatorRole?: string; + /** Notes can optionally be associated with a deal. (readonly, except on create) */ + dealId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#marketplaceNote". */ + kind?: string; + /** The actual note to attach. (readonly, except on create) */ + note?: string; + /** The unique id for the note. (readonly) */ + noteId?: string; + /** The proposalId that a note is attached to. (readonly) */ + proposalId?: string; + /** If the note is associated with a proposal revision number, then store that here. (readonly, except on create) */ + proposalRevisionNumber?: string; + /** The timestamp (ms since epoch) that this note was created. (readonly) */ + timestampMs?: string; + } + interface PerformanceReport { + /** The number of bid responses with an ad. */ + bidRate?: number; + /** The number of bid requests sent to your bidder. */ + bidRequestRate?: number; + /** Rate of various prefiltering statuses per match. Please refer to the callout-status-codes.txt file for different statuses. */ + calloutStatusRate?: any[]; + /** Average QPS for cookie matcher operations. */ + cookieMatcherStatusRate?: any[]; + /** Rate of ads with a given status. Please refer to the creative-status-codes.txt file for different statuses. */ + creativeStatusRate?: any[]; + /** The number of bid responses that were filtered due to a policy violation or other errors. */ + filteredBidRate?: number; + /** Average QPS for hosted match operations. */ + hostedMatchStatusRate?: any[]; + /** The number of potential queries based on your pretargeting settings. */ + inventoryMatchRate?: number; + /** Resource type. */ + kind?: string; + /** The 50th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. */ + latency50thPercentile?: number; + /** The 85th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. */ + latency85thPercentile?: number; + /** The 95th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. */ + latency95thPercentile?: number; + /** Rate of various quota account statuses per quota check. */ + noQuotaInRegion?: number; + /** Rate of various quota account statuses per quota check. */ + outOfQuota?: number; + /** Average QPS for pixel match requests from clients. */ + pixelMatchRequests?: number; + /** Average QPS for pixel match responses from clients. */ + pixelMatchResponses?: number; + /** The configured quota limits for this account. */ + quotaConfiguredLimit?: number; + /** The throttled quota limits for this account. */ + quotaThrottledLimit?: number; + /** The trading location of this data. */ + region?: string; + /** The number of properly formed bid responses received by our servers within the deadline. */ + successfulRequestRate?: number; + /** The unix timestamp of the starting time of this performance data. */ + timestamp?: string; + /** The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc. */ + unsuccessfulRequestRate?: number; + } + interface PerformanceReportList { + /** Resource type. */ + kind?: string; + /** A list of performance reports relevant for the account. */ + performanceReport?: PerformanceReport[]; + } + interface PretargetingConfig { + /** The id for billing purposes, provided for reference. Leave this field blank for insert requests; the id will be generated automatically. */ + billingId?: string; + /** The config id; generated automatically. Leave this field blank for insert requests. */ + configId?: string; + /** The name of the config. Must be unique. Required for all requests. */ + configName?: string; + /** List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO. */ + creativeType?: string[]; + /** Requests which allow one of these (width, height) pairs will match. All pairs must be supported ad dimensions. */ + dimensions?: Array<{ + /** Height in pixels. */ + height?: string; + /** Width in pixels. */ + width?: string; + }>; + /** Requests with any of these content labels will not match. Values are from content-labels.txt in the downloadable files section. */ + excludedContentLabels?: string[]; + /** Requests containing any of these geo criteria ids will not match. */ + excludedGeoCriteriaIds?: string[]; + /** Requests containing any of these placements will not match. */ + excludedPlacements?: Array<{ + /** + * The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id + * for a mobile app placement. + */ + token?: string; + /** The type of the placement. */ + type?: string; + }>; + /** Requests containing any of these users list ids will not match. */ + excludedUserLists?: string[]; + /** Requests containing any of these vertical ids will not match. Values are from the publisher-verticals.txt file in the downloadable files section. */ + excludedVerticals?: string[]; + /** Requests containing any of these geo criteria ids will match. */ + geoCriteriaIds?: string[]; + /** Whether this config is active. Required for all requests. */ + isActive?: boolean; + /** The kind of the resource, i.e. "adexchangebuyer#pretargetingConfig". */ + kind?: string; + /** Request containing any of these language codes will match. */ + languages?: string[]; + /** + * Requests where the predicted viewability is below the specified decile will not match. E.g. if the buyer sets this value to 5, requests from slots + * where the predicted viewability is below 50% will not match. If the predicted viewability is unknown this field will be ignored. + */ + minimumViewabilityDecile?: number; + /** Requests containing any of these mobile carrier ids will match. Values are from mobile-carriers.csv in the downloadable files section. */ + mobileCarriers?: string[]; + /** Requests containing any of these mobile device ids will match. Values are from mobile-devices.csv in the downloadable files section. */ + mobileDevices?: string[]; + /** Requests containing any of these mobile operating system version ids will match. Values are from mobile-os.csv in the downloadable files section. */ + mobileOperatingSystemVersions?: string[]; + /** Requests containing any of these placements will match. */ + placements?: Array<{ + /** + * The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id + * for a mobile app placement. + */ + token?: string; + /** The type of the placement. */ + type?: string; + }>; + /** + * Requests matching any of these platforms will match. Possible values are PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and + * PRETARGETING_PLATFORM_TABLET. + */ + platforms?: string[]; + /** + * Creative attributes should be declared here if all creatives corresponding to this pretargeting configuration have that creative attribute. Values are + * from pretargetable-creative-attributes.txt in the downloadable files section. + */ + supportedCreativeAttributes?: string[]; + /** + * Requests containing the specified type of user data will match. Possible values are HOSTED_MATCH_DATA, which means the request is cookie-targetable and + * has a match in the buyer's hosted match table, and COOKIE_OR_IDFA, which means the request has either a targetable cookie or an iOS IDFA. + */ + userIdentifierDataRequired?: string[]; + /** Requests containing any of these user list ids will match. */ + userLists?: string[]; + /** Requests that allow any of these vendor ids will match. Values are from vendors.txt in the downloadable files section. */ + vendorTypes?: string[]; + /** Requests containing any of these vertical ids will match. */ + verticals?: string[]; + /** Video requests satisfying any of these player size constraints will match. */ + videoPlayerSizes?: Array<{ + /** The type of aspect ratio. Leave this field blank to match all aspect ratios. */ + aspectRatio?: string; + /** The minimum player height in pixels. Leave this field blank to match any player height. */ + minHeight?: string; + /** The minimum player width in pixels. Leave this field blank to match any player width. */ + minWidth?: string; + }>; + } + interface PretargetingConfigList { + /** A list of pretargeting configs */ + items?: PretargetingConfig[]; + /** Resource type. */ + kind?: string; + } + interface Price { + /** The price value in micros. */ + amountMicros?: number; + /** The currency code for the price. */ + currencyCode?: string; + /** In case of CPD deals, the expected CPM in micros. */ + expectedCpmMicros?: number; + /** The pricing type for the deal/product. */ + pricingType?: string; + } + interface PricePerBuyer { + /** Optional access type for this buyer. */ + auctionTier?: string; + /** Reference to the buyer that will get billed. */ + billedBuyer?: Buyer; + /** + * The buyer who will pay this price. If unset, all buyers can pay this price (if the advertisers match, and there's no more specific rule matching the + * buyer). + */ + buyer?: Buyer; + /** The specified price */ + price?: Price; + } + interface PrivateData { + referenceId?: string; + referencePayload?: string; + } + interface Product { + /** The billed buyer corresponding to the buyer that created the offer. (readonly, except on create) */ + billedBuyer?: Buyer; + /** The buyer that created the offer if this is a buyer initiated offer (readonly, except on create) */ + buyer?: Buyer; + /** Creation time in ms. since epoch (readonly) */ + creationTimeMs?: string; + /** Optional contact information for the creator of this product. (buyer-readonly) */ + creatorContacts?: ContactInformation[]; + /** The role that created the offer. Set to BUYER for buyer initiated offers. */ + creatorRole?: string; + /** + * The set of fields around delivery control that are interesting for a buyer to see but are non-negotiable. These are set by the publisher. This message + * is assigned an id of 100 since some day we would want to model this as a protobuf extension. + */ + deliveryControl?: DeliveryControl; + /** The proposed end time for the deal (ms since epoch) (buyer-readonly) */ + flightEndTimeMs?: string; + /** Inventory availability dates. (times are in ms since epoch) The granularity is generally in the order of seconds. (buyer-readonly) */ + flightStartTimeMs?: string; + /** + * If the creator has already signed off on the product, then the buyer can finalize the deal by accepting the product as is. When copying to a proposal, + * if any of the terms are changed, then auto_finalize is automatically set to false. + */ + hasCreatorSignedOff?: boolean; + /** What exchange will provide this inventory (readonly, except on create). */ + inventorySource?: string; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#product". */ + kind?: string; + /** Optional List of labels for the product (optional, buyer-readonly). */ + labels?: MarketplaceLabel[]; + /** Time of last update in ms. since epoch (readonly) */ + lastUpdateTimeMs?: string; + /** Optional legacy offer id if this offer is a preferred deal offer. */ + legacyOfferId?: string; + /** + * Marketplace publisher profile Id. This Id differs from the regular publisher_profile_id in that 1. This is a new id, the old Id will be deprecated in + * 2017. 2. This id uniquely identifies a publisher profile by itself. + */ + marketplacePublisherProfileId?: string; + /** The name for this product as set by the seller. (buyer-readonly) */ + name?: string; + /** Optional private auction id if this offer is a private auction offer. */ + privateAuctionId?: string; + /** The unique id for the product (readonly) */ + productId?: string; + /** + * Id of the publisher profile for a given seller. A (seller.account_id, publisher_profile_id) pair uniquely identifies a publisher profile. Buyers can + * call the PublisherProfiles::List endpoint to get a list of publisher profiles for a given seller. + */ + publisherProfileId?: string; + /** Publisher self-provided forecast information. */ + publisherProvidedForecast?: PublisherProvidedForecast; + /** The revision number of the product. (readonly) */ + revisionNumber?: string; + /** Information about the seller that created this product (readonly, except on create) */ + seller?: Seller; + /** + * Targeting that is shared between the buyer and the seller. Each targeting criteria has a specified key and for each key there is a list of inclusion + * value or exclusion values. (buyer-readonly) + */ + sharedTargetings?: SharedTargeting[]; + /** The state of the product. (buyer-readonly) */ + state?: string; + /** The syndication product associated with the deal. (readonly, except on create) */ + syndicationProduct?: string; + /** The negotiable terms of the deal (buyer-readonly) */ + terms?: DealTerms; + /** The web property code for the seller. This field is meant to be copied over as is when creating deals. */ + webPropertyCode?: string; + } + interface Proposal { + /** Reference to the buyer that will get billed for this proposal. (readonly) */ + billedBuyer?: Buyer; + /** Reference to the buyer on the proposal. (readonly, except on create) */ + buyer?: Buyer; + /** Optional contact information of the buyer. (seller-readonly) */ + buyerContacts?: ContactInformation[]; + /** Private data for buyer. (hidden from seller). */ + buyerPrivateData?: PrivateData; + /** IDs of DBM advertisers permission to this proposal. */ + dbmAdvertiserIds?: string[]; + /** + * When an proposal is in an accepted state, indicates whether the buyer has signed off. Once both sides have signed off on a deal, the proposal can be + * finalized by the seller. (seller-readonly) + */ + hasBuyerSignedOff?: boolean; + /** + * When an proposal is in an accepted state, indicates whether the buyer has signed off Once both sides have signed off on a deal, the proposal can be + * finalized by the seller. (buyer-readonly) + */ + hasSellerSignedOff?: boolean; + /** What exchange will provide this inventory (readonly, except on create). */ + inventorySource?: string; + /** True if the proposal is being renegotiated (readonly). */ + isRenegotiating?: boolean; + /** + * True, if the buyside inventory setup is complete for this proposal. (readonly, except via OrderSetupCompleted action) Deprecated in favor of deal level + * setup complete flag. + */ + isSetupComplete?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#proposal". */ + kind?: string; + /** List of labels associated with the proposal. (readonly) */ + labels?: MarketplaceLabel[]; + /** The role of the last user that either updated the proposal or left a comment. (readonly) */ + lastUpdaterOrCommentorRole?: string; + /** The name for the proposal (updatable) */ + name?: string; + /** Optional negotiation id if this proposal is a preferred deal proposal. */ + negotiationId?: string; + /** Indicates whether the buyer/seller created the proposal.(readonly) */ + originatorRole?: string; + /** Optional private auction id if this proposal is a private auction proposal. */ + privateAuctionId?: string; + /** The unique id of the proposal. (readonly). */ + proposalId?: string; + /** The current state of the proposal. (readonly) */ + proposalState?: string; + /** The revision number for the proposal (readonly). */ + revisionNumber?: string; + /** The time (ms since epoch) when the proposal was last revised (readonly). */ + revisionTimeMs?: string; + /** Reference to the seller on the proposal. (readonly, except on create) */ + seller?: Seller; + /** Optional contact information of the seller (buyer-readonly). */ + sellerContacts?: ContactInformation[]; + } + interface PublisherProfileApiProto { + /** Deprecated: use the seller.account_id. The account id of the seller. */ + accountId?: string; + /** Publisher provided info on its audience. */ + audience?: string; + /** A pitch statement for the buyer */ + buyerPitchStatement?: string; + /** Direct contact for the publisher profile. */ + directContact?: string; + /** Exchange where this publisher profile is from. E.g. AdX, Rubicon etc... */ + exchange?: string; + /** Link to publisher's Google+ page. */ + googlePlusLink?: string; + /** True, if this is the parent profile, which represents all domains owned by the publisher. */ + isParent?: boolean; + /** True, if this profile is published. Deprecated for state. */ + isPublished?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#publisherProfileApiProto". */ + kind?: string; + /** The url to the logo for the publisher. */ + logoUrl?: string; + /** The url for additional marketing and sales materials. */ + mediaKitLink?: string; + name?: string; + /** Publisher provided overview. */ + overview?: string; + /** The pair of (seller.account_id, profile_id) uniquely identifies a publisher profile for a given publisher. */ + profileId?: number; + /** Programmatic contact for the publisher profile. */ + programmaticContact?: string; + /** The list of domains represented in this publisher profile. Empty if this is a parent profile. */ + publisherDomains?: string[]; + /** Unique Id for publisher profile. */ + publisherProfileId?: string; + /** Publisher provided forecasting information. */ + publisherProvidedForecast?: PublisherProvidedForecast; + /** Link to publisher rate card */ + rateCardInfoLink?: string; + /** Link for a sample content page. */ + samplePageLink?: string; + /** Seller of the publisher profile. */ + seller?: Seller; + /** State of the publisher profile. */ + state?: string; + /** Publisher provided key metrics and rankings. */ + topHeadlines?: string[]; + } + interface PublisherProvidedForecast { + /** Publisher provided dimensions. E.g. geo, sizes etc... */ + dimensions?: Dimension[]; + /** Publisher provided weekly impressions. */ + weeklyImpressions?: string; + /** Publisher provided weekly uniques. */ + weeklyUniques?: string; + } + interface Seller { + /** The unique id for the seller. The seller fills in this field. The seller account id is then available to buyer in the product. */ + accountId?: string; + /** Optional sub-account id for the seller. */ + subAccountId?: string; + } + interface SharedTargeting { + /** The list of values to exclude from targeting. Each value is AND'd together. */ + exclusions?: TargetingValue[]; + /** The list of value to include as part of the targeting. Each value is OR'd together. */ + inclusions?: TargetingValue[]; + /** The key representing the shared targeting criterion. */ + key?: string; + } + interface TargetingValue { + /** The creative size value to exclude/include. */ + creativeSizeValue?: TargetingValueCreativeSize; + /** The daypart targeting to include / exclude. Filled in when the key is GOOG_DAYPART_TARGETING. */ + dayPartTargetingValue?: TargetingValueDayPartTargeting; + /** The long value to exclude/include. */ + longValue?: string; + /** The string value to exclude/include. */ + stringValue?: string; + } + interface TargetingValueCreativeSize { + /** For video size type, the list of companion sizes. */ + companionSizes?: TargetingValueSize[]; + /** The Creative size type. */ + creativeSizeType?: string; + /** The native template for native ad. */ + nativeTemplate?: string; + /** For regular or video creative size type, specifies the size of the creative. */ + size?: TargetingValueSize; + /** The skippable ad type for video size. */ + skippableAdType?: string; + } + interface TargetingValueDayPartTargeting { + dayParts?: TargetingValueDayPartTargetingDayPart[]; + timeZoneType?: string; + } + interface TargetingValueDayPartTargetingDayPart { + dayOfWeek?: string; + endHour?: number; + endMinute?: number; + startHour?: number; + startMinute?: number; + } + interface TargetingValueSize { + /** The height of the creative. */ + height?: number; + /** The width of the creative. */ + width?: number; + } + interface UpdatePrivateAuctionProposalRequest { + /** The externalDealId of the deal to be updated. */ + externalDealId?: string; + /** Optional note to be added. */ + note?: MarketplaceNote; + /** The current revision number of the proposal to be updated. */ + proposalRevisionNumber?: string; + /** The proposed action on the private auction proposal. */ + updateAction?: string; + } + interface AccountsResource { + /** Gets one account by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The account id */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the authenticated user's list of accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Confirmation for erasing bidder and cookie matching urls. */ + confirmUnsafeAccountChange?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The account id */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Confirmation for erasing bidder and cookie matching urls. */ + confirmUnsafeAccountChange?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The account id */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BillingInfoResource { + /** Returns the billing information for one account specified by account ID. */ + get(request: { + /** The account id. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of billing information for all accounts of the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BudgetResource { + /** Returns the budget information for the adgroup specified by the accountId and billingId. */ + get(request: { + /** The account id to get the budget information for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The billing id to get the budget information for. */ + billingId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method + * supports patch semantics. + */ + patch(request: { + /** The account id associated with the budget being updated. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The billing id associated with the budget being updated. */ + billingId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. */ + update(request: { + /** The account id associated with the budget being updated. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The billing id associated with the budget being updated. */ + billingId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativesResource { + /** Add a deal id association for the creative. */ + addDeal(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** The id of the deal id to associate with this creative. */ + dealId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the status for a single creative. A creative will be available 30-40 minutes after submission. */ + get(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Submit a new creative. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. */ + list(request: { + /** When specified, only creatives for the given account ids are returned. */ + accountId?: number; + /** Data format for the response. */ + alt?: string; + /** When specified, only creatives for the given buyer creative ids are returned. */ + buyerCreativeId?: string; + /** When specified, only creatives having the given deals status are returned. */ + dealsStatusFilter?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of entries returned on one result page. If not set, the default is 100. Optional. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** When specified, only creatives having the given open auction status are returned. */ + openAuctionStatusFilter?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. Optional. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the external deal ids associated with the creative. */ + listDeals(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Remove a deal id associated with the creative. */ + removeDeal(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** The id of the deal id to disassociate with this creative. */ + dealId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MarketplacedealsResource { + /** Delete the specified deals from the proposal */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to delete deals from. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Add new deals for the specified proposal */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** proposalId for which deals need to be added. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all the deals for a given proposal */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Query string to retrieve specific deals. */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Replaces all the deals in the proposal with the passed in deals */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to edit deals on. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MarketplacenotesResource { + /** Add notes to the proposal */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to add notes for. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get all the notes associated with a proposal */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Query string to retrieve specific notes. To search the text contents of notes, please use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE + * "%bar%" + */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MarketplaceprivateauctionResource { + /** Update a given private auction proposal */ + updateproposal(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The private auction id to be updated. */ + privateAuctionId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PerformanceReportResource { + /** Retrieves the authenticated user's list of performance metrics. */ + list(request: { + /** The account id to get the reports. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The end time of the report in ISO 8601 timestamp format using UTC. */ + endDateTime: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of entries returned on one result page. If not set, the default is 100. Optional. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. Optional. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The start time of the report in ISO 8601 timestamp format using UTC. */ + startDateTime: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PretargetingConfigResource { + /** Deletes an existing pretargeting config. */ + delete(request: { + /** The account id to delete the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to delete. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a specific pretargeting configuration */ + get(request: { + /** The account id to get the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to retrieve. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new pretargeting configuration. */ + insert(request: { + /** The account id to insert the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of the authenticated user's pretargeting configurations. */ + list(request: { + /** The account id to get the pretargeting configs for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing pretargeting config. This method supports patch semantics. */ + patch(request: { + /** The account id to update the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to update. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing pretargeting config. */ + update(request: { + /** The account id to update the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to update. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** Gets the requested product by id. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The id for the product to get the head revision for. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the requested product. */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The pql query used to query for products. */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProposalsResource { + /** Get a proposal given its id */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Id of the proposal to retrieve. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Create the given list of proposals */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the given proposal. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposal id to update. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller + * should then fetch the latest proposal at head revision and retry the update at that revision. + */ + revisionNumber: string; + /** The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. */ + updateAction: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Search for proposals using pql query */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Query string to retrieve specific proposals. */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the given proposal to indicate that setup has been completed. */ + setupcomplete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposal id for which the setup is complete */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the given proposal */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposal id to update. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller + * should then fetch the latest proposal at head revision and retry the update at that revision. + */ + revisionNumber: string; + /** The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. */ + updateAction: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PubprofilesResource { + /** Gets the requested publisher profile(s) by publisher accountId. */ + list(request: { + /** The accountId of the publisher to get profiles for. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adexchangebuyer/readme.md b/types/gapi.client.adexchangebuyer/readme.md new file mode 100644 index 0000000000..ab46fb564c --- /dev/null +++ b/types/gapi.client.adexchangebuyer/readme.md @@ -0,0 +1,244 @@ +# TypeScript typings for Ad Exchange Buyer API v1.4 +Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports. +For detailed description please check [documentation](https://developers.google.com/ad-exchange/buyer-rest). + +## Installing + +Install typings for Ad Exchange Buyer API: +``` +npm install @types/gapi.client.adexchangebuyer@v1.4 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexchangebuyer', 'v1.4', () => { + // now we can use gapi.client.adexchangebuyer + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your Ad Exchange buyer account configuration + 'https://www.googleapis.com/auth/adexchange.buyer', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Ad Exchange Buyer API resources: + +```typescript + +/* +Gets one account by ID. +*/ +await gapi.client.accounts.get({ id: 1, }); + +/* +Retrieves the authenticated user's list of accounts. +*/ +await gapi.client.accounts.list({ }); + +/* +Updates an existing account. This method supports patch semantics. +*/ +await gapi.client.accounts.patch({ id: 1, }); + +/* +Updates an existing account. +*/ +await gapi.client.accounts.update({ id: 1, }); + +/* +Returns the billing information for one account specified by account ID. +*/ +await gapi.client.billingInfo.get({ accountId: 1, }); + +/* +Retrieves a list of billing information for all accounts of the authenticated user. +*/ +await gapi.client.billingInfo.list({ }); + +/* +Returns the budget information for the adgroup specified by the accountId and billingId. +*/ +await gapi.client.budget.get({ accountId: "accountId", billingId: "billingId", }); + +/* +Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics. +*/ +await gapi.client.budget.patch({ accountId: "accountId", billingId: "billingId", }); + +/* +Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. +*/ +await gapi.client.budget.update({ accountId: "accountId", billingId: "billingId", }); + +/* +Add a deal id association for the creative. +*/ +await gapi.client.creatives.addDeal({ accountId: 1, buyerCreativeId: "buyerCreativeId", dealId: "dealId", }); + +/* +Gets the status for a single creative. A creative will be available 30-40 minutes after submission. +*/ +await gapi.client.creatives.get({ accountId: 1, buyerCreativeId: "buyerCreativeId", }); + +/* +Submit a new creative. +*/ +await gapi.client.creatives.insert({ }); + +/* +Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. +*/ +await gapi.client.creatives.list({ }); + +/* +Lists the external deal ids associated with the creative. +*/ +await gapi.client.creatives.listDeals({ accountId: 1, buyerCreativeId: "buyerCreativeId", }); + +/* +Remove a deal id associated with the creative. +*/ +await gapi.client.creatives.removeDeal({ accountId: 1, buyerCreativeId: "buyerCreativeId", dealId: "dealId", }); + +/* +Delete the specified deals from the proposal +*/ +await gapi.client.marketplacedeals.delete({ proposalId: "proposalId", }); + +/* +Add new deals for the specified proposal +*/ +await gapi.client.marketplacedeals.insert({ proposalId: "proposalId", }); + +/* +List all the deals for a given proposal +*/ +await gapi.client.marketplacedeals.list({ proposalId: "proposalId", }); + +/* +Replaces all the deals in the proposal with the passed in deals +*/ +await gapi.client.marketplacedeals.update({ proposalId: "proposalId", }); + +/* +Add notes to the proposal +*/ +await gapi.client.marketplacenotes.insert({ proposalId: "proposalId", }); + +/* +Get all the notes associated with a proposal +*/ +await gapi.client.marketplacenotes.list({ proposalId: "proposalId", }); + +/* +Update a given private auction proposal +*/ +await gapi.client.marketplaceprivateauction.updateproposal({ privateAuctionId: "privateAuctionId", }); + +/* +Retrieves the authenticated user's list of performance metrics. +*/ +await gapi.client.performanceReport.list({ accountId: "accountId", endDateTime: "endDateTime", startDateTime: "startDateTime", }); + +/* +Deletes an existing pretargeting config. +*/ +await gapi.client.pretargetingConfig.delete({ accountId: "accountId", configId: "configId", }); + +/* +Gets a specific pretargeting configuration +*/ +await gapi.client.pretargetingConfig.get({ accountId: "accountId", configId: "configId", }); + +/* +Inserts a new pretargeting configuration. +*/ +await gapi.client.pretargetingConfig.insert({ accountId: "accountId", }); + +/* +Retrieves a list of the authenticated user's pretargeting configurations. +*/ +await gapi.client.pretargetingConfig.list({ accountId: "accountId", }); + +/* +Updates an existing pretargeting config. This method supports patch semantics. +*/ +await gapi.client.pretargetingConfig.patch({ accountId: "accountId", configId: "configId", }); + +/* +Updates an existing pretargeting config. +*/ +await gapi.client.pretargetingConfig.update({ accountId: "accountId", configId: "configId", }); + +/* +Gets the requested product by id. +*/ +await gapi.client.products.get({ productId: "productId", }); + +/* +Gets the requested product. +*/ +await gapi.client.products.search({ }); + +/* +Get a proposal given its id +*/ +await gapi.client.proposals.get({ proposalId: "proposalId", }); + +/* +Create the given list of proposals +*/ +await gapi.client.proposals.insert({ }); + +/* +Update the given proposal. This method supports patch semantics. +*/ +await gapi.client.proposals.patch({ proposalId: "proposalId", revisionNumber: "revisionNumber", updateAction: "updateAction", }); + +/* +Search for proposals using pql query +*/ +await gapi.client.proposals.search({ }); + +/* +Update the given proposal to indicate that setup has been completed. +*/ +await gapi.client.proposals.setupcomplete({ proposalId: "proposalId", }); + +/* +Update the given proposal +*/ +await gapi.client.proposals.update({ proposalId: "proposalId", revisionNumber: "revisionNumber", updateAction: "updateAction", }); + +/* +Gets the requested publisher profile(s) by publisher accountId. +*/ +await gapi.client.pubprofiles.list({ accountId: 1, }); +``` \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer/tsconfig.json b/types/gapi.client.adexchangebuyer/tsconfig.json new file mode 100644 index 0000000000..a6ddc40ec7 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexchangebuyer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer/tslint.json b/types/gapi.client.adexchangebuyer/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexchangebuyer2/gapi.client.adexchangebuyer2-tests.ts b/types/gapi.client.adexchangebuyer2/gapi.client.adexchangebuyer2-tests.ts new file mode 100644 index 0000000000..0e6ee50fe5 --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/gapi.client.adexchangebuyer2-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexchangebuyer2', 'v2beta1', () => { + /** now we can use gapi.client.adexchangebuyer2 */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Ad Exchange buyer account configuration */ + 'https://www.googleapis.com/auth/adexchange.buyer', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.adexchangebuyer2/index.d.ts b/types/gapi.client.adexchangebuyer2/index.d.ts new file mode 100644 index 0000000000..40ab26679b --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/index.d.ts @@ -0,0 +1,2400 @@ +// Type definitions for Google Ad Exchange Buyer API II v2beta1 2.0 +// Project: https://developers.google.com/ad-exchange/buyer-rest/reference/rest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://adexchangebuyer.googleapis.com/$discovery/rest?version=v2beta1 + +/// + +declare namespace gapi.client { + /** Load Ad Exchange Buyer API II v2beta1 */ + function load(name: "adexchangebuyer2", version: "v2beta1"): PromiseLike; + function load(name: "adexchangebuyer2", version: "v2beta1", callback: () => any): void; + + const accounts: adexchangebuyer2.AccountsResource; + + namespace adexchangebuyer2 { + interface AbsoluteDateRange { + /** + * The end date of the range (inclusive). + * Must be within the 30 days leading up to current date, and must be equal to + * or after start_date. + */ + endDate?: Date; + /** + * The start date of the range (inclusive). + * Must be within the 30 days leading up to current date, and must be equal to + * or before end_date. + */ + startDate?: Date; + } + interface AddDealAssociationRequest { + /** The association between a creative and a deal that should be added. */ + association?: CreativeDealAssociation; + } + interface AppContext { + /** The app types this restriction applies to. */ + appTypes?: string[]; + } + interface AuctionContext { + /** The auction types this restriction applies to. */ + auctionTypes?: string[]; + } + interface BidMetricsRow { + /** The number of bids that Ad Exchange received from the buyer. */ + bids?: MetricValue; + /** The number of bids that were permitted to compete in the auction. */ + bidsInAuction?: MetricValue; + /** The number of bids for which the buyer was billed. */ + billedImpressions?: MetricValue; + /** The number of bids that won an impression. */ + impressionsWon?: MetricValue; + /** + * The number of bids for which the corresponding impression was measurable + * for viewability (as defined by Active View). + */ + measurableImpressions?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** + * The number of bids for which the corresponding impression was viewable (as + * defined by Active View). + */ + viewableImpressions?: MetricValue; + } + interface BidResponseWithoutBidsStatusRow { + /** + * The number of impressions for which there was a bid response with the + * specified status. + */ + impressionCount?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** + * The status specifying why the bid responses were considered to have no + * applicable bids. + */ + status?: string; + } + interface CalloutStatusRow { + /** + * The ID of the callout status. + * See [callout-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/callout-status-codes). + */ + calloutStatusId?: number; + /** + * The number of impressions for which there was a bid request or bid response + * with the specified callout status. + */ + impressionCount?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface Client { + /** + * The globally-unique numerical ID of the client. + * The value of this field is ignored in create and update operations. + */ + clientAccountId?: string; + /** + * Name used to represent this client to publishers. + * You may have multiple clients that map to the same entity, + * but for each client the combination of `clientName` and entity + * must be unique. + * You can specify this field as empty. + */ + clientName?: string; + /** + * Numerical identifier of the client entity. + * The entity can be an advertiser, a brand, or an agency. + * This identifier is unique among all the entities with the same type. + * + * A list of all known advertisers with their identifiers is available in the + * [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt) + * file. + * + * A list of all known brands with their identifiers is available in the + * [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt) + * file. + * + * A list of all known agencies with their identifiers is available in the + * [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt) + * file. + */ + entityId?: string; + /** + * The name of the entity. This field is automatically fetched based on + * the type and ID. + * The value of this field is ignored in create and update operations. + */ + entityName?: string; + /** The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`. */ + entityType?: string; + /** + * The role which is assigned to the client buyer. Each role implies a set of + * permissions granted to the client. Must be one of `CLIENT_DEAL_VIEWER`, + * `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`. + */ + role?: string; + /** The status of the client buyer. */ + status?: string; + /** Whether the client buyer will be visible to sellers. */ + visibleToSeller?: boolean; + } + interface ClientUser { + /** + * Numerical account ID of the client buyer + * with which the user is associated; the + * buyer must be a client of the current sponsor buyer. + * The value of this field is ignored in an update operation. + */ + clientAccountId?: string; + /** + * User's email address. The value of this field + * is ignored in an update operation. + */ + email?: string; + /** The status of the client user. */ + status?: string; + /** + * The unique numerical ID of the client user + * that has accepted an invitation. + * The value of this field is ignored in an update operation. + */ + userId?: string; + } + interface ClientUserInvitation { + /** + * Numerical account ID of the client buyer + * that the invited user is associated with. + * The value of this field is ignored in create operations. + */ + clientAccountId?: string; + /** + * The email address to which the invitation is sent. Email + * addresses should be unique among all client users under each sponsor + * buyer. + */ + email?: string; + /** + * The unique numerical ID of the invitation that is sent to the user. + * The value of this field is ignored in create operations. + */ + invitationId?: string; + } + interface Correction { + /** The contexts for the correction. */ + contexts?: ServingContext[]; + /** Additional details about what was corrected. */ + details?: string[]; + /** The type of correction that was applied to the creative. */ + type?: string; + } + interface Creative { + /** + * The account that this creative belongs to. + * Can be used to filter the response of the + * creatives.list + * method. + */ + accountId?: string; + /** The link to AdChoices destination page. */ + adChoicesDestinationUrl?: string; + /** The name of the company being advertised in the creative. */ + advertiserName?: string; + /** The agency ID for this creative. */ + agencyId?: string; + /** @OutputOnly The last update timestamp of the creative via API. */ + apiUpdateTime?: string; + /** + * All attributes for the ads that may be shown from this creative. + * Can be used to filter the response of the + * creatives.list + * method. + */ + attributes?: string[]; + /** The set of destination URLs for the creative. */ + clickThroughUrls?: string[]; + /** @OutputOnly Shows any corrections that were applied to this creative. */ + corrections?: Correction[]; + /** + * The buyer-defined creative ID of this creative. + * Can be used to filter the response of the + * creatives.list + * method. + */ + creativeId?: string; + /** + * @OutputOnly The top-level deals status of this creative. + * If disapproved, an entry for 'auctionType=DIRECT_DEALS' (or 'ALL') in + * serving_restrictions will also exist. Note + * that this may be nuanced with other contextual restrictions, in which case, + * it may be preferable to read from serving_restrictions directly. + * Can be used to filter the response of the + * creatives.list + * method. + */ + dealsStatus?: string; + /** @OutputOnly Detected advertiser IDs, if any. */ + detectedAdvertiserIds?: string[]; + /** + * @OutputOnly + * The detected domains for this creative. + */ + detectedDomains?: string[]; + /** + * @OutputOnly + * The detected languages for this creative. The order is arbitrary. The codes + * are 2 or 5 characters and are documented at + * https://developers.google.com/adwords/api/docs/appendix/languagecodes. + */ + detectedLanguages?: string[]; + /** + * @OutputOnly Detected product categories, if any. + * See the ad-product-categories.txt file in the technical documentation + * for a list of IDs. + */ + detectedProductCategories?: number[]; + /** + * @OutputOnly Detected sensitive categories, if any. + * See the ad-sensitive-categories.txt file in the technical documentation for + * a list of IDs. You should use these IDs along with the + * excluded-sensitive-category field in the bid request to filter your bids. + */ + detectedSensitiveCategories?: number[]; + /** @OutputOnly The filtering stats for this creative. */ + filteringStats?: FilteringStats; + /** An HTML creative. */ + html?: HtmlContent; + /** The set of URLs to be called to record an impression. */ + impressionTrackingUrls?: string[]; + /** A native creative. */ + native?: NativeContent; + /** + * @OutputOnly The top-level open auction status of this creative. + * If disapproved, an entry for 'auctionType = OPEN_AUCTION' (or 'ALL') in + * serving_restrictions will also exist. Note + * that this may be nuanced with other contextual restrictions, in which case, + * it may be preferable to read from serving_restrictions directly. + * Can be used to filter the response of the + * creatives.list + * method. + */ + openAuctionStatus?: string; + /** All restricted categories for the ads that may be shown from this creative. */ + restrictedCategories?: string[]; + /** + * @OutputOnly The granular status of this ad in specific contexts. + * A context here relates to where something ultimately serves (for example, + * a physical location, a platform, an HTTPS vs HTTP request, or the type + * of auction). + */ + servingRestrictions?: ServingRestriction[]; + /** + * All vendor IDs for the ads that may be shown from this creative. + * See https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt + * for possible values. + */ + vendorIds?: number[]; + /** @OutputOnly The version of this creative. */ + version?: number; + /** A video creative. */ + video?: VideoContent; + } + interface CreativeDealAssociation { + /** The account the creative belongs to. */ + accountId?: string; + /** The ID of the creative associated with the deal. */ + creativeId?: string; + /** The externalDealId for the deal associated with the creative. */ + dealsId?: string; + } + interface CreativeStatusRow { + /** The number of bids with the specified status. */ + bidCount?: MetricValue; + /** + * The ID of the creative status. + * See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + */ + creativeStatusId?: number; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day?: number; + /** Month of year. Must be from 1 to 12. */ + month?: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without + * a year. + */ + year?: number; + } + interface Disapproval { + /** Additional details about the reason for disapproval. */ + details?: string[]; + /** The categorized reason for disapproval. */ + reason?: string; + } + interface FilterSet { + /** + * An absolute date range, defined by a start date and an end date. + * Interpreted relative to Pacific time zone. + */ + absoluteDateRange?: AbsoluteDateRange; + /** The ID of the buyer account on which to filter; optional. */ + buyerAccountId?: string; + /** The ID of the creative on which to filter; optional. */ + creativeId?: string; + /** The ID of the deal on which to filter; optional. */ + dealId?: string; + /** The environment on which to filter; optional. */ + environment?: string; + /** + * The ID of the filter set; unique within the account of the filter set + * owner. + * The value of this field is ignored in create operations. + */ + filterSetId?: string; + /** The format on which to filter; optional. */ + format?: string; + /** + * The account ID of the buyer who owns this filter set. + * The value of this field is ignored in create operations. + */ + ownerAccountId?: string; + /** + * The list of platforms on which to filter; may be empty. The filters + * represented by multiple platforms are ORed together (i.e. if non-empty, + * results must match any one of the platforms). + */ + platforms?: string[]; + /** + * An open-ended realtime time range, defined by the aggregation start + * timestamp. + */ + realtimeTimeRange?: RealtimeTimeRange; + /** + * A relative date range, defined by an offset from today and a duration. + * Interpreted relative to Pacific time zone. + */ + relativeDateRange?: RelativeDateRange; + /** + * The list of IDs of the seller (publisher) networks on which to filter; + * may be empty. The filters represented by multiple seller network IDs are + * ORed together (i.e. if non-empty, results must match any one of the + * publisher networks). + * See [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids) + * file for the set of existing seller network IDs. + */ + sellerNetworkIds?: number[]; + /** + * The granularity of time intervals if a time series breakdown is desired; + * optional. + */ + timeSeriesGranularity?: string; + } + interface FilteredBidCreativeRow { + /** The number of bids with the specified creative. */ + bidCount?: MetricValue; + /** The ID of the creative. */ + creativeId?: string; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface FilteredBidDetailRow { + /** The number of bids with the specified detail. */ + bidCount?: MetricValue; + /** + * The ID of the detail. The associated value can be looked up in the + * dictionary file corresponding to the DetailType in the response message. + */ + detailId?: number; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface FilteringStats { + /** + * The day during which the data was collected. + * The data is collected from 00:00:00 to 23:59:59 PT. + * During switches from PST to PDT and back, the day may + * contain 23 or 25 hours of data instead of the usual 24. + */ + date?: Date; + /** The set of filtering reasons for this date. */ + reasons?: Reason[]; + } + interface HtmlContent { + /** The height of the HTML snippet in pixels. */ + height?: number; + /** The HTML snippet that displays the ad when inserted in the web page. */ + snippet?: string; + /** The width of the HTML snippet in pixels. */ + width?: number; + } + interface Image { + /** Image height in pixels. */ + height?: number; + /** The URL of the image. */ + url?: string; + /** Image width in pixels. */ + width?: number; + } + interface ImpressionMetricsRow { + /** + * The number of impressions available to the buyer on Ad Exchange. + * In some cases this value may be unavailable. + */ + availableImpressions?: MetricValue; + /** + * The number of impressions for which Ad Exchange sent the buyer a bid + * request. + */ + bidRequests?: MetricValue; + /** The number of impressions that match the buyer's inventory pretargeting. */ + inventoryMatches?: MetricValue; + /** + * The number of impressions for which Ad Exchange received a response from + * the buyer that contained at least one applicable bid. + */ + responsesWithBids?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** + * The number of impressions for which the buyer successfully sent a response + * to Ad Exchange. + */ + successfulResponses?: MetricValue; + } + interface ListBidMetricsResponse { + /** List of rows, each containing a set of bid metrics. */ + bidMetricsRows?: BidMetricsRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListBidMetricsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.bidMetrics.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListBidResponseErrorsResponse { + /** List of rows, with counts of bid responses aggregated by callout status. */ + calloutStatusRows?: CalloutStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListBidResponseErrorsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.bidResponseErrors.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListBidResponsesWithoutBidsResponse { + /** + * List of rows, with counts of bid responses without bids aggregated by + * status. + */ + bidResponseWithoutBidsStatusRows?: BidResponseWithoutBidsStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListBidResponsesWithoutBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.bidResponsesWithoutBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListClientUserInvitationsResponse { + /** The returned list of client users. */ + invitations?: ClientUserInvitation[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListClientUserInvitationsRequest.pageToken + * field in the subsequent call to the + * clients.invitations.list + * method to retrieve the next + * page of results. + */ + nextPageToken?: string; + } + interface ListClientUsersResponse { + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListClientUsersRequest.pageToken + * field in the subsequent call to the + * clients.invitations.list + * method to retrieve the next + * page of results. + */ + nextPageToken?: string; + /** The returned list of client users. */ + users?: ClientUser[]; + } + interface ListClientsResponse { + /** The returned list of clients. */ + clients?: Client[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListClientsRequest.pageToken + * field in the subsequent call to the + * accounts.clients.list method + * to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListCreativeStatusBreakdownByCreativeResponse { + /** + * List of rows, with counts of bids with a given creative status aggregated + * by creative. + */ + filteredBidCreativeRows?: FilteredBidCreativeRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListCreativeStatusBreakdownByCreativeRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBids.creatives.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListCreativeStatusBreakdownByDetailResponse { + /** The type of detail that the detail IDs represent. */ + detailType?: string; + /** + * List of rows, with counts of bids with a given creative status aggregated + * by detail. + */ + filteredBidDetailRows?: FilteredBidDetailRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListCreativeStatusBreakdownByDetailRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBids.details.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListCreativesResponse { + /** The list of creatives. */ + creatives?: Creative[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListCreativesRequest.page_token + * field in the subsequent call to `ListCreatives` method to retrieve the next + * page of results. + */ + nextPageToken?: string; + } + interface ListDealAssociationsResponse { + /** The list of associations. */ + associations?: CreativeDealAssociation[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListDealAssociationsRequest.page_token + * field in the subsequent call to 'ListDealAssociation' method to retrieve + * the next page of results. + */ + nextPageToken?: string; + } + interface ListFilterSetsResponse { + /** The filter sets belonging to the buyer. */ + filterSets?: FilterSet[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListFilterSetsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListFilteredBidRequestsResponse { + /** + * List of rows, with counts of filtered bid requests aggregated by callout + * status. + */ + calloutStatusRows?: CalloutStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListFilteredBidRequestsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBidRequests.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListFilteredBidsResponse { + /** + * List of rows, with counts of filtered bids aggregated by filtering reason + * (i.e. creative status). + */ + creativeStatusRows?: CreativeStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListFilteredBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListImpressionMetricsResponse { + /** List of rows, each containing a set of impression metrics. */ + impressionMetricsRows?: ImpressionMetricsRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListImpressionMetricsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.impressionMetrics.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListLosingBidsResponse { + /** + * List of rows, with counts of losing bids aggregated by loss reason (i.e. + * creative status). + */ + creativeStatusRows?: CreativeStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListLosingBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.losingBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListNonBillableWinningBidsResponse { + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListNonBillableWinningBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.nonBillableWinningBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + /** List of rows, with counts of bids not billed aggregated by reason. */ + nonBillableWinningBidStatusRows?: NonBillableWinningBidStatusRow[]; + } + interface LocationContext { + /** + * IDs representing the geo location for this context. + * Please refer to the + * [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv) + * file for different geo criteria IDs. + */ + geoCriteriaIds?: number[]; + } + interface MetricValue { + /** The expected value of the metric. */ + value?: string; + /** + * The variance (i.e. square of the standard deviation) of the metric value. + * If value is exact, variance is 0. + * Can be used to calculate margin of error as a percentage of value, using + * the following formula, where Z is the standard constant that depends on the + * desired size of the confidence interval (e.g. for 90% confidence interval, + * use Z = 1.645): + * + * marginOfError = 100 * Z * sqrt(variance) / value + */ + variance?: string; + } + interface NativeContent { + /** The name of the advertiser or sponsor, to be displayed in the ad creative. */ + advertiserName?: string; + /** The app icon, for app download ads. */ + appIcon?: Image; + /** A long description of the ad. */ + body?: string; + /** A label for the button that the user is supposed to click. */ + callToAction?: string; + /** The URL that the browser/SDK will load when the user clicks the ad. */ + clickLinkUrl?: string; + /** The URL to use for click tracking. */ + clickTrackingUrl?: string; + /** A short title for the ad. */ + headline?: string; + /** A large image. */ + image?: Image; + /** A smaller image, for the advertiser's logo. */ + logo?: Image; + /** The price of the promoted app including currency info. */ + priceDisplayText?: string; + /** The app rating in the app store. Must be in the range [0-5]. */ + starRating?: number; + /** The URL to the app store to purchase/download the promoted app. */ + storeUrl?: string; + /** The URL to fetch a native video ad. */ + videoUrl?: string; + } + interface NonBillableWinningBidStatusRow { + /** The number of bids with the specified status. */ + bidCount?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** The status specifying why the winning bids were not billed. */ + status?: string; + } + interface PlatformContext { + /** The platforms this restriction applies to. */ + platforms?: string[]; + } + interface RealtimeTimeRange { + /** The start timestamp of the real-time RTB metrics aggregation. */ + startTimestamp?: string; + } + interface Reason { + /** + * The number of times the creative was filtered for the status. The + * count is aggregated across all publishers on the exchange. + */ + count?: string; + /** + * The filtering status code. Please refer to the + * [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb-dictionaries/creative-status-codes.txt) + * file for different statuses. + */ + status?: number; + } + interface RelativeDateRange { + /** + * The number of days in the requested date range. E.g. for a range spanning + * today, 1. For a range spanning the last 7 days, 7. + */ + durationDays?: number; + /** + * The end date of the filter set, specified as the number of days before + * today. E.g. for a range where the last date is today, 0. + */ + offsetDays?: number; + } + interface RemoveDealAssociationRequest { + /** The association between a creative and a deal that should be removed. */ + association?: CreativeDealAssociation; + } + interface RowDimensions { + /** The time interval that this row represents. */ + timeInterval?: TimeInterval; + } + interface SecurityContext { + /** The security types in this context. */ + securities?: string[]; + } + interface ServingContext { + /** Matches all contexts. */ + all?: string; + /** Matches impressions for a particular app type. */ + appType?: AppContext; + /** Matches impressions for a particular auction type. */ + auctionType?: AuctionContext; + /** + * Matches impressions coming from users *or* publishers in a specific + * location. + */ + location?: LocationContext; + /** Matches impressions coming from a particular platform. */ + platform?: PlatformContext; + /** Matches impressions for a particular security type. */ + securityType?: SecurityContext; + } + interface ServingRestriction { + /** The contexts for the restriction. */ + contexts?: ServingContext[]; + /** + * Any disapprovals bound to this restriction. + * Only present if status=DISAPPROVED. + * Can be used to filter the response of the + * creatives.list + * method. + */ + disapprovalReasons?: Disapproval[]; + /** + * The status of the creative in this context (for example, it has been + * explicitly disapproved or is pending review). + */ + status?: string; + } + interface TimeInterval { + /** + * The timestamp marking the end of the range (exclusive) for which data is + * included. + */ + endTime?: string; + /** + * The timestamp marking the start of the range (inclusive) for which data is + * included. + */ + startTime?: string; + } + interface VideoContent { + /** The URL to fetch a video ad. */ + videoUrl?: string; + } + interface WatchCreativeRequest { + /** + * The Pub/Sub topic to publish notifications to. + * This topic must already exist and must give permission to + * ad-exchange-buyside-reports@google.com to write to the topic. + * This should be the full resource name in + * "projects/{project_id}/topics/{topic_id}" format. + */ + topic?: string; + } + interface InvitationsResource { + /** + * Creates and sends out an email invitation to access + * an Ad Exchange client buyer account. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer that the user + * should be associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Retrieves an existing client user invitation. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer that the user invitation + * to be retrieved is associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Numerical identifier of the user invitation to retrieve. (required) */ + invitationId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists all the client users invitations for a client + * with a given account ID. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer to list invitations for. + * (required) + * You must either specify a string representation of a + * numerical account identifier or the `-` character + * to list all the invitations for all the clients + * of a given sponsor buyer. + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. Server may return fewer clients than requested. + * If unspecified, server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListClientUserInvitationsResponse.nextPageToken + * returned from the previous call to the + * clients.invitations.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface UsersResource { + /** Retrieves an existing client user. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer + * that the user to be retrieved is associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Numerical identifier of the user to retrieve. (required) */ + userId: string; + }): Request; + /** + * Lists all the known client users for a specified + * sponsor buyer account ID. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Numerical account ID of the sponsor buyer of the client to list users for. + * (required) + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The account ID of the client buyer to list users for. (required) + * You must specify either a string representation of a + * numerical account identifier or the `-` character + * to list all the client users for all the clients + * of a given sponsor buyer. + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer clients than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListClientUsersResponse.nextPageToken + * returned from the previous call to the + * accounts.clients.users.list method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates an existing client user. + * Only the user status can be changed on update. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer that the user to be retrieved + * is associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Numerical identifier of the user to retrieve. (required) */ + userId: string; + }): Request; + } + interface ClientsResource { + /** Creates a new client buyer. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Unique numerical account ID for the buyer of which the client buyer + * is a customer; the sponsor buyer to create a client for. (required) + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets a client buyer with a given client account ID. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Numerical account ID of the client buyer to retrieve. (required) */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the clients for the current sponsor buyer. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Unique numerical account ID of the sponsor buyer to list the clients for. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer clients than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListClientsResponse.nextPageToken + * returned from the previous call to the + * accounts.clients.list method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates an existing client buyer. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Unique numerical account ID for the buyer of which the client buyer + * is a customer; the sponsor buyer to update a client for. (required) + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Unique numerical account ID of the client to update. (required) */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + invitations: InvitationsResource; + users: UsersResource; + } + interface DealAssociationsResource { + /** Associate an existing deal with a creative. */ + add(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account the creative belongs to. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The ID of the creative associated with the deal. */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** List all creative-deal associations. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account to list the associations from. + * Specify "-" to list all creatives the current user has access to. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The creative ID to list the associations from. + * Specify "-" to list all creatives under the above account. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. Server may return fewer associations than requested. + * If unspecified, server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListDealAssociationsResponse.next_page_token + * returned from the previous call to 'ListDealAssociations' method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * An optional query string to filter deal associations. If no filter is + * specified, all associations will be returned. + * Supported queries are: + *
    + *
  • accountId=account_id_string + *
  • creativeId=creative_id_string + *
  • dealsId=deals_id_string + *
  • dealsStatus:{approved, conditionally_approved, disapproved, + * not_checked} + *
  • openAuctionStatus:{approved, conditionally_approved, disapproved, + * not_checked} + *
+ * Example: 'dealsId=12345 AND dealsStatus:disapproved' + */ + query?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Remove the association between a deal and a creative. */ + remove(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account the creative belongs to. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The ID of the creative associated with the deal. */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface CreativesResource { + /** Creates a creative. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account that this creative belongs to. + * Can be used to filter the response of the + * creatives.list + * method. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Indicates if multiple creatives can share an ID or not. Default is + * NO_DUPLICATES (one ID per creative). + */ + duplicateIdMode?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets a creative. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account the creative belongs to. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The ID of the creative to retrieve. */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists creatives. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account to list the creatives from. + * Specify "-" to list all creatives the current user has access to. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer creatives than requested + * (due to timeout constraint) even if more are available via another call. + * If unspecified, server will pick an appropriate default. + * Acceptable values are 1 to 1000, inclusive. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListCreativesResponse.next_page_token + * returned from the previous call to 'ListCreatives' method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * An optional query string to filter creatives. If no filter is specified, + * all active creatives will be returned. + * Supported queries are: + *
    + *
  • accountId=account_id_string + *
  • creativeId=creative_id_string + *
  • dealsStatus: {approved, conditionally_approved, disapproved, + * not_checked} + *
  • openAuctionStatus: {approved, conditionally_approved, disapproved, + * not_checked} + *
  • attribute: {a numeric attribute from the list of attributes} + *
  • disapprovalReason: {a reason from + * DisapprovalReason + *
+ * Example: 'accountId=12345 AND (dealsStatus:disapproved AND + * disapprovalReason:unacceptable_content) OR attribute:47' + */ + query?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Stops watching a creative. Will stop push notifications being sent to the + * topics when the creative changes status. + */ + stopWatching(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account of the creative to stop notifications for. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The creative ID of the creative to stop notifications for. + * Specify "-" to specify stopping account level notifications. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Updates a creative. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account that this creative belongs to. + * Can be used to filter the response of the + * creatives.list + * method. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The buyer-defined creative ID of this creative. + * Can be used to filter the response of the + * creatives.list + * method. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Watches a creative. Will result in push notifications being sent to the + * topic when the creative changes status. + */ + watch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account of the creative to watch. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The creative ID to watch for status changes. + * Specify "-" to watch all creatives under the above account. + * If both creative-level and account-level notifications are + * sent, only a single notification will be sent to the + * creative-level notification topic. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + dealAssociations: DealAssociationsResource; + } + interface BidMetricsResource { + /** Lists all metrics that are measured in terms of number of bids. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListBidMetricsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.bidMetrics.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BidResponseErrorsResource { + /** + * List all errors that occurred in bid responses, with the number of bid + * responses affected for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListBidResponseErrorsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.bidResponseErrors.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BidResponsesWithoutBidsResource { + /** + * List all reasons for which bid responses were considered to have no + * applicable bids, with the number of bid responses affected for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListBidResponsesWithoutBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.bidResponsesWithoutBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FilteredBidRequestsResource { + /** + * List all reasons that caused a bid request not to be sent for an + * impression, with the number of bid requests not sent for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListFilteredBidRequestsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBidRequests.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CreativesResource { + /** + * List all creatives associated with a specific reason for which bids were + * filtered, with the number of bids filtered for each creative. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The ID of the creative status for which to retrieve a breakdown by + * creative. + * See + * [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + */ + creativeStatusId: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListCreativeStatusBreakdownByCreativeResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBids.creatives.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DetailsResource { + /** + * List all details associated with a specific reason for which bids were + * filtered, with the number of bids filtered for each detail. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The ID of the creative status for which to retrieve a breakdown by detail. + * See + * [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + * Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. + */ + creativeStatusId: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListCreativeStatusBreakdownByDetailResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBids.details.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FilteredBidsResource { + /** + * List all reasons for which bids were filtered, with the number of bids + * filtered for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListFilteredBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + creatives: CreativesResource; + details: DetailsResource; + } + interface ImpressionMetricsResource { + /** Lists all metrics that are measured in terms of number of impressions. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListImpressionMetricsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.impressionMetrics.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface LosingBidsResource { + /** + * List all reasons for which bids lost in the auction, with the number of + * bids that lost for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListLosingBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.losingBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface NonBillableWinningBidsResource { + /** + * List all reasons for which winning bids were not billable, with the number + * of bids not billed for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListNonBillableWinningBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.nonBillableWinningBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FilterSetsResource { + /** Creates the specified filter set for the account with the given account ID. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether the filter set is transient, or should be persisted indefinitely. + * By default, filter sets are not transient. + * If transient, it will be available for at least 1 hour after creation. + */ + isTransient?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes the requested filter set from the account with the given account + * ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to delete. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Retrieves the requested filter set for the account with the given account + * ID. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to get. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all filter sets for the account with the given account ID. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListFilterSetsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + bidMetrics: BidMetricsResource; + bidResponseErrors: BidResponseErrorsResource; + bidResponsesWithoutBids: BidResponsesWithoutBidsResource; + filteredBidRequests: FilteredBidRequestsResource; + filteredBids: FilteredBidsResource; + impressionMetrics: ImpressionMetricsResource; + losingBids: LosingBidsResource; + nonBillableWinningBids: NonBillableWinningBidsResource; + } + interface AccountsResource { + clients: ClientsResource; + creatives: CreativesResource; + filterSets: FilterSetsResource; + } + } +} diff --git a/types/gapi.client.adexchangebuyer2/readme.md b/types/gapi.client.adexchangebuyer2/readme.md new file mode 100644 index 0000000000..92b3f3fb30 --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Ad Exchange Buyer API II v2beta1 +Accesses the latest features for managing Ad Exchange accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals. +For detailed description please check [documentation](https://developers.google.com/ad-exchange/buyer-rest/reference/rest/). + +## Installing + +Install typings for Ad Exchange Buyer API II: +``` +npm install @types/gapi.client.adexchangebuyer2@v2beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexchangebuyer2', 'v2beta1', () => { + // now we can use gapi.client.adexchangebuyer2 + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your Ad Exchange buyer account configuration + 'https://www.googleapis.com/auth/adexchange.buyer', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Ad Exchange Buyer API II resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer2/tsconfig.json b/types/gapi.client.adexchangebuyer2/tsconfig.json new file mode 100644 index 0000000000..453ca167ee --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexchangebuyer2-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer2/tslint.json b/types/gapi.client.adexchangebuyer2/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexchangeseller/gapi.client.adexchangeseller-tests.ts b/types/gapi.client.adexchangeseller/gapi.client.adexchangeseller-tests.ts new file mode 100644 index 0000000000..69d7e2feec --- /dev/null +++ b/types/gapi.client.adexchangeseller/gapi.client.adexchangeseller-tests.ts @@ -0,0 +1,43 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexchangeseller', 'v2.0', () => { + /** now we can use gapi.client.adexchangeseller */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Ad Exchange data */ + 'https://www.googleapis.com/auth/adexchange.seller', + /** View your Ad Exchange data */ + 'https://www.googleapis.com/auth/adexchange.seller.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Get information about the selected Ad Exchange account. */ + await gapi.client.accounts.get({ + accountId: "accountId", + }); + /** List all accounts available to this Ad Exchange account. */ + await gapi.client.accounts.list({ + maxResults: 1, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.adexchangeseller/index.d.ts b/types/gapi.client.adexchangeseller/index.d.ts new file mode 100644 index 0000000000..dd327ed5ae --- /dev/null +++ b/types/gapi.client.adexchangeseller/index.d.ts @@ -0,0 +1,664 @@ +// Type definitions for Google Ad Exchange Seller API v2.0 2.0 +// Project: https://developers.google.com/ad-exchange/seller-rest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v2.0/rest + +/// + +declare namespace gapi.client { + /** Load Ad Exchange Seller API v2.0 */ + function load(name: "adexchangeseller", version: "v2.0"): PromiseLike; + function load(name: "adexchangeseller", version: "v2.0", callback: () => any): void; + + const accounts: adexchangeseller.AccountsResource; + + namespace adexchangeseller { + interface Account { + /** Unique identifier of this account. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#account. */ + kind?: string; + /** Name of this account. */ + name?: string; + } + interface Accounts { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The accounts returned in this list response. */ + items?: Account[]; + /** Kind of list this is, in this case adexchangeseller#accounts. */ + kind?: string; + /** Continuation token used to page through accounts. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdClient { + /** Whether this ad client is opted in to ARC. */ + arcOptIn?: boolean; + /** Unique identifier of this ad client. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#adClient. */ + kind?: string; + /** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */ + productCode?: string; + /** Whether this ad client supports being reported on. */ + supportsReporting?: boolean; + } + interface AdClients { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad clients returned in this list response. */ + items?: AdClient[]; + /** Kind of list this is, in this case adexchangeseller#adClients. */ + kind?: string; + /** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Alert { + /** Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#alert. */ + kind?: string; + /** The localized alert message. */ + message?: string; + /** Severity of this alert. Possible values: INFO, WARNING, SEVERE. */ + severity?: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type?: string; + } + interface Alerts { + /** The alerts returned in this list response. */ + items?: Alert[]; + /** Kind of list this is, in this case adexchangeseller#alerts. */ + kind?: string; + } + interface CustomChannel { + /** Code of this custom channel, not necessarily unique across ad clients. */ + code?: string; + /** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#customChannel. */ + kind?: string; + /** Name of this custom channel. */ + name?: string; + /** The targeting information of this custom channel, if activated. */ + targetingInfo?: { + /** The name used to describe this channel externally. */ + adsAppearOn?: string; + /** The external description of the channel. */ + description?: string; + /** + * The locations in which ads appear. (Only valid for content and mobile content ads). Acceptable values for content ads are: TOP_LEFT, TOP_CENTER, + * TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for mobile content + * ads are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS. + */ + location?: string; + /** The language of the sites ads will be displayed on. */ + siteLanguage?: string; + }; + } + interface CustomChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The custom channels returned in this list response. */ + items?: CustomChannel[]; + /** Kind of list this is, in this case adexchangeseller#customChannels. */ + kind?: string; + /** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Metadata { + items?: ReportingMetadataEntry[]; + /** Kind of list this is, in this case adexchangeseller#metadata. */ + kind?: string; + } + interface PreferredDeal { + /** The name of the advertiser this deal is for. */ + advertiserName?: string; + /** The name of the buyer network this deal is for. */ + buyerNetworkName?: string; + /** The currency code that applies to the fixed_cpm value. If not set then assumed to be USD. */ + currencyCode?: string; + /** Time when this deal stops being active in seconds since the epoch (GMT). If not set then this deal is valid until manually disabled by the publisher. */ + endTime?: string; + /** + * The fixed price for this preferred deal. In cpm micros of currency according to currencyCode. If set, then this preferred deal is eligible for the + * fixed price tier of buying (highest priority, pay exactly the configured fixed price). + */ + fixedCpm?: string; + /** Unique identifier of this preferred deal. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#preferredDeal. */ + kind?: string; + /** Time when this deal becomes active in seconds since the epoch (GMT). If not set then this deal is active immediately upon creation. */ + startTime?: string; + } + interface PreferredDeals { + /** The preferred deals returned in this list response. */ + items?: PreferredDeal[]; + /** Kind of list this is, in this case adexchangeseller#preferredDeals. */ + kind?: string; + } + interface Report { + /** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + averages?: string[]; + /** + * The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for + * each metric in the request. + */ + headers?: Array<{ + /** The currency of this column. Only present if the header type is METRIC_CURRENCY. */ + currency?: string; + /** The name of the header. */ + name?: string; + /** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */ + type?: string; + }>; + /** Kind this is, in this case adexchangeseller#report. */ + kind?: string; + /** + * The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The + * dimension cells contain strings, and the metric cells contain numbers. + */ + rows?: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or + * the report row limit. + */ + totalMatchedRows?: string; + /** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + totals?: string[]; + /** Any warnings associated with generation of the report. */ + warnings?: string[]; + } + interface ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension + * belongs to. + */ + compatibleDimensions?: string[]; + /** The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with. */ + compatibleMetrics?: string[]; + /** Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#reportingMetadataEntry. */ + kind?: string; + /** + * The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report + * to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredDimensions?: string[]; + /** + * The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to + * be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredMetrics?: string[]; + /** The codes of the projects supported by the dimension or metric this reporting metadata entry describes. */ + supportedProducts?: string[]; + } + interface SavedReport { + /** Unique identifier of this saved report. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#savedReport. */ + kind?: string; + /** This saved report's name. */ + name?: string; + } + interface SavedReports { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The saved reports returned in this list response. */ + items?: SavedReport[]; + /** Kind of list this is, in this case adexchangeseller#savedReports. */ + kind?: string; + /** Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface UrlChannel { + /** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#urlChannel. */ + kind?: string; + /** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */ + urlPattern?: string; + } + interface UrlChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The URL channels returned in this list response. */ + items?: UrlChannel[]; + /** Kind of list this is, in this case adexchangeseller#urlChannels. */ + kind?: string; + /** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdclientsResource { + /** List all ad clients in this Ad Exchange account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AlertsResource { + /** List the alerts for this Ad Exchange account. */ + list(request: { + /** Account owning the alerts. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used + * if the supplied locale is invalid or unsupported. + */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Get the specified custom channel from the specified ad client. */ + get(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to retrieve. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all custom channels in the specified ad client for this Ad Exchange account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DimensionsResource { + /** List the metadata for the dimensions available to this AdExchange account. */ + list(request: { + /** Account with visibility to the dimensions. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetricsResource { + /** List the metadata for the metrics available to this AdExchange account. */ + list(request: { + /** Account with visibility to the metrics. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetadataResource { + dimensions: DimensionsResource; + metrics: MetricsResource; + } + interface PreferreddealsResource { + /** Get information about the selected Ad Exchange Preferred Deal. */ + get(request: { + /** Account owning the deal. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Preferred deal to get information about. */ + dealId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List the preferred deals for this Ad Exchange account. */ + list(request: { + /** Account owning the deals. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedResource { + /** Generate an Ad Exchange report based on the saved report ID sent in the query parameters. */ + generate(request: { + /** Account owning the saved report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The saved report to retrieve. */ + savedReportId: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved reports in this Ad Exchange account. */ + list(request: { + /** Account owning the saved reports. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved reports to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Account which owns the generated report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + saved: SavedResource; + } + interface UrlchannelsResource { + /** List all URL channels in the specified ad client for this Ad Exchange account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Get information about the selected Ad Exchange account. */ + get(request: { + /** Account to get information about. Tip: 'myaccount' is a valid ID. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all accounts available to this Ad Exchange account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adclients: AdclientsResource; + alerts: AlertsResource; + customchannels: CustomchannelsResource; + metadata: MetadataResource; + preferreddeals: PreferreddealsResource; + reports: ReportsResource; + urlchannels: UrlchannelsResource; + } + } +} diff --git a/types/gapi.client.adexchangeseller/readme.md b/types/gapi.client.adexchangeseller/readme.md new file mode 100644 index 0000000000..5519aa798f --- /dev/null +++ b/types/gapi.client.adexchangeseller/readme.md @@ -0,0 +1,67 @@ +# TypeScript typings for Ad Exchange Seller API v2.0 +Accesses the inventory of Ad Exchange seller users and generates reports. +For detailed description please check [documentation](https://developers.google.com/ad-exchange/seller-rest/). + +## Installing + +Install typings for Ad Exchange Seller API: +``` +npm install @types/gapi.client.adexchangeseller@v2.0 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexchangeseller', 'v2.0', () => { + // now we can use gapi.client.adexchangeseller + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Ad Exchange data + 'https://www.googleapis.com/auth/adexchange.seller', + + // View your Ad Exchange data + 'https://www.googleapis.com/auth/adexchange.seller.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Ad Exchange Seller API resources: + +```typescript + +/* +Get information about the selected Ad Exchange account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", }); + +/* +List all accounts available to this Ad Exchange account. +*/ +await gapi.client.accounts.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.adexchangeseller/tsconfig.json b/types/gapi.client.adexchangeseller/tsconfig.json new file mode 100644 index 0000000000..a38d57f5b8 --- /dev/null +++ b/types/gapi.client.adexchangeseller/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexchangeseller-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexchangeseller/tslint.json b/types/gapi.client.adexchangeseller/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexchangeseller/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexperiencereport/gapi.client.adexperiencereport-tests.ts b/types/gapi.client.adexperiencereport/gapi.client.adexperiencereport-tests.ts new file mode 100644 index 0000000000..f621a79da0 --- /dev/null +++ b/types/gapi.client.adexperiencereport/gapi.client.adexperiencereport-tests.ts @@ -0,0 +1,39 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexperiencereport', 'v1', () => { + /** now we can use gapi.client.adexperiencereport */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Test scope for access to the Zoo service */ + 'https://www.googleapis.com/auth/xapi.zoo', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets a summary of the ad experience rating of a site. */ + await gapi.client.sites.get({ + name: "name", + }); + /** Lists sites with Ad Experience Report statuses of "Failing" or "Warning". */ + await gapi.client.violatingSites.list({ + }); + } +}); diff --git a/types/gapi.client.adexperiencereport/index.d.ts b/types/gapi.client.adexperiencereport/index.d.ts new file mode 100644 index 0000000000..8258568b1d --- /dev/null +++ b/types/gapi.client.adexperiencereport/index.d.ts @@ -0,0 +1,125 @@ +// Type definitions for Google Google Ad Experience Report API v1 1.0 +// Project: https://developers.google.com/ad-experience-report/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://adexperiencereport.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Ad Experience Report API v1 */ + function load(name: "adexperiencereport", version: "v1"): PromiseLike; + function load(name: "adexperiencereport", version: "v1", callback: () => any): void; + + const sites: adexperiencereport.SitesResource; + + const violatingSites: adexperiencereport.ViolatingSitesResource; + + namespace adexperiencereport { + interface PlatformSummary { + /** The status of the site reviewed for the Better Ads Standards. */ + betterAdsStatus?: string; + /** The date on which ad filtering begins. */ + enforcementTime?: string; + /** The ad filtering status of the site. */ + filterStatus?: string; + /** The last time that the site changed status. */ + lastChangeTime?: string; + /** The assigned regions for the site and platform. */ + region?: string[]; + /** A link that leads to a full ad experience report. */ + reportUrl?: string; + /** Whether the site is currently under review. */ + underReview?: boolean; + } + interface SiteSummaryResponse { + /** Summary for the desktop review of the site. */ + desktopSummary?: PlatformSummary; + /** Summary for the mobile review of the site. */ + mobileSummary?: PlatformSummary; + /** The name of the site reviewed. */ + reviewedSite?: string; + } + interface ViolatingSitesResponse { + /** A list of summaries of violating sites. */ + violatingSites?: SiteSummaryResponse[]; + } + interface SitesResource { + /** Gets a summary of the ad experience rating of a site. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The required site name. It should be the site property whose ad experiences + * may have been reviewed, and it should be URL-encoded. For example, + * sites/https%3A%2F%2Fwww.google.com. The server will return an error of + * BAD_REQUEST if this field is not filled in. Note that if the site property + * is not yet verified in Search Console, the reportUrl field returned by the + * API will lead to the verification page, prompting the user to go through + * that process before they can gain access to the Ad Experience Report. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ViolatingSitesResource { + /** Lists sites with Ad Experience Report statuses of "Failing" or "Warning". */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adexperiencereport/readme.md b/types/gapi.client.adexperiencereport/readme.md new file mode 100644 index 0000000000..fff8e09ccf --- /dev/null +++ b/types/gapi.client.adexperiencereport/readme.md @@ -0,0 +1,64 @@ +# TypeScript typings for Google Ad Experience Report API v1 +View Ad Experience Report data, and get a list of sites that have a significant number of annoying ads. +For detailed description please check [documentation](https://developers.google.com/ad-experience-report/). + +## Installing + +Install typings for Google Ad Experience Report API: +``` +npm install @types/gapi.client.adexperiencereport@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexperiencereport', 'v1', () => { + // now we can use gapi.client.adexperiencereport + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Test scope for access to the Zoo service + 'https://www.googleapis.com/auth/xapi.zoo', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Ad Experience Report API resources: + +```typescript + +/* +Gets a summary of the ad experience rating of a site. +*/ +await gapi.client.sites.get({ name: "name", }); + +/* +Lists sites with Ad Experience Report statuses of "Failing" or "Warning". +*/ +await gapi.client.violatingSites.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.adexperiencereport/tsconfig.json b/types/gapi.client.adexperiencereport/tsconfig.json new file mode 100644 index 0000000000..968c080cf9 --- /dev/null +++ b/types/gapi.client.adexperiencereport/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexperiencereport-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexperiencereport/tslint.json b/types/gapi.client.adexperiencereport/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexperiencereport/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.admin/gapi.client.admin-tests.ts b/types/gapi.client.admin/gapi.client.admin-tests.ts new file mode 100644 index 0000000000..698cf0d218 --- /dev/null +++ b/types/gapi.client.admin/gapi.client.admin-tests.ts @@ -0,0 +1,80 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('admin', 'reports_v1', () => { + /** now we can use gapi.client.admin */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View audit reports for your G Suite domain */ + 'https://www.googleapis.com/auth/admin.reports.audit.readonly', + /** View usage reports for your G Suite domain */ + 'https://www.googleapis.com/auth/admin.reports.usage.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves a list of activities for a specific customer and application. */ + await gapi.client.activities.list({ + actorIpAddress: "actorIpAddress", + applicationName: "applicationName", + customerId: "customerId", + endTime: "endTime", + eventName: "eventName", + filters: "filters", + maxResults: 7, + pageToken: "pageToken", + startTime: "startTime", + userKey: "userKey", + }); + /** Push changes to activities */ + await gapi.client.activities.watch({ + actorIpAddress: "actorIpAddress", + applicationName: "applicationName", + customerId: "customerId", + endTime: "endTime", + eventName: "eventName", + filters: "filters", + maxResults: 7, + pageToken: "pageToken", + startTime: "startTime", + userKey: "userKey", + }); + /** Stop watching resources through this channel */ + await gapi.client.channels.stop({ + }); + /** Retrieves a report which is a collection of properties / statistics for a specific customer. */ + await gapi.client.customerUsageReports.get({ + customerId: "customerId", + date: "date", + pageToken: "pageToken", + parameters: "parameters", + }); + /** Retrieves a report which is a collection of properties / statistics for a set of users. */ + await gapi.client.userUsageReport.get({ + customerId: "customerId", + date: "date", + filters: "filters", + maxResults: 4, + pageToken: "pageToken", + parameters: "parameters", + userKey: "userKey", + }); + } +}); diff --git a/types/gapi.client.admin/index.d.ts b/types/gapi.client.admin/index.d.ts new file mode 100644 index 0000000000..9e82b6a06c --- /dev/null +++ b/types/gapi.client.admin/index.d.ts @@ -0,0 +1,349 @@ +// Type definitions for Google Admin Reports API reports_v1 1.0 +// Project: https://developers.google.com/admin-sdk/reports/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/admin/reports_v1/rest + +/// + +declare namespace gapi.client { + /** Load Admin Reports API reports_v1 */ + function load(name: "admin", version: "reports_v1"): PromiseLike; + function load(name: "admin", version: "reports_v1", callback: () => any): void; + + const activities: admin.ActivitiesResource; + + const channels: admin.ChannelsResource; + + const customerUsageReports: admin.CustomerUsageReportsResource; + + const userUsageReport: admin.UserUsageReportResource; + + namespace admin { + interface Activities { + /** ETag of the resource. */ + etag?: string; + /** Each record in read response. */ + items?: Activity[]; + /** Kind of list response this is. */ + kind?: string; + /** Token for retrieving the next page */ + nextPageToken?: string; + } + interface Activity { + /** User doing the action. */ + actor?: { + /** User or OAuth 2LO request. */ + callerType?: string; + /** Email address of the user. */ + email?: string; + /** For OAuth 2LO API requests, consumer_key of the requestor. */ + key?: string; + /** Obfuscated user id of the user. */ + profileId?: string; + }; + /** ETag of the entry. */ + etag?: string; + /** Activity events. */ + events?: Array<{ + /** Name of event. */ + name?: string; + /** Parameter value pairs for various applications. */ + parameters?: Array<{ + /** Boolean value of the parameter. */ + boolValue?: boolean; + /** Integral value of the parameter. */ + intValue?: string; + /** Multi-int value of the parameter. */ + multiIntValue?: string[]; + /** Multi-string value of the parameter. */ + multiValue?: string[]; + /** The name of the parameter. */ + name?: string; + /** String value of the parameter. */ + value?: string; + }>; + /** Type of event. */ + type?: string; + }>; + /** Unique identifier for each activity record. */ + id?: { + /** Application name to which the event belongs. */ + applicationName?: string; + /** Obfuscated customer ID of the source customer. */ + customerId?: string; + /** Time of occurrence of the activity. */ + time?: string; + /** Unique qualifier if multiple events have the same time. */ + uniqueQualifier?: string; + }; + /** IP Address of the user doing the action. */ + ipAddress?: string; + /** Kind of resource this is. */ + kind?: string; + /** Domain of source customer. */ + ownerDomain?: string; + } + interface Channel { + /** The address where notifications are delivered for this channel. */ + address?: string; + /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ + expiration?: string; + /** A UUID or similar unique string that identifies this channel. */ + id?: string; + /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */ + kind?: string; + /** Additional parameters controlling delivery channel behavior. Optional. */ + params?: Record; + /** A Boolean value to indicate whether payload is wanted. Optional. */ + payload?: boolean; + /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ + resourceId?: string; + /** A version-specific identifier for the watched resource. */ + resourceUri?: string; + /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ + token?: string; + /** The type of delivery mechanism used for this channel. */ + type?: string; + } + interface UsageReport { + /** The date to which the record belongs. */ + date?: string; + /** Information about the type of the item. */ + entity?: { + /** Obfuscated customer id for the record. */ + customerId?: string; + /** Obfuscated user id for the record. */ + profileId?: string; + /** The type of item, can be a customer or user. */ + type?: string; + /** user's email. */ + userEmail?: string; + }; + /** ETag of the resource. */ + etag?: string; + /** The kind of object. */ + kind?: string; + /** Parameter value pairs for various applications. */ + parameters?: Array<{ + /** Boolean value of the parameter. */ + boolValue?: boolean; + /** RFC 3339 formatted value of the parameter. */ + datetimeValue?: string; + /** Integral value of the parameter. */ + intValue?: string; + /** Nested message value of the parameter. */ + msgValue?: Array>; + /** The name of the parameter. */ + name?: string; + /** String value of the parameter. */ + stringValue?: string; + }>; + } + interface UsageReports { + /** ETag of the resource. */ + etag?: string; + /** The kind of object. */ + kind?: string; + /** Token for retrieving the next page */ + nextPageToken?: string; + /** Various application parameter records. */ + usageReports?: UsageReport[]; + /** Warnings if any. */ + warnings?: Array<{ + /** Machine readable code / warning type. */ + code?: string; + /** Key-Value pairs to give detailed information on the warning. */ + data?: Array<{ + /** Key associated with a key-value pair to give detailed information on the warning. */ + key?: string; + /** Value associated with a key-value pair to give detailed information on the warning. */ + value?: string; + }>; + /** Human readable message for the warning. */ + message?: string; + }>; + } + interface ActivitiesResource { + /** Retrieves a list of activities for a specific customer and application. */ + list(request: { + /** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */ + actorIpAddress?: string; + /** Data format for the response. */ + alt?: string; + /** Application name for which the events are to be retrieved. */ + applicationName: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Return events which occurred at or before this time. */ + endTime?: string; + /** Name of the event being queried. */ + eventName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */ + filters?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Number of activity records to be shown in each page. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Return events which occurred at or after this time. */ + startTime?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for + * all users. + */ + userKey: string; + }): Request; + /** Push changes to activities */ + watch(request: { + /** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */ + actorIpAddress?: string; + /** Data format for the response. */ + alt?: string; + /** Application name for which the events are to be retrieved. */ + applicationName: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Return events which occurred at or before this time. */ + endTime?: string; + /** Name of the event being queried. */ + eventName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */ + filters?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Number of activity records to be shown in each page. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Return events which occurred at or after this time. */ + startTime?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for + * all users. + */ + userKey: string; + }): Request; + } + interface ChannelsResource { + /** Stop watching resources through this channel */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomerUsageReportsResource { + /** Retrieves a report which is a collection of properties / statistics for a specific customer. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ + date: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ + parameters?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserUsageReportResource { + /** Retrieves a report which is a collection of properties / statistics for a set of users. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ + date: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Represents the set of filters including parameter operator value. */ + filters?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. Maximum allowed is 1000 */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ + parameters?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Represents the profile id or the user email for which the data should be filtered. */ + userKey: string; + }): Request; + } + } +} diff --git a/types/gapi.client.admin/readme.md b/types/gapi.client.admin/readme.md new file mode 100644 index 0000000000..680dfa99f9 --- /dev/null +++ b/types/gapi.client.admin/readme.md @@ -0,0 +1,82 @@ +# TypeScript typings for Admin Reports API reports_v1 +Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users. +For detailed description please check [documentation](https://developers.google.com/admin-sdk/reports/). + +## Installing + +Install typings for Admin Reports API: +``` +npm install @types/gapi.client.admin@reports_v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('admin', 'reports_v1', () => { + // now we can use gapi.client.admin + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View audit reports for your G Suite domain + 'https://www.googleapis.com/auth/admin.reports.audit.readonly', + + // View usage reports for your G Suite domain + 'https://www.googleapis.com/auth/admin.reports.usage.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Admin Reports API resources: + +```typescript + +/* +Retrieves a list of activities for a specific customer and application. +*/ +await gapi.client.activities.list({ applicationName: "applicationName", userKey: "userKey", }); + +/* +Push changes to activities +*/ +await gapi.client.activities.watch({ applicationName: "applicationName", userKey: "userKey", }); + +/* +Stop watching resources through this channel +*/ +await gapi.client.channels.stop({ }); + +/* +Retrieves a report which is a collection of properties / statistics for a specific customer. +*/ +await gapi.client.customerUsageReports.get({ date: "date", }); + +/* +Retrieves a report which is a collection of properties / statistics for a set of users. +*/ +await gapi.client.userUsageReport.get({ date: "date", userKey: "userKey", }); +``` \ No newline at end of file diff --git a/types/gapi.client.admin/tsconfig.json b/types/gapi.client.admin/tsconfig.json new file mode 100644 index 0000000000..840f1feb2d --- /dev/null +++ b/types/gapi.client.admin/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.admin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.admin/tslint.json b/types/gapi.client.admin/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.admin/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adsense/gapi.client.adsense-tests.ts b/types/gapi.client.adsense/gapi.client.adsense-tests.ts new file mode 100644 index 0000000000..92e9643ad3 --- /dev/null +++ b/types/gapi.client.adsense/gapi.client.adsense-tests.ts @@ -0,0 +1,121 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adsense', 'v1.4', () => { + /** now we can use gapi.client.adsense */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your AdSense data */ + 'https://www.googleapis.com/auth/adsense', + /** View your AdSense data */ + 'https://www.googleapis.com/auth/adsense.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Get information about the selected AdSense account. */ + await gapi.client.accounts.get({ + accountId: "accountId", + tree: true, + }); + /** List all accounts available to this AdSense account. */ + await gapi.client.accounts.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** List all ad clients in this AdSense account. */ + await gapi.client.adclients.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** Gets the specified ad unit in the specified ad client. */ + await gapi.client.adunits.get({ + adClientId: "adClientId", + adUnitId: "adUnitId", + }); + /** Get ad code for the specified ad unit. */ + await gapi.client.adunits.getAdCode({ + adClientId: "adClientId", + adUnitId: "adUnitId", + }); + /** List all ad units in the specified ad client for this AdSense account. */ + await gapi.client.adunits.list({ + adClientId: "adClientId", + includeInactive: true, + maxResults: 3, + pageToken: "pageToken", + }); + /** Dismiss (delete) the specified alert from the publisher's AdSense account. */ + await gapi.client.alerts.delete({ + alertId: "alertId", + }); + /** List the alerts for this AdSense account. */ + await gapi.client.alerts.list({ + locale: "locale", + }); + /** Get the specified custom channel from the specified ad client. */ + await gapi.client.customchannels.get({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** List all custom channels in the specified ad client for this AdSense account. */ + await gapi.client.customchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + /** List the payments for this AdSense account. */ + await gapi.client.payments.list({ + }); + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + await gapi.client.reports.generate({ + accountId: "accountId", + currency: "currency", + dimension: "dimension", + endDate: "endDate", + filter: "filter", + locale: "locale", + maxResults: 7, + metric: "metric", + sort: "sort", + startDate: "startDate", + startIndex: 11, + useTimezoneReporting: true, + }); + /** Get a specific saved ad style from the user's account. */ + await gapi.client.savedadstyles.get({ + savedAdStyleId: "savedAdStyleId", + }); + /** List all saved ad styles in the user's account. */ + await gapi.client.savedadstyles.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** List all URL channels in the specified ad client for this AdSense account. */ + await gapi.client.urlchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.adsense/index.d.ts b/types/gapi.client.adsense/index.d.ts new file mode 100644 index 0000000000..ea9e5fa057 --- /dev/null +++ b/types/gapi.client.adsense/index.d.ts @@ -0,0 +1,1529 @@ +// Type definitions for Google AdSense Management API v1.4 1.4 +// Project: https://developers.google.com/adsense/management/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adsense/v1.4/rest + +/// + +declare namespace gapi.client { + /** Load AdSense Management API v1.4 */ + function load(name: "adsense", version: "v1.4"): PromiseLike; + function load(name: "adsense", version: "v1.4", callback: () => any): void; + + const accounts: adsense.AccountsResource; + + const adclients: adsense.AdclientsResource; + + const adunits: adsense.AdunitsResource; + + const alerts: adsense.AlertsResource; + + const customchannels: adsense.CustomchannelsResource; + + const metadata: adsense.MetadataResource; + + const payments: adsense.PaymentsResource; + + const reports: adsense.ReportsResource; + + const savedadstyles: adsense.SavedadstylesResource; + + const urlchannels: adsense.UrlchannelsResource; + + namespace adsense { + interface Account { + creation_time?: string; + /** Unique identifier of this account. */ + id?: string; + /** Kind of resource this is, in this case adsense#account. */ + kind?: string; + /** Name of this account. */ + name?: string; + /** Whether this account is premium. */ + premium?: boolean; + /** Sub accounts of the this account. */ + subAccounts?: Account[]; + /** AdSense timezone of this account. */ + timezone?: string; + } + interface Accounts { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The accounts returned in this list response. */ + items?: Account[]; + /** Kind of list this is, in this case adsense#accounts. */ + kind?: string; + /** Continuation token used to page through accounts. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdClient { + /** Whether this ad client is opted in to ARC. */ + arcOptIn?: boolean; + /** Unique identifier of this ad client. */ + id?: string; + /** Kind of resource this is, in this case adsense#adClient. */ + kind?: string; + /** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */ + productCode?: string; + /** Whether this ad client supports being reported on. */ + supportsReporting?: boolean; + } + interface AdClients { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad clients returned in this list response. */ + items?: AdClient[]; + /** Kind of list this is, in this case adsense#adClients. */ + kind?: string; + /** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdCode { + /** The ad code snippet. */ + adCode?: string; + /** Kind this is, in this case adsense#adCode. */ + kind?: string; + } + interface AdStyle { + /** + * The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading + * hash. + */ + colors?: { + /** The color of the ad background. */ + background?: string; + /** The color of the ad border. */ + border?: string; + /** The color of the ad text. */ + text?: string; + /** The color of the ad title. */ + title?: string; + /** The color of the ad url. */ + url?: string; + }; + /** The style of the corners in the ad (deprecated: never populated, ignored). */ + corners?: string; + /** The font which is included in the style. */ + font?: { + /** The family of the font. */ + family?: string; + /** The size of the font. */ + size?: string; + }; + /** Kind this is, in this case adsense#adStyle. */ + kind?: string; + } + interface AdUnit { + /** Identity code of this ad unit, not necessarily unique across ad clients. */ + code?: string; + /** Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated). */ + contentAdsSettings?: { + /** The backup option to be used in instances where no ad is available. */ + backupOption?: { + /** Color to use when type is set to COLOR. */ + color?: string; + /** Type of the backup option. Possible values are BLANK, COLOR and URL. */ + type?: string; + /** URL to use when type is set to URL. */ + url?: string; + }; + /** Size of this ad unit. */ + size?: string; + /** Type of this ad unit. */ + type?: string; + }; + /** Custom style information specific to this ad unit. */ + customStyle?: AdStyle; + /** Settings specific to feed ads (AFF) - deprecated. */ + feedAdsSettings?: { + /** The position of the ads relative to the feed entries. */ + adPosition?: string; + /** The frequency at which ads should appear in the feed (i.e. every N entries). */ + frequency?: number; + /** The minimum length an entry should be in order to have attached ads. */ + minimumWordCount?: number; + /** The type of ads which should appear. */ + type?: string; + }; + /** Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#adUnit. */ + kind?: string; + /** Settings specific to WAP mobile content ads (AFMC) - deprecated. */ + mobileContentAdsSettings?: { + /** The markup language to use for this ad unit. */ + markupLanguage?: string; + /** The scripting language to use for this ad unit. */ + scriptingLanguage?: string; + /** Size of this ad unit. */ + size?: string; + /** Type of this ad unit. */ + type?: string; + }; + /** Name of this ad unit. */ + name?: string; + /** ID of the saved ad style which holds this ad unit's style information. */ + savedStyleId?: string; + /** + * Status of this ad unit. Possible values are: + * NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it. + * + * ACTIVE: Indicates that there has been activity on this ad unit in the last seven days. + * + * INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days. + */ + status?: string; + } + interface AdUnits { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad units returned in this list response. */ + items?: AdUnit[]; + /** Kind of list this is, in this case adsense#adUnits. */ + kind?: string; + /** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdsenseReportsGenerateResponse { + /** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + averages?: string[]; + /** The requested end date in yyyy-mm-dd format. */ + endDate?: string; + /** + * The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for + * each metric in the request. + */ + headers?: Array<{ + /** The currency of this column. Only present if the header type is METRIC_CURRENCY. */ + currency?: string; + /** The name of the header. */ + name?: string; + /** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */ + type?: string; + }>; + /** Kind this is, in this case adsense#report. */ + kind?: string; + /** + * The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The + * dimension cells contain strings, and the metric cells contain numbers. + */ + rows?: string[][]; + /** The requested start date in yyyy-mm-dd format. */ + startDate?: string; + /** + * The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or + * the report row limit. + */ + totalMatchedRows?: string; + /** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + totals?: string[]; + /** Any warnings associated with generation of the report. */ + warnings?: string[]; + } + interface Alert { + /** Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Whether this alert can be dismissed. */ + isDismissible?: boolean; + /** Kind of resource this is, in this case adsense#alert. */ + kind?: string; + /** The localized alert message. */ + message?: string; + /** Severity of this alert. Possible values: INFO, WARNING, SEVERE. */ + severity?: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type?: string; + } + interface Alerts { + /** The alerts returned in this list response. */ + items?: Alert[]; + /** Kind of list this is, in this case adsense#alerts. */ + kind?: string; + } + interface CustomChannel { + /** Code of this custom channel, not necessarily unique across ad clients. */ + code?: string; + /** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#customChannel. */ + kind?: string; + /** Name of this custom channel. */ + name?: string; + /** The targeting information of this custom channel, if activated. */ + targetingInfo?: { + /** The name used to describe this channel externally. */ + adsAppearOn?: string; + /** The external description of the channel. */ + description?: string; + /** + * The locations in which ads appear. (Only valid for content and mobile content ads (deprecated)). Acceptable values for content ads are: TOP_LEFT, + * TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for + * mobile content ads (deprecated) are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS. + */ + location?: string; + /** The language of the sites ads will be displayed on. */ + siteLanguage?: string; + }; + } + interface CustomChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The custom channels returned in this list response. */ + items?: CustomChannel[]; + /** Kind of list this is, in this case adsense#customChannels. */ + kind?: string; + /** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Metadata { + items?: ReportingMetadataEntry[]; + /** Kind of list this is, in this case adsense#metadata. */ + kind?: string; + } + interface Payment { + /** Unique identifier of this Payment. */ + id?: string; + /** Kind of resource this is, in this case adsense#payment. */ + kind?: string; + /** The amount to be paid. */ + paymentAmount?: string; + /** The currency code for the amount to be paid. */ + paymentAmountCurrencyCode?: string; + /** The date this payment was/will be credited to the user, or none if the payment threshold has not been met. */ + paymentDate?: string; + } + interface Payments { + /** The list of Payments for the account. One or both of a) the account's most recent payment; and b) the account's upcoming payment. */ + items?: Payment[]; + /** Kind of list this is, in this case adsense#payments. */ + kind?: string; + } + interface ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension + * belongs to. + */ + compatibleDimensions?: string[]; + /** The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with. */ + compatibleMetrics?: string[]; + /** Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric. */ + id?: string; + /** Kind of resource this is, in this case adsense#reportingMetadataEntry. */ + kind?: string; + /** + * The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report + * to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredDimensions?: string[]; + /** + * The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to + * be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredMetrics?: string[]; + /** The codes of the projects supported by the dimension or metric this reporting metadata entry describes. */ + supportedProducts?: string[]; + } + interface SavedAdStyle { + /** The AdStyle itself. */ + adStyle?: AdStyle; + /** Unique identifier of this saved ad style. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#savedAdStyle. */ + kind?: string; + /** The user selected name of this SavedAdStyle. */ + name?: string; + } + interface SavedAdStyles { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The saved ad styles returned in this list response. */ + items?: SavedAdStyle[]; + /** Kind of list this is, in this case adsense#savedAdStyles. */ + kind?: string; + /** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface SavedReport { + /** Unique identifier of this saved report. */ + id?: string; + /** Kind of resource this is, in this case adsense#savedReport. */ + kind?: string; + /** This saved report's name. */ + name?: string; + } + interface SavedReports { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The saved reports returned in this list response. */ + items?: SavedReport[]; + /** Kind of list this is, in this case adsense#savedReports. */ + kind?: string; + /** Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface UrlChannel { + /** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#urlChannel. */ + kind?: string; + /** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */ + urlPattern?: string; + } + interface UrlChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The URL channels returned in this list response. */ + items?: UrlChannel[]; + /** Kind of list this is, in this case adsense#urlChannels. */ + kind?: string; + /** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdclientsResource { + /** List all ad clients in the specified account. */ + list(request: { + /** Account for which to list ad clients. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** List all custom channels which the specified ad unit belongs to. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Ad unit for which to list custom channels. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** Gets the specified ad unit in the specified ad client for the specified account. */ + get(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to get the ad unit. */ + adClientId: string; + /** Ad unit to retrieve. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get ad code for the specified ad unit. */ + getAdCode(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client with contains the ad unit. */ + adClientId: string; + /** Ad unit to get the code for. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all ad units in the specified ad client for the specified account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list ad units. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + customchannels: CustomchannelsResource; + } + interface AlertsResource { + /** Dismiss (delete) the specified alert from the specified publisher AdSense account. */ + delete(request: { + /** Account which contains the ad unit. */ + accountId: string; + /** Alert to delete. */ + alertId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List the alerts for the specified AdSense account. */ + list(request: { + /** Account for which to retrieve the alerts. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used + * if the supplied locale is invalid or unsupported. + */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** List all ad units in the specified custom channel. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel for which to list ad units. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Get the specified custom channel from the specified ad client for the specified account. */ + get(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to retrieve. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all custom channels in the specified ad client for the specified account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adunits: AdunitsResource; + } + interface PaymentsResource { + /** List the payments for the specified AdSense account. */ + list(request: { + /** Account for which to retrieve the payments. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedResource { + /** Generate an AdSense report based on the saved report ID sent in the query parameters. */ + generate(request: { + /** Account to which the saved reports belong. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The saved report to retrieve. */ + savedReportId: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved reports in the specified AdSense account. */ + list(request: { + /** Account to which the saved reports belong. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved reports to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Account upon which to report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. */ + currency?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. */ + useTimezoneReporting?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + saved: SavedResource; + } + interface SavedadstylesResource { + /** List a specific saved ad style for the specified account. */ + get(request: { + /** Account for which to get the saved ad style. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Saved ad style to retrieve. */ + savedAdStyleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved ad styles in the specified account. */ + list(request: { + /** Account for which to list saved ad styles. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved ad styles to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlchannelsResource { + /** List all URL channels in the specified ad client for the specified account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Get information about the selected AdSense account. */ + get(request: { + /** Account to get information about. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the tree of sub accounts should be returned. */ + tree?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all accounts available to this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adclients: AdclientsResource; + adunits: AdunitsResource; + alerts: AlertsResource; + customchannels: CustomchannelsResource; + payments: PaymentsResource; + reports: ReportsResource; + savedadstyles: SavedadstylesResource; + urlchannels: UrlchannelsResource; + } + interface AdclientsResource { + /** List all ad clients in this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** List all custom channels which the specified ad unit belongs to. */ + list(request: { + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Ad unit for which to list custom channels. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** Gets the specified ad unit in the specified ad client. */ + get(request: { + /** Ad client for which to get the ad unit. */ + adClientId: string; + /** Ad unit to retrieve. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get ad code for the specified ad unit. */ + getAdCode(request: { + /** Ad client with contains the ad unit. */ + adClientId: string; + /** Ad unit to get the code for. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all ad units in the specified ad client for this AdSense account. */ + list(request: { + /** Ad client for which to list ad units. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + customchannels: CustomchannelsResource; + } + interface AlertsResource { + /** Dismiss (delete) the specified alert from the publisher's AdSense account. */ + delete(request: { + /** Alert to delete. */ + alertId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List the alerts for this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used + * if the supplied locale is invalid or unsupported. + */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** List all ad units in the specified custom channel. */ + list(request: { + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel for which to list ad units. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Get the specified custom channel from the specified ad client. */ + get(request: { + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to retrieve. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all custom channels in the specified ad client for this AdSense account. */ + list(request: { + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adunits: AdunitsResource; + } + interface DimensionsResource { + /** List the metadata for the dimensions available to this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetricsResource { + /** List the metadata for the metrics available to this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetadataResource { + dimensions: DimensionsResource; + metrics: MetricsResource; + } + interface PaymentsResource { + /** List the payments for this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedResource { + /** Generate an AdSense report based on the saved report ID sent in the query parameters. */ + generate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The saved report to retrieve. */ + savedReportId: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved reports in this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved reports to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Accounts upon which to report. */ + accountId?: string; + /** Data format for the response. */ + alt?: string; + /** Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. */ + currency?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. */ + useTimezoneReporting?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + saved: SavedResource; + } + interface SavedadstylesResource { + /** Get a specific saved ad style from the user's account. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Saved ad style to retrieve. */ + savedAdStyleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved ad styles in the user's account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved ad styles to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlchannelsResource { + /** List all URL channels in the specified ad client for this AdSense account. */ + list(request: { + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adsense/readme.md b/types/gapi.client.adsense/readme.md new file mode 100644 index 0000000000..49de12e874 --- /dev/null +++ b/types/gapi.client.adsense/readme.md @@ -0,0 +1,132 @@ +# TypeScript typings for AdSense Management API v1.4 +Accesses AdSense publishers' inventory and generates performance reports. +For detailed description please check [documentation](https://developers.google.com/adsense/management/). + +## Installing + +Install typings for AdSense Management API: +``` +npm install @types/gapi.client.adsense@v1.4 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adsense', 'v1.4', () => { + // now we can use gapi.client.adsense + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your AdSense data + 'https://www.googleapis.com/auth/adsense', + + // View your AdSense data + 'https://www.googleapis.com/auth/adsense.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use AdSense Management API resources: + +```typescript + +/* +Get information about the selected AdSense account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", }); + +/* +List all accounts available to this AdSense account. +*/ +await gapi.client.accounts.list({ }); + +/* +List all ad clients in this AdSense account. +*/ +await gapi.client.adclients.list({ }); + +/* +Gets the specified ad unit in the specified ad client. +*/ +await gapi.client.adunits.get({ adClientId: "adClientId", adUnitId: "adUnitId", }); + +/* +Get ad code for the specified ad unit. +*/ +await gapi.client.adunits.getAdCode({ adClientId: "adClientId", adUnitId: "adUnitId", }); + +/* +List all ad units in the specified ad client for this AdSense account. +*/ +await gapi.client.adunits.list({ adClientId: "adClientId", }); + +/* +Dismiss (delete) the specified alert from the publisher's AdSense account. +*/ +await gapi.client.alerts.delete({ alertId: "alertId", }); + +/* +List the alerts for this AdSense account. +*/ +await gapi.client.alerts.list({ }); + +/* +Get the specified custom channel from the specified ad client. +*/ +await gapi.client.customchannels.get({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +List all custom channels in the specified ad client for this AdSense account. +*/ +await gapi.client.customchannels.list({ adClientId: "adClientId", }); + +/* +List the payments for this AdSense account. +*/ +await gapi.client.payments.list({ }); + +/* +Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. +*/ +await gapi.client.reports.generate({ endDate: "endDate", startDate: "startDate", }); + +/* +Get a specific saved ad style from the user's account. +*/ +await gapi.client.savedadstyles.get({ savedAdStyleId: "savedAdStyleId", }); + +/* +List all saved ad styles in the user's account. +*/ +await gapi.client.savedadstyles.list({ }); + +/* +List all URL channels in the specified ad client for this AdSense account. +*/ +await gapi.client.urlchannels.list({ adClientId: "adClientId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.adsense/tsconfig.json b/types/gapi.client.adsense/tsconfig.json new file mode 100644 index 0000000000..49b1e08a5a --- /dev/null +++ b/types/gapi.client.adsense/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adsense-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adsense/tslint.json b/types/gapi.client.adsense/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adsense/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts b/types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts new file mode 100644 index 0000000000..12c14af6da --- /dev/null +++ b/types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts @@ -0,0 +1,119 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adsensehost', 'v4.1', () => { + /** now we can use gapi.client.adsensehost */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your AdSense host data and associated accounts */ + 'https://www.googleapis.com/auth/adsensehost', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Get information about the selected associated AdSense account. */ + await gapi.client.accounts.get({ + accountId: "accountId", + }); + /** List hosted accounts associated with this AdSense account by ad client id. */ + await gapi.client.accounts.list({ + filterAdClientId: "filterAdClientId", + }); + /** Get information about one of the ad clients in the Host AdSense account. */ + await gapi.client.adclients.get({ + adClientId: "adClientId", + }); + /** List all host ad clients in this AdSense account. */ + await gapi.client.adclients.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** Create an association session for initiating an association with an AdSense user. */ + await gapi.client.associationsessions.start({ + productCode: "productCode", + userLocale: "userLocale", + websiteLocale: "websiteLocale", + websiteUrl: "websiteUrl", + }); + /** Verify an association session after the association callback returns from AdSense signup. */ + await gapi.client.associationsessions.verify({ + token: "token", + }); + /** Delete a specific custom channel from the host AdSense account. */ + await gapi.client.customchannels.delete({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** Get a specific custom channel from the host AdSense account. */ + await gapi.client.customchannels.get({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** Add a new custom channel to the host AdSense account. */ + await gapi.client.customchannels.insert({ + adClientId: "adClientId", + }); + /** List all host custom channels in this AdSense account. */ + await gapi.client.customchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + /** Update a custom channel in the host AdSense account. This method supports patch semantics. */ + await gapi.client.customchannels.patch({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** Update a custom channel in the host AdSense account. */ + await gapi.client.customchannels.update({ + adClientId: "adClientId", + }); + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + await gapi.client.reports.generate({ + dimension: "dimension", + endDate: "endDate", + filter: "filter", + locale: "locale", + maxResults: 5, + metric: "metric", + sort: "sort", + startDate: "startDate", + startIndex: 9, + }); + /** Delete a URL channel from the host AdSense account. */ + await gapi.client.urlchannels.delete({ + adClientId: "adClientId", + urlChannelId: "urlChannelId", + }); + /** Add a new URL channel to the host AdSense account. */ + await gapi.client.urlchannels.insert({ + adClientId: "adClientId", + }); + /** List all host URL channels in the host AdSense account. */ + await gapi.client.urlchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.adsensehost/index.d.ts b/types/gapi.client.adsensehost/index.d.ts new file mode 100644 index 0000000000..1595d36c6c --- /dev/null +++ b/types/gapi.client.adsensehost/index.d.ts @@ -0,0 +1,967 @@ +// Type definitions for Google AdSense Host API v4.1 4.1 +// Project: https://developers.google.com/adsense/host/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adsensehost/v4.1/rest + +/// + +declare namespace gapi.client { + /** Load AdSense Host API v4.1 */ + function load(name: "adsensehost", version: "v4.1"): PromiseLike; + function load(name: "adsensehost", version: "v4.1", callback: () => any): void; + + const accounts: adsensehost.AccountsResource; + + const adclients: adsensehost.AdclientsResource; + + const associationsessions: adsensehost.AssociationsessionsResource; + + const customchannels: adsensehost.CustomchannelsResource; + + const reports: adsensehost.ReportsResource; + + const urlchannels: adsensehost.UrlchannelsResource; + + namespace adsensehost { + interface Account { + /** Unique identifier of this account. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#account. */ + kind?: string; + /** Name of this account. */ + name?: string; + /** Approval status of this account. One of: PENDING, APPROVED, DISABLED. */ + status?: string; + } + interface Accounts { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The accounts returned in this list response. */ + items?: Account[]; + /** Kind of list this is, in this case adsensehost#accounts. */ + kind?: string; + } + interface AdClient { + /** Whether this ad client is opted in to ARC. */ + arcOptIn?: boolean; + /** Unique identifier of this ad client. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#adClient. */ + kind?: string; + /** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */ + productCode?: string; + /** Whether this ad client supports being reported on. */ + supportsReporting?: boolean; + } + interface AdClients { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad clients returned in this list response. */ + items?: AdClient[]; + /** Kind of list this is, in this case adsensehost#adClients. */ + kind?: string; + /** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdCode { + /** The ad code snippet. */ + adCode?: string; + /** Kind this is, in this case adsensehost#adCode. */ + kind?: string; + } + interface AdStyle { + /** The colors included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. */ + colors?: { + /** The color of the ad background. */ + background?: string; + /** The color of the ad border. */ + border?: string; + /** The color of the ad text. */ + text?: string; + /** The color of the ad title. */ + title?: string; + /** The color of the ad url. */ + url?: string; + }; + /** The style of the corners in the ad (deprecated: never populated, ignored). */ + corners?: string; + /** The font which is included in the style. */ + font?: { + /** The family of the font. Possible values are: ACCOUNT_DEFAULT_FAMILY, ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and VERDANA. */ + family?: string; + /** The size of the font. Possible values are: ACCOUNT_DEFAULT_SIZE, ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE. */ + size?: string; + }; + /** Kind this is, in this case adsensehost#adStyle. */ + kind?: string; + } + interface AdUnit { + /** Identity code of this ad unit, not necessarily unique across ad clients. */ + code?: string; + /** Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated). */ + contentAdsSettings?: { + /** The backup option to be used in instances where no ad is available. */ + backupOption?: { + /** Color to use when type is set to COLOR. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. */ + color?: string; + /** Type of the backup option. Possible values are BLANK, COLOR and URL. */ + type?: string; + /** URL to use when type is set to URL. */ + url?: string; + }; + /** Size of this ad unit. Size values are in the form SIZE_{width}_{height}. */ + size?: string; + /** Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK. */ + type?: string; + }; + /** Custom style information specific to this ad unit. */ + customStyle?: AdStyle; + /** Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#adUnit. */ + kind?: string; + /** Settings specific to WAP mobile content ads (AFMC - deprecated). */ + mobileContentAdsSettings?: { + /** The markup language to use for this ad unit. */ + markupLanguage?: string; + /** The scripting language to use for this ad unit. */ + scriptingLanguage?: string; + /** Size of this ad unit. */ + size?: string; + /** Type of this ad unit. */ + type?: string; + }; + /** Name of this ad unit. */ + name?: string; + /** + * Status of this ad unit. Possible values are: + * NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it. + * + * ACTIVE: Indicates that there has been activity on this ad unit in the last seven days. + * + * INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days. + */ + status?: string; + } + interface AdUnits { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad units returned in this list response. */ + items?: AdUnit[]; + /** Kind of list this is, in this case adsensehost#adUnits. */ + kind?: string; + /** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AssociationSession { + /** Hosted account id of the associated publisher after association. Present if status is ACCEPTED. */ + accountId?: string; + /** Unique identifier of this association session. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#associationSession. */ + kind?: string; + /** The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated) */ + productCodes?: string[]; + /** Redirect URL of this association session. Used to redirect users into the AdSense association flow. */ + redirectUrl?: string; + /** Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR. */ + status?: string; + /** The preferred locale of the user themselves when going through the AdSense association flow. */ + userLocale?: string; + /** The locale of the user's hosted website. */ + websiteLocale?: string; + /** The URL of the user's hosted website. */ + websiteUrl?: string; + } + interface CustomChannel { + /** Code of this custom channel, not necessarily unique across ad clients. */ + code?: string; + /** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#customChannel. */ + kind?: string; + /** Name of this custom channel. */ + name?: string; + } + interface CustomChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The custom channels returned in this list response. */ + items?: CustomChannel[]; + /** Kind of list this is, in this case adsensehost#customChannels. */ + kind?: string; + /** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Report { + /** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + averages?: string[]; + /** + * The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for + * each metric in the request. + */ + headers?: Array<{ + /** The currency of this column. Only present if the header type is METRIC_CURRENCY. */ + currency?: string; + /** The name of the header. */ + name?: string; + /** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */ + type?: string; + }>; + /** Kind this is, in this case adsensehost#report. */ + kind?: string; + /** + * The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The + * dimension cells contain strings, and the metric cells contain numbers. + */ + rows?: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or + * the report row limit. + */ + totalMatchedRows?: string; + /** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + totals?: string[]; + /** Any warnings associated with generation of the report. */ + warnings?: string[]; + } + interface UrlChannel { + /** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#urlChannel. */ + kind?: string; + /** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */ + urlPattern?: string; + } + interface UrlChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The URL channels returned in this list response. */ + items?: UrlChannel[]; + /** Kind of list this is, in this case adsensehost#urlChannels. */ + kind?: string; + /** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdclientsResource { + /** Get information about one of the ad clients in the specified publisher's AdSense account. */ + get(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client to get. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all hosted ad clients in the specified hosted account. */ + list(request: { + /** Account for which to list ad clients. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** Delete the specified ad unit from the specified publisher AdSense account. */ + delete(request: { + /** Account which contains the ad unit. */ + accountId: string; + /** Ad client for which to get ad unit. */ + adClientId: string; + /** Ad unit to delete. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get the specified host ad unit in this AdSense account. */ + get(request: { + /** Account which contains the ad unit. */ + accountId: string; + /** Ad client for which to get ad unit. */ + adClientId: string; + /** Ad unit to get. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get ad code for the specified ad unit, attaching the specified host custom channels. */ + getAdCode(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client with contains the ad unit. */ + adClientId: string; + /** Ad unit to get the code for. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Host custom channel to attach to the ad code. */ + hostCustomChannelId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Insert the supplied ad unit into the specified publisher AdSense account. */ + insert(request: { + /** Account which will contain the ad unit. */ + accountId: string; + /** Ad client into which to insert the ad unit. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all ad units in the specified publisher's AdSense account. */ + list(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client for which to list ad units. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics. */ + patch(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Ad unit to get. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the supplied ad unit in the specified publisher AdSense account. */ + update(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Hosted account upon which to report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Get information about the selected associated AdSense account. */ + get(request: { + /** Account to get information about. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List hosted accounts associated with this AdSense account by ad client id. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Ad clients to list accounts for. */ + filterAdClientId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adclients: AdclientsResource; + adunits: AdunitsResource; + reports: ReportsResource; + } + interface AdclientsResource { + /** Get information about one of the ad clients in the Host AdSense account. */ + get(request: { + /** Ad client to get. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all host ad clients in this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AssociationsessionsResource { + /** Create an association session for initiating an association with an AdSense user. */ + start(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Products to associate with the user. */ + productCode: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The preferred locale of the user. */ + userLocale?: string; + /** The locale of the user's hosted website. */ + websiteLocale?: string; + /** The URL of the user's hosted website. */ + websiteUrl: string; + }): Request; + /** Verify an association session after the association callback returns from AdSense signup. */ + verify(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token returned to the association callback URL. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Delete a specific custom channel from the host AdSense account. */ + delete(request: { + /** Ad client from which to delete the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to delete. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get a specific custom channel from the host AdSense account. */ + get(request: { + /** Ad client from which to get the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to get. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Add a new custom channel to the host AdSense account. */ + insert(request: { + /** Ad client to which the new custom channel will be added. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all host custom channels in this AdSense account. */ + list(request: { + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a custom channel in the host AdSense account. This method supports patch semantics. */ + patch(request: { + /** Ad client in which the custom channel will be updated. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to get. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a custom channel in the host AdSense account. */ + update(request: { + /** Ad client in which the custom channel will be updated. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Data format for the response. */ + alt?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlchannelsResource { + /** Delete a URL channel from the host AdSense account. */ + delete(request: { + /** Ad client from which to delete the URL channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** URL channel to delete. */ + urlChannelId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Add a new URL channel to the host AdSense account. */ + insert(request: { + /** Ad client to which the new URL channel will be added. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all host URL channels in the host AdSense account. */ + list(request: { + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adsensehost/readme.md b/types/gapi.client.adsensehost/readme.md new file mode 100644 index 0000000000..2418d40442 --- /dev/null +++ b/types/gapi.client.adsensehost/readme.md @@ -0,0 +1,134 @@ +# TypeScript typings for AdSense Host API v4.1 +Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts. +For detailed description please check [documentation](https://developers.google.com/adsense/host/). + +## Installing + +Install typings for AdSense Host API: +``` +npm install @types/gapi.client.adsensehost@v4.1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adsensehost', 'v4.1', () => { + // now we can use gapi.client.adsensehost + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your AdSense host data and associated accounts + 'https://www.googleapis.com/auth/adsensehost', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use AdSense Host API resources: + +```typescript + +/* +Get information about the selected associated AdSense account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", }); + +/* +List hosted accounts associated with this AdSense account by ad client id. +*/ +await gapi.client.accounts.list({ filterAdClientId: "filterAdClientId", }); + +/* +Get information about one of the ad clients in the Host AdSense account. +*/ +await gapi.client.adclients.get({ adClientId: "adClientId", }); + +/* +List all host ad clients in this AdSense account. +*/ +await gapi.client.adclients.list({ }); + +/* +Create an association session for initiating an association with an AdSense user. +*/ +await gapi.client.associationsessions.start({ productCode: "productCode", websiteUrl: "websiteUrl", }); + +/* +Verify an association session after the association callback returns from AdSense signup. +*/ +await gapi.client.associationsessions.verify({ token: "token", }); + +/* +Delete a specific custom channel from the host AdSense account. +*/ +await gapi.client.customchannels.delete({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +Get a specific custom channel from the host AdSense account. +*/ +await gapi.client.customchannels.get({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +Add a new custom channel to the host AdSense account. +*/ +await gapi.client.customchannels.insert({ adClientId: "adClientId", }); + +/* +List all host custom channels in this AdSense account. +*/ +await gapi.client.customchannels.list({ adClientId: "adClientId", }); + +/* +Update a custom channel in the host AdSense account. This method supports patch semantics. +*/ +await gapi.client.customchannels.patch({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +Update a custom channel in the host AdSense account. +*/ +await gapi.client.customchannels.update({ adClientId: "adClientId", }); + +/* +Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. +*/ +await gapi.client.reports.generate({ endDate: "endDate", startDate: "startDate", }); + +/* +Delete a URL channel from the host AdSense account. +*/ +await gapi.client.urlchannels.delete({ adClientId: "adClientId", urlChannelId: "urlChannelId", }); + +/* +Add a new URL channel to the host AdSense account. +*/ +await gapi.client.urlchannels.insert({ adClientId: "adClientId", }); + +/* +List all host URL channels in the host AdSense account. +*/ +await gapi.client.urlchannels.list({ adClientId: "adClientId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.adsensehost/tsconfig.json b/types/gapi.client.adsensehost/tsconfig.json new file mode 100644 index 0000000000..5cee9dc200 --- /dev/null +++ b/types/gapi.client.adsensehost/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adsensehost-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adsensehost/tslint.json b/types/gapi.client.adsensehost/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adsensehost/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.analytics/gapi.client.analytics-tests.ts b/types/gapi.client.analytics/gapi.client.analytics-tests.ts new file mode 100644 index 0000000000..4a8be2094e --- /dev/null +++ b/types/gapi.client.analytics/gapi.client.analytics-tests.ts @@ -0,0 +1,45 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('analytics', 'v3', () => { + /** now we can use gapi.client.analytics */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics', + /** Edit Google Analytics management entities */ + 'https://www.googleapis.com/auth/analytics.edit', + /** Manage Google Analytics Account users by email address */ + 'https://www.googleapis.com/auth/analytics.manage.users', + /** View Google Analytics user permissions */ + 'https://www.googleapis.com/auth/analytics.manage.users.readonly', + /** Create a new Google Analytics account along with its default property and view */ + 'https://www.googleapis.com/auth/analytics.provision', + /** View your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Creates an account ticket. */ + await gapi.client.provisioning.createAccountTicket({ + }); + } +}); diff --git a/types/gapi.client.analytics/index.d.ts b/types/gapi.client.analytics/index.d.ts new file mode 100644 index 0000000000..eeddb3f81f --- /dev/null +++ b/types/gapi.client.analytics/index.d.ts @@ -0,0 +1,4071 @@ +// Type definitions for Google Google Analytics API v3 3.0 +// Project: https://developers.google.com/analytics/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/analytics/v3/rest + +/// + +declare namespace gapi.client { + /** Load Google Analytics API v3 */ + function load(name: "analytics", version: "v3"): PromiseLike; + function load(name: "analytics", version: "v3", callback: () => any): void; + + const data: analytics.DataResource; + + const management: analytics.ManagementResource; + + const metadata: analytics.MetadataResource; + + const provisioning: analytics.ProvisioningResource; + + namespace analytics { + interface Account { + /** Child link for an account entry. Points to the list of web properties for this account. */ + childLink?: { + /** Link to the list of web properties for this account. */ + href?: string; + /** Type of the child link. Its value is "analytics#webproperties". */ + type?: string; + }; + /** Time the account was created. */ + created?: string; + /** Account ID. */ + id?: string; + /** Resource type for Analytics account. */ + kind?: string; + /** Account name. */ + name?: string; + /** Permissions the user has for this account. */ + permissions?: { + /** All the permissions that the user has for this account. These include any implied permissions (e.g., EDIT implies VIEW). */ + effective?: string[]; + }; + /** Link for this account. */ + selfLink?: string; + /** Indicates whether this account is starred or not. */ + starred?: boolean; + /** Time the account was last modified. */ + updated?: string; + } + interface AccountRef { + /** Link for this account. */ + href?: string; + /** Account ID. */ + id?: string; + /** Analytics account reference. */ + kind?: string; + /** Account name. */ + name?: string; + } + interface AccountSummaries { + /** A list of AccountSummaries. */ + items?: AccountSummary[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this AccountSummary collection. */ + nextLink?: string; + /** Link to previous page for this AccountSummary collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface AccountSummary { + /** Account ID. */ + id?: string; + /** Resource type for Analytics AccountSummary. */ + kind?: string; + /** Account name. */ + name?: string; + /** Indicates whether this account is starred or not. */ + starred?: boolean; + /** List of web properties under this account. */ + webProperties?: WebPropertySummary[]; + } + interface AccountTicket { + /** Account for this ticket. */ + account?: Account; + /** Account ticket ID used to access the account ticket. */ + id?: string; + /** Resource type for account ticket. */ + kind?: string; + /** View (Profile) for the account. */ + profile?: Profile; + /** Redirect URI where the user will be sent after accepting Terms of Service. Must be configured in APIs console as a callback URL. */ + redirectUri?: string; + /** Web property for the account. */ + webproperty?: Webproperty; + } + interface Accounts { + /** A list of accounts. */ + items?: Account[]; + /** + * The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Next link for this account collection. */ + nextLink?: string; + /** Previous link for this account collection. */ + previousLink?: string; + /** The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface AdWordsAccount { + /** True if auto-tagging is enabled on the AdWords account. Read-only after the insert operation. */ + autoTaggingEnabled?: boolean; + /** Customer ID. This field is required when creating an AdWords link. */ + customerId?: string; + /** Resource type for AdWords account. */ + kind?: string; + } + interface AnalyticsDataimportDeleteUploadDataRequest { + /** A list of upload UIDs. */ + customDataImportUids?: string[]; + } + interface Column { + /** Map of attribute name and value for this column. */ + attributes?: Record; + /** Column id. */ + id?: string; + /** Resource type for Analytics column. */ + kind?: string; + } + interface Columns { + /** List of attributes names returned by columns. */ + attributeNames?: string[]; + /** Etag of collection. This etag can be compared with the last response etag to check if response has changed. */ + etag?: string; + /** List of columns for a report type. */ + items?: Column[]; + /** Collection type. */ + kind?: string; + /** Total number of columns returned in the response. */ + totalResults?: number; + } + interface CustomDataSource { + /** Account ID to which this custom data source belongs. */ + accountId?: string; + childLink?: { + /** Link to the list of daily uploads for this custom data source. Link to the list of uploads for this custom data source. */ + href?: string; + /** Value is "analytics#dailyUploads". Value is "analytics#uploads". */ + type?: string; + }; + /** Time this custom data source was created. */ + created?: string; + /** Description of custom data source. */ + description?: string; + /** Custom data source ID. */ + id?: string; + importBehavior?: string; + /** Resource type for Analytics custom data source. */ + kind?: string; + /** Name of this custom data source. */ + name?: string; + /** Parent link for this custom data source. Points to the web property to which this custom data source belongs. */ + parentLink?: { + /** Link to the web property to which this custom data source belongs. */ + href?: string; + /** Value is "analytics#webproperty". */ + type?: string; + }; + /** IDs of views (profiles) linked to the custom data source. */ + profilesLinked?: string[]; + /** Collection of schema headers of the custom data source. */ + schema?: string[]; + /** Link for this Analytics custom data source. */ + selfLink?: string; + /** Type of the custom data source. */ + type?: string; + /** Time this custom data source was last modified. */ + updated?: string; + /** Upload type of the custom data source. */ + uploadType?: string; + /** Web property ID of the form UA-XXXXX-YY to which this custom data source belongs. */ + webPropertyId?: string; + } + interface CustomDataSources { + /** Collection of custom data sources. */ + items?: CustomDataSource[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this custom data source collection. */ + nextLink?: string; + /** Link to previous page for this custom data source collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface CustomDimension { + /** Account ID. */ + accountId?: string; + /** Boolean indicating whether the custom dimension is active. */ + active?: boolean; + /** Time the custom dimension was created. */ + created?: string; + /** Custom dimension ID. */ + id?: string; + /** Index of the custom dimension. */ + index?: number; + /** Kind value for a custom dimension. Set to "analytics#customDimension". It is a read-only field. */ + kind?: string; + /** Name of the custom dimension. */ + name?: string; + /** Parent link for the custom dimension. Points to the property to which the custom dimension belongs. */ + parentLink?: { + /** Link to the property to which the custom dimension belongs. */ + href?: string; + /** Type of the parent link. Set to "analytics#webproperty". */ + type?: string; + }; + /** Scope of the custom dimension: HIT, SESSION, USER or PRODUCT. */ + scope?: string; + /** Link for the custom dimension */ + selfLink?: string; + /** Time the custom dimension was last modified. */ + updated?: string; + /** Property ID. */ + webPropertyId?: string; + } + interface CustomDimensions { + /** Collection of custom dimensions. */ + items?: CustomDimension[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this custom dimension collection. */ + nextLink?: string; + /** Link to previous page for this custom dimension collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface CustomMetric { + /** Account ID. */ + accountId?: string; + /** Boolean indicating whether the custom metric is active. */ + active?: boolean; + /** Time the custom metric was created. */ + created?: string; + /** Custom metric ID. */ + id?: string; + /** Index of the custom metric. */ + index?: number; + /** Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field. */ + kind?: string; + /** Max value of custom metric. */ + max_value?: string; + /** Min value of custom metric. */ + min_value?: string; + /** Name of the custom metric. */ + name?: string; + /** Parent link for the custom metric. Points to the property to which the custom metric belongs. */ + parentLink?: { + /** Link to the property to which the custom metric belongs. */ + href?: string; + /** Type of the parent link. Set to "analytics#webproperty". */ + type?: string; + }; + /** Scope of the custom metric: HIT or PRODUCT. */ + scope?: string; + /** Link for the custom metric */ + selfLink?: string; + /** Data type of custom metric. */ + type?: string; + /** Time the custom metric was last modified. */ + updated?: string; + /** Property ID. */ + webPropertyId?: string; + } + interface CustomMetrics { + /** Collection of custom metrics. */ + items?: CustomMetric[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this custom metric collection. */ + nextLink?: string; + /** Link to previous page for this custom metric collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface EntityAdWordsLink { + /** A list of AdWords client accounts. These cannot be MCC accounts. This field is required when creating an AdWords link. It cannot be empty. */ + adWordsAccounts?: AdWordsAccount[]; + /** Web property being linked. */ + entity?: { + webPropertyRef?: WebPropertyRef; + }; + /** Entity AdWords link ID */ + id?: string; + /** Resource type for entity AdWords link. */ + kind?: string; + /** Name of the link. This field is required when creating an AdWords link. */ + name?: string; + /** IDs of linked Views (Profiles) represented as strings. */ + profileIds?: string[]; + /** URL link for this Google Analytics - Google AdWords link. */ + selfLink?: string; + } + interface EntityAdWordsLinks { + /** A list of entity AdWords links. */ + items?: EntityAdWordsLink[]; + /** + * The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Next link for this AdWords link collection. */ + nextLink?: string; + /** Previous link for this AdWords link collection. */ + previousLink?: string; + /** The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + } + interface EntityUserLink { + /** Entity for this link. It can be an account, a web property, or a view (profile). */ + entity?: { + /** Account for this link. */ + accountRef?: AccountRef; + /** View (Profile) for this link. */ + profileRef?: ProfileRef; + /** Web property for this link. */ + webPropertyRef?: WebPropertyRef; + }; + /** Entity user link ID */ + id?: string; + /** Resource type for entity user link. */ + kind?: string; + /** Permissions the user has for this entity. */ + permissions?: { + /** + * Effective permissions represent all the permissions that a user has for this entity. These include any implied permissions (e.g., EDIT implies VIEW) or + * inherited permissions from the parent entity. Effective permissions are read-only. + */ + effective?: string[]; + /** Permissions that a user has been assigned at this very level. Does not include any implied or inherited permissions. Local permissions are modifiable. */ + local?: string[]; + }; + /** Self link for this resource. */ + selfLink?: string; + /** User reference. */ + userRef?: UserRef; + } + interface EntityUserLinks { + /** A list of entity user links. */ + items?: EntityUserLink[]; + /** + * The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Next link for this account collection. */ + nextLink?: string; + /** Previous link for this account collection. */ + previousLink?: string; + /** The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + } + interface Experiment { + /** Account ID to which this experiment belongs. This field is read-only. */ + accountId?: string; + /** Time the experiment was created. This field is read-only. */ + created?: string; + /** Notes about this experiment. */ + description?: string; + /** If true, the end user will be able to edit the experiment via the Google Analytics user interface. */ + editableInGaUi?: boolean; + /** + * The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This + * field is read-only. + */ + endTime?: string; + /** + * Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior + * of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose + * status is ENDED. + */ + equalWeighting?: boolean; + /** Experiment ID. Required for patch and update. Disallowed for create. */ + id?: string; + /** Internal ID for the web property to which this experiment belongs. This field is read-only. */ + internalWebPropertyId?: string; + /** Resource type for an Analytics experiment. This field is read-only. */ + kind?: string; + /** + * An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed + * for an experiments whose status is ENDED. + */ + minimumExperimentLengthInDays?: number; + /** Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. */ + name?: string; + /** + * The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", + * "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and + * servingFramework is one of "REDIRECT" or "API". + */ + objectiveMetric?: string; + /** + * Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be + * specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". + */ + optimizationType?: string; + /** Parent link for an experiment. Points to the view (profile) to which this experiment belongs. */ + parentLink?: { + /** Link to the view (profile) to which this experiment belongs. This field is read-only. */ + href?: string; + /** Value is "analytics#profile". This field is read-only. */ + type?: string; + }; + /** View (Profile) ID to which this experiment belongs. This field is read-only. */ + profileId?: string; + /** + * Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". + * "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API + * to ENDED this field is set to STOPPED_BY_USER. This field is read-only. + */ + reasonExperimentEnded?: string; + /** + * Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status + * is ENDED. + */ + rewriteVariationUrlsAsOriginal?: boolean; + /** Link for this experiment. This field is read-only. */ + selfLink?: string; + /** + * The framework used to serve the experiment variations and evaluate the results. One of: + * - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. + * - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected + * variation. + * - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the + * selected variation and evaluating the results. + */ + servingFramework?: string; + /** The snippet of code to include on the control page(s). This field is read-only. */ + snippet?: string; + /** + * The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has + * started. This field is read-only. + */ + startTime?: string; + /** + * Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" + * state. This field is required when creating an experiment. + */ + status?: string; + /** + * A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. + * This field may not be changed for an experiments whose status is ENDED. + */ + trafficCoverage?: number; + /** Time the experiment was last modified. This field is read-only. */ + updated?: string; + /** + * Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING + * state. At least two variations are required before status can be set to RUNNING. + */ + variations?: Array<{ + /** The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. */ + name?: string; + /** + * Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment + * whose status is ENDED. + */ + status?: string; + /** The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. */ + url?: string; + /** Weight that this variation should receive. Only present if the experiment is running. This field is read-only. */ + weight?: number; + /** True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. */ + won?: boolean; + }>; + /** Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. */ + webPropertyId?: string; + /** + * A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose + * status is ENDED. + */ + winnerConfidenceLevel?: number; + /** Boolean specifying whether a winner has been found for this experiment. This field is read-only. */ + winnerFound?: boolean; + } + interface Experiments { + /** A list of experiments. */ + items?: Experiment[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this experiment collection. */ + nextLink?: string; + /** Link to previous page for this experiment collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Filter { + /** Account ID to which this filter belongs. */ + accountId?: string; + /** Details for the filter of the type ADVANCED. */ + advancedDetails?: { + /** Indicates if the filter expressions are case sensitive. */ + caseSensitive?: boolean; + /** Expression to extract from field A. */ + extractA?: string; + /** Expression to extract from field B. */ + extractB?: string; + /** Field A. */ + fieldA?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldAIndex?: number; + /** Indicates if field A is required to match. */ + fieldARequired?: boolean; + /** Field B. */ + fieldB?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldBIndex?: number; + /** Indicates if field B is required to match. */ + fieldBRequired?: boolean; + /** Expression used to construct the output value. */ + outputConstructor?: string; + /** Output field. */ + outputToField?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + outputToFieldIndex?: number; + /** Indicates if the existing value of the output field, if any, should be overridden by the output expression. */ + overrideOutputField?: boolean; + }; + /** Time this filter was created. */ + created?: string; + /** Details for the filter of the type EXCLUDE. */ + excludeDetails?: FilterExpression; + /** Filter ID. */ + id?: string; + /** Details for the filter of the type INCLUDE. */ + includeDetails?: FilterExpression; + /** Resource type for Analytics filter. */ + kind?: string; + /** Details for the filter of the type LOWER. */ + lowercaseDetails?: { + /** Field to use in the filter. */ + field?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldIndex?: number; + }; + /** Name of this filter. */ + name?: string; + /** Parent link for this filter. Points to the account to which this filter belongs. */ + parentLink?: { + /** Link to the account to which this filter belongs. */ + href?: string; + /** Value is "analytics#account". */ + type?: string; + }; + /** Details for the filter of the type SEARCH_AND_REPLACE. */ + searchAndReplaceDetails?: { + /** Determines if the filter is case sensitive. */ + caseSensitive?: boolean; + /** Field to use in the filter. */ + field?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldIndex?: number; + /** Term to replace the search term with. */ + replaceString?: string; + /** Term to search. */ + searchString?: string; + }; + /** Link for this filter. */ + selfLink?: string; + /** Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED. */ + type?: string; + /** Time this filter was last modified. */ + updated?: string; + /** Details for the filter of the type UPPER. */ + uppercaseDetails?: { + /** Field to use in the filter. */ + field?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldIndex?: number; + }; + } + interface FilterExpression { + /** Determines if the filter is case sensitive. */ + caseSensitive?: boolean; + /** Filter expression value */ + expressionValue?: string; + /** + * Field to filter. Possible values: + * - Content and Traffic + * - PAGE_REQUEST_URI, + * - PAGE_HOSTNAME, + * - PAGE_TITLE, + * - REFERRAL, + * - COST_DATA_URI (Campaign target URL), + * - HIT_TYPE, + * - INTERNAL_SEARCH_TERM, + * - INTERNAL_SEARCH_TYPE, + * - SOURCE_PROPERTY_TRACKING_ID, + * - Campaign or AdGroup + * - CAMPAIGN_SOURCE, + * - CAMPAIGN_MEDIUM, + * - CAMPAIGN_NAME, + * - CAMPAIGN_AD_GROUP, + * - CAMPAIGN_TERM, + * - CAMPAIGN_CONTENT, + * - CAMPAIGN_CODE, + * - CAMPAIGN_REFERRAL_PATH, + * - E-Commerce + * - TRANSACTION_COUNTRY, + * - TRANSACTION_REGION, + * - TRANSACTION_CITY, + * - TRANSACTION_AFFILIATION (Store or order location), + * - ITEM_NAME, + * - ITEM_CODE, + * - ITEM_VARIATION, + * - TRANSACTION_ID, + * - TRANSACTION_CURRENCY_CODE, + * - PRODUCT_ACTION_TYPE, + * - Audience/Users + * - BROWSER, + * - BROWSER_VERSION, + * - BROWSER_SIZE, + * - PLATFORM, + * - PLATFORM_VERSION, + * - LANGUAGE, + * - SCREEN_RESOLUTION, + * - SCREEN_COLORS, + * - JAVA_ENABLED (Boolean Field), + * - FLASH_VERSION, + * - GEO_SPEED (Connection speed), + * - VISITOR_TYPE, + * - GEO_ORGANIZATION (ISP organization), + * - GEO_DOMAIN, + * - GEO_IP_ADDRESS, + * - GEO_IP_VERSION, + * - Location + * - GEO_COUNTRY, + * - GEO_REGION, + * - GEO_CITY, + * - Event + * - EVENT_CATEGORY, + * - EVENT_ACTION, + * - EVENT_LABEL, + * - Other + * - CUSTOM_FIELD_1, + * - CUSTOM_FIELD_2, + * - USER_DEFINED_VALUE, + * - Application + * - APP_ID, + * - APP_INSTALLER_ID, + * - APP_NAME, + * - APP_VERSION, + * - SCREEN, + * - IS_APP (Boolean Field), + * - IS_FATAL_EXCEPTION (Boolean Field), + * - EXCEPTION_DESCRIPTION, + * - Mobile device + * - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile), + * - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet), + * - DEVICE_CATEGORY, + * - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), + * - MOBILE_HAS_NFC_SUPPORT (Boolean Field), + * - MOBILE_HAS_CELLULAR_RADIO (Boolean Field), + * - MOBILE_HAS_WIFI_SUPPORT (Boolean Field), + * - MOBILE_BRAND_NAME, + * - MOBILE_MODEL_NAME, + * - MOBILE_MARKETING_NAME, + * - MOBILE_POINTING_METHOD, + * - Social + * - SOCIAL_NETWORK, + * - SOCIAL_ACTION, + * - SOCIAL_ACTION_TARGET, + * - Custom dimension + * - CUSTOM_DIMENSION (See accompanying field index), + */ + field?: string; + /** The Index of the custom dimension. Set only if the field is a is CUSTOM_DIMENSION. */ + fieldIndex?: number; + /** Kind value for filter expression */ + kind?: string; + /** + * Match type for this filter. Possible values are BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, GEO_IP_ADDRESS, PAGE_REQUEST_URI, or + * PAGE_HOSTNAME filters can use any match type; all other filters must use MATCHES. + */ + matchType?: string; + } + interface FilterRef { + /** Account ID to which this filter belongs. */ + accountId?: string; + /** Link for this filter. */ + href?: string; + /** Filter ID. */ + id?: string; + /** Kind value for filter reference. */ + kind?: string; + /** Name of this filter. */ + name?: string; + } + interface Filters { + /** A list of filters. */ + items?: Filter[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1,000 with + * a value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this filter collection. */ + nextLink?: string; + /** Link to previous page for this filter collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface GaData { + /** Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. */ + columnHeaders?: Array<{ + /** Column Type. Either DIMENSION or METRIC. */ + columnType?: string; + /** + * Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, + * CURRENCY etc. + */ + dataType?: string; + /** Column name. */ + name?: string; + }>; + /** Determines if Analytics data contains samples. */ + containsSampledData?: boolean; + /** The last refreshed time in seconds for Analytics data. */ + dataLastRefreshed?: string; + dataTable?: { + cols?: Array<{ + id?: string; + label?: string; + type?: string; + }>; + rows?: Array<{ + c?: Array<{ + v?: string; + }>; + }>; + }; + /** Unique ID for this data response. */ + id?: string; + /** + * The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value + * of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Resource type. */ + kind?: string; + /** Link to next page for this Analytics data query. */ + nextLink?: string; + /** Link to previous page for this Analytics data query. */ + previousLink?: string; + /** Information for the view (profile), for which the Analytics data was requested. */ + profileInfo?: { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** View (Profile) ID. */ + profileId?: string; + /** View (Profile) name. */ + profileName?: string; + /** Table ID for view (profile). */ + tableId?: string; + /** Web Property ID to which this view (profile) belongs. */ + webPropertyId?: string; + }; + /** Analytics data request query parameters. */ + query?: { + /** List of analytics dimensions. */ + dimensions?: string; + /** End date. */ + "end-date"?: string; + /** Comma-separated list of dimension or metric filters. */ + filters?: string; + /** Unique table ID. */ + ids?: string; + /** Maximum results per page. */ + "max-results"?: number; + /** List of analytics metrics. */ + metrics?: string[]; + /** Desired sampling level */ + samplingLevel?: string; + /** Analytics advanced segment. */ + segment?: string; + /** List of dimensions or metrics based on which Analytics data is sorted. */ + sort?: string[]; + /** Start date. */ + "start-date"?: string; + /** Start index. */ + "start-index"?: number; + }; + /** + * Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as + * specified in the request. + */ + rows?: string[][]; + /** The number of samples used to calculate the result. */ + sampleSize?: string; + /** Total size of the sample space from which the samples were selected. */ + sampleSpace?: string; + /** Link to this page. */ + selfLink?: string; + /** The total number of rows for the query, regardless of the number of rows in the response. */ + totalResults?: number; + /** + * Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as + * the metric order specified in the request. + */ + totalsForAllResults?: Record; + } + interface Goal { + /** Account ID to which this goal belongs. */ + accountId?: string; + /** Determines whether this goal is active. */ + active?: boolean; + /** Time this goal was created. */ + created?: string; + /** Details for the goal of the type EVENT. */ + eventDetails?: { + /** List of event conditions. */ + eventConditions?: Array<{ + /** Type of comparison. Possible values are LESS_THAN, GREATER_THAN or EQUAL. */ + comparisonType?: string; + /** Value used for this comparison. */ + comparisonValue?: string; + /** Expression used for this match. */ + expression?: string; + /** Type of the match to be performed. Possible values are REGEXP, BEGINS_WITH, or EXACT. */ + matchType?: string; + /** Type of this event condition. Possible values are CATEGORY, ACTION, LABEL, or VALUE. */ + type?: string; + }>; + /** Determines if the event value should be used as the value for this goal. */ + useEventValue?: boolean; + }; + /** Goal ID. */ + id?: string; + /** Internal ID for the web property to which this goal belongs. */ + internalWebPropertyId?: string; + /** Resource type for an Analytics goal. */ + kind?: string; + /** Goal name. */ + name?: string; + /** Parent link for a goal. Points to the view (profile) to which this goal belongs. */ + parentLink?: { + /** Link to the view (profile) to which this goal belongs. */ + href?: string; + /** Value is "analytics#profile". */ + type?: string; + }; + /** View (Profile) ID to which this goal belongs. */ + profileId?: string; + /** Link for this goal. */ + selfLink?: string; + /** Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT. */ + type?: string; + /** Time this goal was last modified. */ + updated?: string; + /** Details for the goal of the type URL_DESTINATION. */ + urlDestinationDetails?: { + /** Determines if the goal URL must exactly match the capitalization of visited URLs. */ + caseSensitive?: boolean; + /** Determines if the first step in this goal is required. */ + firstStepRequired?: boolean; + /** Match type for the goal URL. Possible values are HEAD, EXACT, or REGEX. */ + matchType?: string; + /** List of steps configured for this goal funnel. */ + steps?: Array<{ + /** Step name. */ + name?: string; + /** Step number. */ + number?: number; + /** URL for this step. */ + url?: string; + }>; + /** URL for this goal. */ + url?: string; + }; + /** Goal value. */ + value?: number; + /** Details for the goal of the type VISIT_NUM_PAGES. */ + visitNumPagesDetails?: { + /** Type of comparison. Possible values are LESS_THAN, GREATER_THAN, or EQUAL. */ + comparisonType?: string; + /** Value used for this comparison. */ + comparisonValue?: string; + }; + /** Details for the goal of the type VISIT_TIME_ON_SITE. */ + visitTimeOnSiteDetails?: { + /** Type of comparison. Possible values are LESS_THAN or GREATER_THAN. */ + comparisonType?: string; + /** Value used for this comparison. */ + comparisonValue?: string; + }; + /** Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY. */ + webPropertyId?: string; + } + interface Goals { + /** A list of goals. */ + items?: Goal[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this goal collection. */ + nextLink?: string; + /** Link to previous page for this goal collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface IncludeConditions { + /** + * The look-back window lets you specify a time frame for evaluating the behavior that qualifies users for your audience. For example, if your filters + * include users from Central Asia, and Transactions Greater than 2, and you set the look-back window to 14 days, then any user from Central Asia whose + * cumulative transactions exceed 2 during the last 14 days is added to the audience. + */ + daysToLookBack?: number; + /** Boolean indicating whether this segment is a smart list. https://support.google.com/analytics/answer/4628577 */ + isSmartList?: boolean; + /** Resource type for include conditions. */ + kind?: string; + /** Number of days (in the range 1 to 540) a user remains in the audience. */ + membershipDurationDays?: number; + /** The segment condition that will cause a user to be added to an audience. */ + segment?: string; + } + interface LinkedForeignAccount { + /** Account ID to which this linked foreign account belongs. */ + accountId?: string; + /** Boolean indicating whether this is eligible for search. */ + eligibleForSearch?: boolean; + /** Entity ad account link ID. */ + id?: string; + /** Internal ID for the web property to which this linked foreign account belongs. */ + internalWebPropertyId?: string; + /** Resource type for linked foreign account. */ + kind?: string; + /** The foreign account ID. For example the an AdWords `linkedAccountId` has the following format XXX-XXX-XXXX. */ + linkedAccountId?: string; + /** Remarketing audience ID to which this linked foreign account belongs. */ + remarketingAudienceId?: string; + /** The status of this foreign account link. */ + status?: string; + /** The type of the foreign account. For example, `ADWORDS_LINKS`, `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`. */ + type?: string; + /** Web property ID of the form UA-XXXXX-YY to which this linked foreign account belongs. */ + webPropertyId?: string; + } + interface McfData { + /** Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. */ + columnHeaders?: Array<{ + /** Column Type. Either DIMENSION or METRIC. */ + columnType?: string; + /** Data type. Dimension and metric values data types such as INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc. */ + dataType?: string; + /** Column name. */ + name?: string; + }>; + /** Determines if the Analytics data contains sampled data. */ + containsSampledData?: boolean; + /** Unique ID for this data response. */ + id?: string; + /** + * The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value + * of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Resource type. */ + kind?: string; + /** Link to next page for this Analytics data query. */ + nextLink?: string; + /** Link to previous page for this Analytics data query. */ + previousLink?: string; + /** Information for the view (profile), for which the Analytics data was requested. */ + profileInfo?: { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** View (Profile) ID. */ + profileId?: string; + /** View (Profile) name. */ + profileName?: string; + /** Table ID for view (profile). */ + tableId?: string; + /** Web Property ID to which this view (profile) belongs. */ + webPropertyId?: string; + }; + /** Analytics data request query parameters. */ + query?: { + /** List of analytics dimensions. */ + dimensions?: string; + /** End date. */ + "end-date"?: string; + /** Comma-separated list of dimension or metric filters. */ + filters?: string; + /** Unique table ID. */ + ids?: string; + /** Maximum results per page. */ + "max-results"?: number; + /** List of analytics metrics. */ + metrics?: string[]; + /** Desired sampling level */ + samplingLevel?: string; + /** Analytics advanced segment. */ + segment?: string; + /** List of dimensions or metrics based on which Analytics data is sorted. */ + sort?: string[]; + /** Start date. */ + "start-date"?: string; + /** Start index. */ + "start-index"?: number; + }; + /** + * Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as + * specified in the request. + */ + rows?: Array; + /** A primitive dimension value. A primitive metric value. */ + primitiveValue?: string; + }>>; + /** The number of samples used to calculate the result. */ + sampleSize?: string; + /** Total size of the sample space from which the samples were selected. */ + sampleSpace?: string; + /** Link to this page. */ + selfLink?: string; + /** The total number of rows for the query, regardless of the number of rows in the response. */ + totalResults?: number; + /** + * Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as + * the metric order specified in the request. + */ + totalsForAllResults?: Record; + } + interface Profile { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Indicates whether bot filtering is enabled for this view (profile). */ + botFilteringEnabled?: boolean; + /** Child link for this view (profile). Points to the list of goals for this view (profile). */ + childLink?: { + /** Link to the list of goals for this view (profile). */ + href?: string; + /** Value is "analytics#goals". */ + type?: string; + }; + /** Time this view (profile) was created. */ + created?: string; + /** + * The currency type associated with this view (profile), defaults to USD. The supported values are: + * USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, RUB, SEK, NOK, PLN, TRY, TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, CHF, CAD, CZK, NZD, HUF, BGN, LTL, + * ZAR, UAH, AED, BOB, CLP, COP, EGP, HRK, ILS, MAD, MYR, PEN, PKR, RON, RSD, SAR, SGD, VEF, LVL + */ + currency?: string; + /** Default page for this view (profile). */ + defaultPage?: string; + /** Indicates whether ecommerce tracking is enabled for this view (profile). */ + eCommerceTracking?: boolean; + /** Indicates whether enhanced ecommerce tracking is enabled for this view (profile). This property can only be enabled if ecommerce tracking is enabled. */ + enhancedECommerceTracking?: boolean; + /** The query parameters that are excluded from this view (profile). */ + excludeQueryParameters?: string; + /** View (Profile) ID. */ + id?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** Resource type for Analytics view (profile). */ + kind?: string; + /** Name of this view (profile). */ + name?: string; + /** Parent link for this view (profile). Points to the web property to which this view (profile) belongs. */ + parentLink?: { + /** Link to the web property to which this view (profile) belongs. */ + href?: string; + /** Value is "analytics#webproperty". */ + type?: string; + }; + /** Permissions the user has for this view (profile). */ + permissions?: { + /** + * All the permissions that the user has for this view (profile). These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions + * from the parent web property. + */ + effective?: string[]; + }; + /** Link for this view (profile). */ + selfLink?: string; + /** Site search category parameters for this view (profile). */ + siteSearchCategoryParameters?: string; + /** The site search query parameters for this view (profile). */ + siteSearchQueryParameters?: string; + /** Indicates whether this view (profile) is starred or not. */ + starred?: boolean; + /** Whether or not Analytics will strip search category parameters from the URLs in your reports. */ + stripSiteSearchCategoryParameters?: boolean; + /** Whether or not Analytics will strip search query parameters from the URLs in your reports. */ + stripSiteSearchQueryParameters?: boolean; + /** Time zone for which this view (profile) has been configured. Time zones are identified by strings from the TZ database. */ + timezone?: string; + /** View (Profile) type. Supported types: WEB or APP. */ + type?: string; + /** Time this view (profile) was last modified. */ + updated?: string; + /** Web property ID of the form UA-XXXXX-YY to which this view (profile) belongs. */ + webPropertyId?: string; + /** Website URL for this view (profile). */ + websiteUrl?: string; + } + interface ProfileFilterLink { + /** Filter for this link. */ + filterRef?: FilterRef; + /** Profile filter link ID. */ + id?: string; + /** Resource type for Analytics filter. */ + kind?: string; + /** View (Profile) for this link. */ + profileRef?: ProfileRef; + /** + * The rank of this profile filter link relative to the other filters linked to the same profile. + * For readonly (i.e., list and get) operations, the rank always starts at 1. + * For write (i.e., create, update, or delete) operations, you may specify a value between 0 and 255 inclusively, [0, 255]. In order to insert a link at + * the end of the list, either don't specify a rank or set a rank to a number greater than the largest rank in the list. In order to insert a link to the + * beginning of the list specify a rank that is less than or equal to 1. The new link will move all existing filters with the same or lower rank down the + * list. After the link is inserted/updated/deleted all profile filter links will be renumbered starting at 1. + */ + rank?: number; + /** Link for this profile filter link. */ + selfLink?: string; + } + interface ProfileFilterLinks { + /** A list of profile filter links. */ + items?: ProfileFilterLink[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1,000 with + * a value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this profile filter link collection. */ + nextLink?: string; + /** Link to previous page for this profile filter link collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface ProfileRef { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Link for this view (profile). */ + href?: string; + /** View (Profile) ID. */ + id?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** Analytics view (profile) reference. */ + kind?: string; + /** Name of this view (profile). */ + name?: string; + /** Web property ID of the form UA-XXXXX-YY to which this view (profile) belongs. */ + webPropertyId?: string; + } + interface ProfileSummary { + /** View (profile) ID. */ + id?: string; + /** Resource type for Analytics ProfileSummary. */ + kind?: string; + /** View (profile) name. */ + name?: string; + /** Indicates whether this view (profile) is starred or not. */ + starred?: boolean; + /** View (Profile) type. Supported types: WEB or APP. */ + type?: string; + } + interface Profiles { + /** A list of views (profiles). */ + items?: Profile[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this view (profile) collection. */ + nextLink?: string; + /** Link to previous page for this view (profile) collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface RealtimeData { + /** Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. */ + columnHeaders?: Array<{ + /** Column Type. Either DIMENSION or METRIC. */ + columnType?: string; + /** + * Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, + * CURRENCY etc. + */ + dataType?: string; + /** Column name. */ + name?: string; + }>; + /** Unique ID for this data response. */ + id?: string; + /** Resource type. */ + kind?: string; + /** Information for the view (profile), for which the real time data was requested. */ + profileInfo?: { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** View (Profile) ID. */ + profileId?: string; + /** View (Profile) name. */ + profileName?: string; + /** Table ID for view (profile). */ + tableId?: string; + /** Web Property ID to which this view (profile) belongs. */ + webPropertyId?: string; + }; + /** Real time data request query parameters. */ + query?: { + /** List of real time dimensions. */ + dimensions?: string; + /** Comma-separated list of dimension or metric filters. */ + filters?: string; + /** Unique table ID. */ + ids?: string; + /** Maximum results per page. */ + "max-results"?: number; + /** List of real time metrics. */ + metrics?: string[]; + /** List of dimensions or metrics based on which real time data is sorted. */ + sort?: string[]; + }; + /** + * Real time data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as + * specified in the request. + */ + rows?: string[][]; + /** Link to this page. */ + selfLink?: string; + /** The total number of rows for the query, regardless of the number of rows in the response. */ + totalResults?: number; + /** + * Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as + * the metric order specified in the request. + */ + totalsForAllResults?: Record; + } + interface RemarketingAudience { + /** Account ID to which this remarketing audience belongs. */ + accountId?: string; + /** The simple audience definition that will cause a user to be added to an audience. */ + audienceDefinition?: { + /** Defines the conditions to include users to the audience. */ + includeConditions?: IncludeConditions; + }; + /** The type of audience, either SIMPLE or STATE_BASED. */ + audienceType?: string; + /** Time this remarketing audience was created. */ + created?: string; + /** The description of this remarketing audience. */ + description?: string; + /** Remarketing Audience ID. */ + id?: string; + /** Internal ID for the web property to which this remarketing audience belongs. */ + internalWebPropertyId?: string; + /** Collection type. */ + kind?: string; + /** The linked ad accounts associated with this remarketing audience. A remarketing audience can have only one linkedAdAccount currently. */ + linkedAdAccounts?: LinkedForeignAccount[]; + /** The views (profiles) that this remarketing audience is linked to. */ + linkedViews?: string[]; + /** The name of this remarketing audience. */ + name?: string; + /** A state based audience definition that will cause a user to be added or removed from an audience. */ + stateBasedAudienceDefinition?: { + /** Defines the conditions to exclude users from the audience. */ + excludeConditions?: { + /** Whether to make the exclusion TEMPORARY or PERMANENT. */ + exclusionDuration?: string; + /** The segment condition that will cause a user to be removed from an audience. */ + segment?: string; + }; + /** Defines the conditions to include users to the audience. */ + includeConditions?: IncludeConditions; + }; + /** Time this remarketing audience was last modified. */ + updated?: string; + /** Web property ID of the form UA-XXXXX-YY to which this remarketing audience belongs. */ + webPropertyId?: string; + } + interface RemarketingAudiences { + /** A list of remarketing audiences. */ + items?: RemarketingAudience[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this remarketing audience collection. */ + nextLink?: string; + /** Link to previous page for this view (profile) collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Segment { + /** Time the segment was created. */ + created?: string; + /** Segment definition. */ + definition?: string; + /** Segment ID. */ + id?: string; + /** Resource type for Analytics segment. */ + kind?: string; + /** Segment name. */ + name?: string; + /** Segment ID. Can be used with the 'segment' parameter in Core Reporting API. */ + segmentId?: string; + /** Link for this segment. */ + selfLink?: string; + /** Type for a segment. Possible values are "BUILT_IN" or "CUSTOM". */ + type?: string; + /** Time the segment was last modified. */ + updated?: string; + } + interface Segments { + /** A list of segments. */ + items?: Segment[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type for segments. */ + kind?: string; + /** Link to next page for this segment collection. */ + nextLink?: string; + /** Link to previous page for this segment collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface UnsampledReport { + /** Account ID to which this unsampled report belongs. */ + accountId?: string; + /** Download details for a file stored in Google Cloud Storage. */ + cloudStorageDownloadDetails?: { + /** Id of the bucket the file object is stored in. */ + bucketId?: string; + /** Id of the file object containing the report data. */ + objectId?: string; + }; + /** Time this unsampled report was created. */ + created?: string; + /** The dimensions for the unsampled report. */ + dimensions?: string; + /** + * The type of download you need to use for the report data file. Possible values include `GOOGLE_DRIVE` and `GOOGLE_CLOUD_STORAGE`. If the value is + * `GOOGLE_DRIVE`, see the `driveDownloadDetails` field. If the value is `GOOGLE_CLOUD_STORAGE`, see the `cloudStorageDownloadDetails` field. + */ + downloadType?: string; + /** Download details for a file stored in Google Drive. */ + driveDownloadDetails?: { + /** Id of the document/file containing the report data. */ + documentId?: string; + }; + /** The end date for the unsampled report. */ + "end-date"?: string; + /** The filters for the unsampled report. */ + filters?: string; + /** Unsampled report ID. */ + id?: string; + /** Resource type for an Analytics unsampled report. */ + kind?: string; + /** The metrics for the unsampled report. */ + metrics?: string; + /** View (Profile) ID to which this unsampled report belongs. */ + profileId?: string; + /** The segment for the unsampled report. */ + segment?: string; + /** Link for this unsampled report. */ + selfLink?: string; + /** The start date for the unsampled report. */ + "start-date"?: string; + /** Status of this unsampled report. Possible values are PENDING, COMPLETED, or FAILED. */ + status?: string; + /** Title of the unsampled report. */ + title?: string; + /** Time this unsampled report was last modified. */ + updated?: string; + /** Web property ID to which this unsampled report belongs. The web property ID is of the form UA-XXXXX-YY. */ + webPropertyId?: string; + } + interface UnsampledReports { + /** A list of unsampled reports. */ + items?: UnsampledReport[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this unsampled report collection. */ + nextLink?: string; + /** Link to previous page for this unsampled report collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Upload { + /** Account Id to which this upload belongs. */ + accountId?: string; + /** Custom data source Id to which this data import belongs. */ + customDataSourceId?: string; + /** Data import errors collection. */ + errors?: string[]; + /** A unique ID for this upload. */ + id?: string; + /** Resource type for Analytics upload. */ + kind?: string; + /** Upload status. Possible values: PENDING, COMPLETED, FAILED, DELETING, DELETED. */ + status?: string; + /** Time this file is uploaded. */ + uploadTime?: string; + } + interface Uploads { + /** A list of uploads. */ + items?: Upload[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this upload collection. */ + nextLink?: string; + /** Link to previous page for this upload collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + } + interface UserRef { + /** Email ID of this user. */ + email?: string; + /** User ID. */ + id?: string; + kind?: string; + } + interface WebPropertyRef { + /** Account ID to which this web property belongs. */ + accountId?: string; + /** Link for this web property. */ + href?: string; + /** Web property ID of the form UA-XXXXX-YY. */ + id?: string; + /** Internal ID for this web property. */ + internalWebPropertyId?: string; + /** Analytics web property reference. */ + kind?: string; + /** Name of this web property. */ + name?: string; + } + interface WebPropertySummary { + /** Web property ID of the form UA-XXXXX-YY. */ + id?: string; + /** Internal ID for this web property. */ + internalWebPropertyId?: string; + /** Resource type for Analytics WebPropertySummary. */ + kind?: string; + /** Level for this web property. Possible values are STANDARD or PREMIUM. */ + level?: string; + /** Web property name. */ + name?: string; + /** List of profiles under this web property. */ + profiles?: ProfileSummary[]; + /** Indicates whether this web property is starred or not. */ + starred?: boolean; + /** Website url for this web property. */ + websiteUrl?: string; + } + interface Webproperties { + /** A list of web properties. */ + items?: Webproperty[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this web property collection. */ + nextLink?: string; + /** Link to previous page for this web property collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Webproperty { + /** Account ID to which this web property belongs. */ + accountId?: string; + /** Child link for this web property. Points to the list of views (profiles) for this web property. */ + childLink?: { + /** Link to the list of views (profiles) for this web property. */ + href?: string; + /** Type of the parent link. Its value is "analytics#profiles". */ + type?: string; + }; + /** Time this web property was created. */ + created?: string; + /** Default view (profile) ID. */ + defaultProfileId?: string; + /** Web property ID of the form UA-XXXXX-YY. */ + id?: string; + /** The industry vertical/category selected for this web property. */ + industryVertical?: string; + /** Internal ID for this web property. */ + internalWebPropertyId?: string; + /** Resource type for Analytics WebProperty. */ + kind?: string; + /** Level for this web property. Possible values are STANDARD or PREMIUM. */ + level?: string; + /** Name of this web property. */ + name?: string; + /** Parent link for this web property. Points to the account to which this web property belongs. */ + parentLink?: { + /** Link to the account for this web property. */ + href?: string; + /** Type of the parent link. Its value is "analytics#account". */ + type?: string; + }; + /** Permissions the user has for this web property. */ + permissions?: { + /** + * All the permissions that the user has for this web property. These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions + * from the parent account. + */ + effective?: string[]; + }; + /** View (Profile) count for this web property. */ + profileCount?: number; + /** Link for this web property. */ + selfLink?: string; + /** Indicates whether this web property is starred or not. */ + starred?: boolean; + /** Time this web property was last modified. */ + updated?: string; + /** Website url for this web property. */ + websiteUrl?: string; + } + interface GaResource { + /** Returns Analytics data for a view (profile). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. */ + dimensions?: string; + /** + * End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is yesterday. + */ + "end-date": string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** A comma-separated list of dimension or metric filters to be applied to Analytics data. */ + filters?: string; + /** Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. */ + ids: string; + /** The response will include empty rows if this parameter is set to true, the default is true */ + "include-empty-rows"?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of entries to include in this feed. */ + "max-results"?: number; + /** A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified. */ + metrics: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The selected format for the response. Default format is JSON. */ + output?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The desired sampling level. */ + samplingLevel?: string; + /** An Analytics segment to be applied to data. */ + segment?: string; + /** A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. */ + sort?: string; + /** + * Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is 7daysAgo. + */ + "start-date": string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface McfResource { + /** Returns Analytics Multi-Channel Funnels data for a view (profile). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. */ + dimensions?: string; + /** + * End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is 7daysAgo. + */ + "end-date": string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** A comma-separated list of dimension or metric filters to be applied to the Analytics data. */ + filters?: string; + /** Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. */ + ids: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of entries to include in this feed. */ + "max-results"?: number; + /** A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. */ + metrics: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The desired sampling level. */ + samplingLevel?: string; + /** A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. */ + sort?: string; + /** + * Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is 7daysAgo. + */ + "start-date": string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RealtimeResource { + /** Returns real time data for a view (profile). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'. */ + dimensions?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** A comma-separated list of dimension or metric filters to be applied to real time data. */ + filters?: string; + /** Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. */ + ids: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of entries to include in this feed. */ + "max-results"?: number; + /** A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified. */ + metrics: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A comma-separated list of dimensions or metrics that determine the sort order for real time data. */ + sort?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DataResource { + ga: GaResource; + mcf: McfResource; + realtime: RealtimeResource; + } + interface AccountSummariesResource { + /** Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of account summaries to include in this response, where the largest acceptable value is 1000. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountUserLinksResource { + /** Removes a user from the given account. */ + delete(request: { + /** Account ID to delete the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to delete the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds a new user to the given account. */ + insert(request: { + /** Account ID to create the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists account-user links for a given account. */ + list(request: { + /** Account ID to retrieve the user links for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of account-user links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates permissions for an existing user on the given account. */ + update(request: { + /** Account ID to update the account-user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to update the account-user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Lists all accounts to which the user has access. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomDataSourcesResource { + /** List custom data sources to which the user has access. */ + list(request: { + /** Account Id for the custom data sources to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom data sources to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the custom data sources to retrieve. */ + webPropertyId: string; + }): Request; + } + interface CustomDimensionsResource { + /** Get a custom dimension to which the user has access. */ + get(request: { + /** Account ID for the custom dimension to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The ID of the custom dimension to retrieve. */ + customDimensionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to retrieve. */ + webPropertyId: string; + }): Request; + /** Create a new custom dimension. */ + insert(request: { + /** Account ID for the custom dimension to create. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to create. */ + webPropertyId: string; + }): Request; + /** Lists custom dimensions to which the user has access. */ + list(request: { + /** Account ID for the custom dimensions to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom dimensions to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimensions to retrieve. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom dimension. This method supports patch semantics. */ + patch(request: { + /** Account ID for the custom dimension to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom dimension ID for the custom dimension to update. */ + customDimensionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to update. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom dimension. */ + update(request: { + /** Account ID for the custom dimension to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom dimension ID for the custom dimension to update. */ + customDimensionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to update. */ + webPropertyId: string; + }): Request; + } + interface CustomMetricsResource { + /** Get a custom metric to which the user has access. */ + get(request: { + /** Account ID for the custom metric to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The ID of the custom metric to retrieve. */ + customMetricId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metric to retrieve. */ + webPropertyId: string; + }): Request; + /** Create a new custom metric. */ + insert(request: { + /** Account ID for the custom metric to create. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to create. */ + webPropertyId: string; + }): Request; + /** Lists custom metrics to which the user has access. */ + list(request: { + /** Account ID for the custom metrics to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom metrics to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metrics to retrieve. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom metric. This method supports patch semantics. */ + patch(request: { + /** Account ID for the custom metric to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom metric ID for the custom metric to update. */ + customMetricId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metric to update. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom metric. */ + update(request: { + /** Account ID for the custom metric to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom metric ID for the custom metric to update. */ + customMetricId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metric to update. */ + webPropertyId: string; + }): Request; + } + interface ExperimentsResource { + /** Delete an experiment. */ + delete(request: { + /** Account ID to which the experiment belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** ID of the experiment to delete */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to which the experiment belongs */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the experiment belongs */ + webPropertyId: string; + }): Request; + /** Returns an experiment to which the user has access. */ + get(request: { + /** Account ID to retrieve the experiment for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Experiment ID to retrieve the experiment for. */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve the experiment for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the experiment for. */ + webPropertyId: string; + }): Request; + /** Create a new experiment. */ + insert(request: { + /** Account ID to create the experiment for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the experiment for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the experiment for. */ + webPropertyId: string; + }): Request; + /** Lists experiments to which the user has access. */ + list(request: { + /** Account ID to retrieve experiments for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of experiments to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve experiments for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve experiments for. */ + webPropertyId: string; + }): Request; + /** Update an existing experiment. This method supports patch semantics. */ + patch(request: { + /** Account ID of the experiment to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Experiment ID of the experiment to update. */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID of the experiment to update. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID of the experiment to update. */ + webPropertyId: string; + }): Request; + /** Update an existing experiment. */ + update(request: { + /** Account ID of the experiment to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Experiment ID of the experiment to update. */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID of the experiment to update. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID of the experiment to update. */ + webPropertyId: string; + }): Request; + } + interface FiltersResource { + /** Delete a filter. */ + delete(request: { + /** Account ID to delete the filter for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the filter to be deleted. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a filters to which the user has access. */ + get(request: { + /** Account ID to retrieve filters for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filter ID to retrieve filters for. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Create a new filter. */ + insert(request: { + /** Account ID to create filter for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all filters for an account */ + list(request: { + /** Account ID to retrieve filters for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of filters to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing filter. This method supports patch semantics. */ + patch(request: { + /** Account ID to which the filter belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the filter to be updated. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing filter. */ + update(request: { + /** Account ID to which the filter belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the filter to be updated. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GoalsResource { + /** Gets a goal to which the user has access. */ + get(request: { + /** Account ID to retrieve the goal for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Goal ID to retrieve the goal for. */ + goalId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve the goal for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the goal for. */ + webPropertyId: string; + }): Request; + /** Create a new goal. */ + insert(request: { + /** Account ID to create the goal for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the goal for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the goal for. */ + webPropertyId: string; + }): Request; + /** Lists goals to which the user has access. */ + list(request: { + /** Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of goals to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has + * access to. + */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access + * to. + */ + webPropertyId: string; + }): Request; + /** Updates an existing goal. This method supports patch semantics. */ + patch(request: { + /** Account ID to update the goal. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Index of the goal to be updated. */ + goalId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to update the goal. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to update the goal. */ + webPropertyId: string; + }): Request; + /** Updates an existing goal. */ + update(request: { + /** Account ID to update the goal. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Index of the goal to be updated. */ + goalId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to update the goal. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to update the goal. */ + webPropertyId: string; + }): Request; + } + interface ProfileFilterLinksResource { + /** Delete a profile filter link. */ + delete(request: { + /** Account ID to which the profile filter link belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link to delete. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to which the filter link belongs. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to which the profile filter link belongs. */ + webPropertyId: string; + }): Request; + /** Returns a single profile filter link. */ + get(request: { + /** Account ID to retrieve profile filter link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to retrieve filter link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to retrieve profile filter link for. */ + webPropertyId: string; + }): Request; + /** Create a new profile filter link. */ + insert(request: { + /** Account ID to create profile filter link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to create filter link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to create profile filter link for. */ + webPropertyId: string; + }): Request; + /** Lists all profile filter links for a profile. */ + list(request: { + /** Account ID to retrieve profile filter links for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of profile filter links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has + * access to. + */ + webPropertyId: string; + }): Request; + /** Update an existing profile filter link. This method supports patch semantics. */ + patch(request: { + /** Account ID to which profile filter link belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link to be updated. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to which filter link belongs */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to which profile filter link belongs */ + webPropertyId: string; + }): Request; + /** Update an existing profile filter link. */ + update(request: { + /** Account ID to which profile filter link belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link to be updated. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to which filter link belongs */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to which profile filter link belongs */ + webPropertyId: string; + }): Request; + } + interface ProfileUserLinksResource { + /** Removes a user from the given view (profile). */ + delete(request: { + /** Account ID to delete the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to delete the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to delete the user link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to delete the user link for. */ + webPropertyId: string; + }): Request; + /** Adds a new user to the given view (profile). */ + insert(request: { + /** Account ID to create the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the user link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to create the user link for. */ + webPropertyId: string; + }): Request; + /** Lists profile-user links for a given view (profile). */ + list(request: { + /** Account ID which the given view (profile) belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of profile-user links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has + * access to. + */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties + * that user has access to. + */ + webPropertyId: string; + }): Request; + /** Updates permissions for an existing user on the given view (profile). */ + update(request: { + /** Account ID to update the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to update the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile ID) to update the user link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to update the user link for. */ + webPropertyId: string; + }): Request; + } + interface ProfilesResource { + /** Deletes a view (profile). */ + delete(request: { + /** Account ID to delete the view (profile) for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the view (profile) to be deleted. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to delete the view (profile) for. */ + webPropertyId: string; + }): Request; + /** Gets a view (profile) to which the user has access. */ + get(request: { + /** Account ID to retrieve the view (profile) for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve the view (profile) for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the view (profile) for. */ + webPropertyId: string; + }): Request; + /** Create a new view (profile). */ + insert(request: { + /** Account ID to create the view (profile) for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the view (profile) for. */ + webPropertyId: string; + }): Request; + /** Lists views (profiles) to which the user has access. */ + list(request: { + /** + * Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has + * access. + */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of views (profiles) to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to + * which the user has access. + */ + webPropertyId: string; + }): Request; + /** Updates an existing view (profile). This method supports patch semantics. */ + patch(request: { + /** Account ID to which the view (profile) belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the view (profile) to be updated. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the view (profile) belongs */ + webPropertyId: string; + }): Request; + /** Updates an existing view (profile). */ + update(request: { + /** Account ID to which the view (profile) belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the view (profile) to be updated. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the view (profile) belongs */ + webPropertyId: string; + }): Request; + } + interface RemarketingAudienceResource { + /** Delete a remarketing audience. */ + delete(request: { + /** Account ID to which the remarketing audience belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to delete. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the remarketing audience belongs. */ + webPropertyId: string; + }): Request; + /** Gets a remarketing audience to which the user has access. */ + get(request: { + /** The account ID of the remarketing audience to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to retrieve. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audience to retrieve. */ + webPropertyId: string; + }): Request; + /** Creates a new remarketing audience. */ + insert(request: { + /** The account ID for which to create the remarketing audience. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for which to create the remarketing audience. */ + webPropertyId: string; + }): Request; + /** Lists remarketing audiences to which the user has access. */ + list(request: { + /** The account ID of the remarketing audiences to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of remarketing audiences to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audiences to retrieve. */ + webPropertyId: string; + }): Request; + /** Updates an existing remarketing audience. This method supports patch semantics. */ + patch(request: { + /** The account ID of the remarketing audience to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to update. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audience to update. */ + webPropertyId: string; + }): Request; + /** Updates an existing remarketing audience. */ + update(request: { + /** The account ID of the remarketing audience to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to update. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audience to update. */ + webPropertyId: string; + }): Request; + } + interface SegmentsResource { + /** Lists segments to which the user has access. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of segments to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UnsampledReportsResource { + /** Deletes an unsampled report. */ + delete(request: { + /** Account ID to delete the unsampled report for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to delete the unsampled report for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the unsampled report to be deleted. */ + unsampledReportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to delete the unsampled reports for. */ + webPropertyId: string; + }): Request; + /** Returns a single unsampled report. */ + get(request: { + /** Account ID to retrieve unsampled report for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve unsampled report for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the unsampled report to retrieve. */ + unsampledReportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve unsampled reports for. */ + webPropertyId: string; + }): Request; + /** Create a new unsampled report. */ + insert(request: { + /** Account ID to create the unsampled report for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the unsampled report for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the unsampled report for. */ + webPropertyId: string; + }): Request; + /** Lists unsampled reports to which the user has access. */ + list(request: { + /** Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of unsampled reports to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported. */ + webPropertyId: string; + }): Request; + } + interface UploadsResource { + /** Delete data associated with a previous upload. */ + deleteUploadData(request: { + /** Account Id for the uploads to be deleted. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id for the uploads to be deleted. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the uploads to be deleted. */ + webPropertyId: string; + }): Request; + /** List uploads to which the user has access. */ + get(request: { + /** Account Id for the upload to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id for upload to retrieve. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Upload Id to retrieve. */ + uploadId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the upload to retrieve. */ + webPropertyId: string; + }): Request; + /** List uploads to which the user has access. */ + list(request: { + /** Account Id for the uploads to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id for uploads to retrieve. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of uploads to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the uploads to retrieve. */ + webPropertyId: string; + }): Request; + /** Upload data for a custom data source. */ + uploadData(request: { + /** Account Id associated with the upload. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id to which the data being uploaded belongs. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property UA-string associated with the upload. */ + webPropertyId: string; + }): Request; + } + interface WebPropertyAdWordsLinksResource { + /** Deletes a web property-AdWords link. */ + delete(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to delete the AdWords link for. */ + webPropertyId: string; + }): Request; + /** Returns a web property-AdWords link to which the user has access. */ + get(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property-AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to retrieve the AdWords link for. */ + webPropertyId: string; + }): Request; + /** Creates a webProperty-AdWords link. */ + insert(request: { + /** ID of the Google Analytics account to create the link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the link for. */ + webPropertyId: string; + }): Request; + /** Lists webProperty-AdWords links for a given web property. */ + list(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of webProperty-AdWords links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first webProperty-AdWords link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the AdWords links for. */ + webPropertyId: string; + }): Request; + /** Updates an existing webProperty-AdWords link. This method supports patch semantics. */ + patch(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property-AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to retrieve the AdWords link for. */ + webPropertyId: string; + }): Request; + /** Updates an existing webProperty-AdWords link. */ + update(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property-AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to retrieve the AdWords link for. */ + webPropertyId: string; + }): Request; + } + interface WebpropertiesResource { + /** Gets a web property to which the user has access. */ + get(request: { + /** Account ID to retrieve the web property for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID to retrieve the web property for. */ + webPropertyId: string; + }): Request; + /** + * Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at + * least one profile. + */ + insert(request: { + /** Account ID to create the web property for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists web properties to which the user has access. */ + list(request: { + /** Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of web properties to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing web property. This method supports patch semantics. */ + patch(request: { + /** Account ID to which the web property belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID */ + webPropertyId: string; + }): Request; + /** Updates an existing web property. */ + update(request: { + /** Account ID to which the web property belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID */ + webPropertyId: string; + }): Request; + } + interface WebpropertyUserLinksResource { + /** Removes a user from the given web property. */ + delete(request: { + /** Account ID to delete the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to delete the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to delete the user link for. */ + webPropertyId: string; + }): Request; + /** Adds a new user to the given web property. */ + insert(request: { + /** Account ID to create the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to create the user link for. */ + webPropertyId: string; + }): Request; + /** Lists webProperty-user links for a given web property. */ + list(request: { + /** Account ID which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of webProperty-user Links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties + * that user has access to. + */ + webPropertyId: string; + }): Request; + /** Updates permissions for an existing user on the given web property. */ + update(request: { + /** Account ID to update the account-user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to update the account-user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to update the account-user link for. */ + webPropertyId: string; + }): Request; + } + interface ManagementResource { + accountSummaries: AccountSummariesResource; + accountUserLinks: AccountUserLinksResource; + accounts: AccountsResource; + customDataSources: CustomDataSourcesResource; + customDimensions: CustomDimensionsResource; + customMetrics: CustomMetricsResource; + experiments: ExperimentsResource; + filters: FiltersResource; + goals: GoalsResource; + profileFilterLinks: ProfileFilterLinksResource; + profileUserLinks: ProfileUserLinksResource; + profiles: ProfilesResource; + remarketingAudience: RemarketingAudienceResource; + segments: SegmentsResource; + unsampledReports: UnsampledReportsResource; + uploads: UploadsResource; + webPropertyAdWordsLinks: WebPropertyAdWordsLinksResource; + webproperties: WebpropertiesResource; + webpropertyUserLinks: WebpropertyUserLinksResource; + } + interface ColumnsResource { + /** Lists all columns for a report type */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API */ + reportType: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetadataResource { + columns: ColumnsResource; + } + interface ProvisioningResource { + /** Creates an account ticket. */ + createAccountTicket(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.analytics/readme.md b/types/gapi.client.analytics/readme.md new file mode 100644 index 0000000000..a5d16c9613 --- /dev/null +++ b/types/gapi.client.analytics/readme.md @@ -0,0 +1,74 @@ +# TypeScript typings for Google Analytics API v3 +Views and manages your Google Analytics data. +For detailed description please check [documentation](https://developers.google.com/analytics/). + +## Installing + +Install typings for Google Analytics API: +``` +npm install @types/gapi.client.analytics@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('analytics', 'v3', () => { + // now we can use gapi.client.analytics + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Google Analytics data + 'https://www.googleapis.com/auth/analytics', + + // Edit Google Analytics management entities + 'https://www.googleapis.com/auth/analytics.edit', + + // Manage Google Analytics Account users by email address + 'https://www.googleapis.com/auth/analytics.manage.users', + + // View Google Analytics user permissions + 'https://www.googleapis.com/auth/analytics.manage.users.readonly', + + // Create a new Google Analytics account along with its default property and view + 'https://www.googleapis.com/auth/analytics.provision', + + // View your Google Analytics data + 'https://www.googleapis.com/auth/analytics.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Analytics API resources: + +```typescript + +/* +Creates an account ticket. +*/ +await gapi.client.provisioning.createAccountTicket({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.analytics/tsconfig.json b/types/gapi.client.analytics/tsconfig.json new file mode 100644 index 0000000000..24b9a3e308 --- /dev/null +++ b/types/gapi.client.analytics/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.analytics-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.analytics/tslint.json b/types/gapi.client.analytics/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.analytics/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.analyticsreporting/gapi.client.analyticsreporting-tests.ts b/types/gapi.client.analyticsreporting/gapi.client.analyticsreporting-tests.ts new file mode 100644 index 0000000000..bacc354694 --- /dev/null +++ b/types/gapi.client.analyticsreporting/gapi.client.analyticsreporting-tests.ts @@ -0,0 +1,37 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('analyticsreporting', 'v4', () => { + /** now we can use gapi.client.analyticsreporting */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics', + /** View your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Returns the Analytics data. */ + await gapi.client.reports.batchGet({ + }); + } +}); diff --git a/types/gapi.client.analyticsreporting/index.d.ts b/types/gapi.client.analyticsreporting/index.d.ts new file mode 100644 index 0000000000..e5e1b7aabe --- /dev/null +++ b/types/gapi.client.analyticsreporting/index.d.ts @@ -0,0 +1,698 @@ +// Type definitions for Google Google Analytics Reporting API v4 4.0 +// Project: https://developers.google.com/analytics/devguides/reporting/core/v4/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://analyticsreporting.googleapis.com/$discovery/rest?version=v4 + +/// + +declare namespace gapi.client { + /** Load Google Analytics Reporting API v4 */ + function load(name: "analyticsreporting", version: "v4"): PromiseLike; + function load(name: "analyticsreporting", version: "v4", callback: () => any): void; + + const reports: analyticsreporting.ReportsResource; + + namespace analyticsreporting { + interface Cohort { + /** + * This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users + * whose first visit date is between start date and end date defined in the + * DateRange. The date ranges should be aligned for cohort requests. If the + * request contains `ga:cohortNthDay` it should be exactly one day long, + * if `ga:cohortNthWeek` it should be aligned to the week boundary (starting + * at Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range + * should be aligned to the month (starting at the first and ending on the + * last day of the month). + * For LTV requests there are no such restrictions. + * You do not need to supply a date range for the + * `reportsRequest.dateRanges` field. + */ + dateRange?: DateRange; + /** + * A unique name for the cohort. If not defined name will be auto-generated + * with values cohort_[1234...]. + */ + name?: string; + /** + * Type of the cohort. The only supported type as of now is + * `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated + * as `FIRST_VISIT_DATE` type cohort. + */ + type?: string; + } + interface CohortGroup { + /** The definition for the cohort. */ + cohorts?: Cohort[]; + /** + * Enable Life Time Value (LTV). LTV measures lifetime value for users + * acquired through different channels. + * Please see: + * [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and + * [Lifetime Value](https://support.google.com/analytics/answer/6182550) + * If the value of lifetimeValue is false: + * + * - The metric values are similar to the values in the web interface cohort + * report. + * - The cohort definition date ranges must be aligned to the calendar week + * and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in + * the cohort definition should be a Sunday and the `endDate` should be the + * following Saturday, and for `ga:cohortNthMonth`, the `startDate` + * should be the 1st of the month and `endDate` should be the last day + * of the month. + * + * When the lifetimeValue is true: + * + * - The metric values will correspond to the values in the web interface + * LifeTime value report. + * - The Lifetime Value report shows you how user value (Revenue) and + * engagement (Appviews, Goal Completions, Sessions, and Session Duration) + * grow during the 90 days after a user is acquired. + * - The metrics are calculated as a cumulative average per user per the time + * increment. + * - The cohort definition date ranges need not be aligned to the calendar + * week and month boundaries. + * - The `viewId` must be an + * [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) + */ + lifetimeValue?: boolean; + } + interface ColumnHeader { + /** The dimension names in the response. */ + dimensions?: string[]; + /** Metric headers for the metrics in the response. */ + metricHeader?: MetricHeader; + } + interface DateRange { + /** The end date for the query in the format `YYYY-MM-DD`. */ + endDate?: string; + /** The start date for the query in the format `YYYY-MM-DD`. */ + startDate?: string; + } + interface DateRangeValues { + /** The values of each pivot region. */ + pivotValueRegions?: PivotValueRegion[]; + /** Each value corresponds to each Metric in the request. */ + values?: string[]; + } + interface Dimension { + /** + * If non-empty, we place dimension values into buckets after string to + * int64. Dimension values that are not the string representation of an + * integral value will be converted to zero. The bucket values have to be in + * increasing order. Each bucket is closed on the lower end, and open on the + * upper end. The "first" bucket includes all values less than the first + * boundary, the "last" bucket includes all values up to infinity. Dimension + * values that fall in a bucket get transformed to a new dimension value. For + * example, if one gives a list of "0, 1, 3, 4, 7", then we return the + * following buckets: + * + * - bucket #1: values < 0, dimension value "<0" + * - bucket #2: values in [0,1), dimension value "0" + * - bucket #3: values in [1,3), dimension value "1-2" + * - bucket #4: values in [3,4), dimension value "3" + * - bucket #5: values in [4,7), dimension value "4-6" + * - bucket #6: values >= 7, dimension value "7+" + * + * NOTE: If you are applying histogram mutation on any dimension, and using + * that dimension in sort, you will want to use the sort type + * `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values + * will be sorted according to dictionary + * (lexicographic) order. For example the ascending dictionary order is: + * + * "<50", "1001+", "121-1000", "50-120" + * + * And the ascending `HISTOGRAM_BUCKET` order is: + * + * "<50", "50-120", "121-1000", "1001+" + * + * The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"` + * for a histogram-mutated dimension. + */ + histogramBuckets?: string[]; + /** Name of the dimension to fetch, for example `ga:browser`. */ + name?: string; + } + interface DimensionFilter { + /** Should the match be case sensitive? Default is false. */ + caseSensitive?: boolean; + /** The dimension to filter on. A DimensionFilter must contain a dimension. */ + dimensionName?: string; + /** + * Strings or regular expression to match against. Only the first value of + * the list is used for comparison unless the operator is `IN_LIST`. + * If `IN_LIST` operator, then the entire list is used to filter the + * dimensions as explained in the description of the `IN_LIST` operator. + */ + expressions?: string[]; + /** + * Logical `NOT` operator. If this boolean is set to true, then the matching + * dimension values will be excluded in the report. The default is false. + */ + not?: boolean; + /** How to match the dimension to the expression. The default is REGEXP. */ + operator?: string; + } + interface DimensionFilterClause { + /** + * The repeated set of filters. They are logically combined based on the + * operator specified. + */ + filters?: DimensionFilter[]; + /** + * The operator for combining multiple dimension filters. If unspecified, it + * is treated as an `OR`. + */ + operator?: string; + } + interface DynamicSegment { + /** The name of the dynamic segment. */ + name?: string; + /** Session Segment to select sessions to include in the segment. */ + sessionSegment?: SegmentDefinition; + /** User Segment to select users to include in the segment. */ + userSegment?: SegmentDefinition; + } + interface GetReportsRequest { + /** + * Requests, each request will have a separate response. + * There can be a maximum of 5 requests. All requests should have the same + * `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. + */ + reportRequests?: ReportRequest[]; + } + interface GetReportsResponse { + /** Responses corresponding to each of the request. */ + reports?: Report[]; + } + interface Metric { + /** + * An alias for the metric expression is an alternate name for the + * expression. The alias can be used for filtering and sorting. This field + * is optional and is useful if the expression is not a single metric but + * a complex expression which cannot be used in filtering and sorting. + * The alias is also used in the response column header. + */ + alias?: string; + /** + * A metric expression in the request. An expression is constructed from one + * or more metrics and numbers. Accepted operators include: Plus (+), Minus + * (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, + * Positive cardinal numbers (0-9), can include decimals and is limited to + * 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the + * metric expression is just a single metric name like `ga:users`. + * Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics + * will result in unexpected results. + */ + expression?: string; + /** + * Specifies how the metric expression should be formatted, for example + * `INTEGER`. + */ + formattingType?: string; + } + interface MetricFilter { + /** The value to compare against. */ + comparisonValue?: string; + /** + * The metric that will be filtered on. A metricFilter must contain a metric + * name. A metric name can be an alias earlier defined as a metric or it can + * also be a metric expression. + */ + metricName?: string; + /** + * Logical `NOT` operator. If this boolean is set to true, then the matching + * metric values will be excluded in the report. The default is false. + */ + not?: boolean; + /** + * Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the + * comparisonValue, the default is `EQUAL`. If the operator is + * `IS_MISSING`, checks if the metric is missing and would ignore the + * comparisonValue. + */ + operator?: string; + } + interface MetricFilterClause { + /** + * The repeated set of filters. They are logically combined based on the + * operator specified. + */ + filters?: MetricFilter[]; + /** + * The operator for combining multiple metric filters. If unspecified, it is + * treated as an `OR`. + */ + operator?: string; + } + interface MetricHeader { + /** Headers for the metrics in the response. */ + metricHeaderEntries?: MetricHeaderEntry[]; + /** Headers for the pivots in the response. */ + pivotHeaders?: PivotHeader[]; + } + interface MetricHeaderEntry { + /** The name of the header. */ + name?: string; + /** The type of the metric, for example `INTEGER`. */ + type?: string; + } + interface OrFiltersForSegment { + /** List of segment filters to be combined with a `OR` operator. */ + segmentFilterClauses?: SegmentFilterClause[]; + } + interface OrderBy { + /** + * The field which to sort by. The default sort order is ascending. Example: + * `ga:browser`. + * Note, that you can only specify one field for sort here. For example, + * `ga:browser, ga:city` is not valid. + */ + fieldName?: string; + /** The order type. The default orderType is `VALUE`. */ + orderType?: string; + /** The sorting order for the field. */ + sortOrder?: string; + } + interface Pivot { + /** + * DimensionFilterClauses are logically combined with an `AND` operator: only + * data that is included by all these DimensionFilterClauses contributes to + * the values in this pivot region. Dimension filters can be used to restrict + * the columns shown in the pivot region. For example if you have + * `ga:browser` as the requested dimension in the pivot region, and you + * specify key filters to restrict `ga:browser` to only "IE" or "Firefox", + * then only those two browsers would show up as columns. + */ + dimensionFilterClauses?: DimensionFilterClause[]; + /** + * A list of dimensions to show as pivot columns. A Pivot can have a maximum + * of 4 dimensions. Pivot dimensions are part of the restriction on the + * total number of dimensions allowed in the request. + */ + dimensions?: Dimension[]; + /** + * Specifies the maximum number of groups to return. + * The default value is 10, also the maximum value is 1,000. + */ + maxGroupCount?: number; + /** + * The pivot metrics. Pivot metrics are part of the + * restriction on total number of metrics allowed in the request. + */ + metrics?: Metric[]; + /** + * If k metrics were requested, then the response will contain some + * data-dependent multiple of k columns in the report. E.g., if you pivoted + * on the dimension `ga:browser` then you'd get k columns for "Firefox", k + * columns for "IE", k columns for "Chrome", etc. The ordering of the groups + * of columns is determined by descending order of "total" for the first of + * the k values. Ties are broken by lexicographic ordering of the first + * pivot dimension, then lexicographic ordering of the second pivot + * dimension, and so on. E.g., if the totals for the first value for + * Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns + * would be Chrome, Firefox, IE. + * + * The following let you choose which of the groups of k columns are + * included in the response. + */ + startGroup?: number; + } + interface PivotHeader { + /** A single pivot section header. */ + pivotHeaderEntries?: PivotHeaderEntry[]; + /** The total number of groups for this pivot. */ + totalPivotGroupsCount?: number; + } + interface PivotHeaderEntry { + /** The name of the dimensions in the pivot response. */ + dimensionNames?: string[]; + /** The values for the dimensions in the pivot. */ + dimensionValues?: string[]; + /** The metric header for the metric in the pivot. */ + metric?: MetricHeaderEntry; + } + interface PivotValueRegion { + /** The values of the metrics in each of the pivot regions. */ + values?: string[]; + } + interface Report { + /** The column headers. */ + columnHeader?: ColumnHeader; + /** Response data. */ + data?: ReportData; + /** Page token to retrieve the next page of results in the list. */ + nextPageToken?: string; + } + interface ReportData { + /** + * The last time the data in the report was refreshed. All the hits received + * before this timestamp are included in the calculation of the report. + */ + dataLastRefreshed?: string; + /** + * Indicates if response to this request is golden or not. Data is + * golden when the exact same request will not produce any new results if + * asked at a later point in time. + */ + isDataGolden?: boolean; + /** + * Minimum and maximum values seen over all matching rows. These are both + * empty when `hideValueRanges` in the request is false, or when + * rowCount is zero. + */ + maximums?: DateRangeValues[]; + /** + * Minimum and maximum values seen over all matching rows. These are both + * empty when `hideValueRanges` in the request is false, or when + * rowCount is zero. + */ + minimums?: DateRangeValues[]; + /** Total number of matching rows for this query. */ + rowCount?: number; + /** There's one ReportRow for every unique combination of dimensions. */ + rows?: ReportRow[]; + /** + * If the results are + * [sampled](https://support.google.com/analytics/answer/2637192), + * this returns the total number of samples read, one entry per date range. + * If the results are not sampled this field will not be defined. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplesReadCounts?: string[]; + /** + * If the results are + * [sampled](https://support.google.com/analytics/answer/2637192), + * this returns the total number of + * samples present, one entry per date range. If the results are not sampled + * this field will not be defined. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplingSpaceSizes?: string[]; + /** + * For each requested date range, for the set of all rows that match + * the query, every requested value format gets a total. The total + * for a value format is computed by first totaling the metrics + * mentioned in the value format and then evaluating the value + * format as a scalar expression. E.g., The "totals" for + * `3 / (ga:sessions + 2)` we compute + * `3 / ((sum of all relevant ga:sessions) + 2)`. + * Totals are computed before pagination. + */ + totals?: DateRangeValues[]; + } + interface ReportRequest { + /** + * Cohort group associated with this request. If there is a cohort group + * in the request the `ga:cohort` dimension must be present. + * Every [ReportRequest](#ReportRequest) within a `batchGet` method must + * contain the same `cohortGroup` definition. + */ + cohortGroup?: CohortGroup; + /** + * Date ranges in the request. The request can have a maximum of 2 date + * ranges. The response will contain a set of metric values for each + * combination of the dimensions for each date range in the request. So, if + * there are two date ranges, there will be two set of metric values, one for + * the original date range and one for the second date range. + * The `reportRequest.dateRanges` field should not be specified for cohorts + * or Lifetime value requests. + * If a date range is not provided, the default date range is (startDate: + * current date - 7 days, endDate: current date - 1 day). Every + * [ReportRequest](#ReportRequest) within a `batchGet` method must + * contain the same `dateRanges` definition. + */ + dateRanges?: DateRange[]; + /** + * The dimension filter clauses for filtering Dimension Values. They are + * logically combined with the `AND` operator. Note that filtering occurs + * before any dimensions are aggregated, so that the returned metrics + * represent the total for only the relevant dimensions. + */ + dimensionFilterClauses?: DimensionFilterClause[]; + /** + * The dimensions requested. + * Requests can have a total of 7 dimensions. + */ + dimensions?: Dimension[]; + /** + * Dimension or metric filters that restrict the data returned for your + * request. To use the `filtersExpression`, supply a dimension or metric on + * which to filter, followed by the filter expression. For example, the + * following expression selects `ga:browser` dimension which starts with + * Firefox; `ga:browser=~^Firefox`. For more information on dimensions + * and metric filters, see + * [Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). + */ + filtersExpression?: string; + /** + * If set to true, hides the total of all metrics for all the matching rows, + * for every date range. The default false and will return the totals. + */ + hideTotals?: boolean; + /** + * If set to true, hides the minimum and maximum across all matching rows. + * The default is false and the value ranges are returned. + */ + hideValueRanges?: boolean; + /** + * If set to false, the response does not include rows if all the retrieved + * metrics are equal to zero. The default is false which will exclude these + * rows. + */ + includeEmptyRows?: boolean; + /** + * The metric filter clauses. They are logically combined with the `AND` + * operator. Metric filters look at only the first date range and not the + * comparing date range. Note that filtering on metrics occurs after the + * metrics are aggregated. + */ + metricFilterClauses?: MetricFilterClause[]; + /** + * The metrics requested. + * Requests must specify at least one metric. Requests can have a + * total of 10 metrics. + */ + metrics?: Metric[]; + /** + * Sort order on output rows. To compare two rows, the elements of the + * following are applied in order until a difference is found. All date + * ranges in the output get the same row order. + */ + orderBys?: OrderBy[]; + /** + * Page size is for paging and specifies the maximum number of returned rows. + * Page size should be >= 0. A query returns the default of 1,000 rows. + * The Analytics Core Reporting API returns a maximum of 10,000 rows per + * request, no matter how many you ask for. It can also return fewer rows + * than requested, if there aren't as many dimension segments as you expect. + * For instance, there are fewer than 300 possible values for `ga:country`, + * so when segmenting only by country, you can't get more than 300 rows, + * even if you set `pageSize` to a higher value. + */ + pageSize?: number; + /** + * A continuation token to get the next page of the results. Adding this to + * the request will return the rows after the pageToken. The pageToken should + * be the value returned in the nextPageToken parameter in the response to + * the GetReports request. + */ + pageToken?: string; + /** The pivot definitions. Requests can have a maximum of 2 pivots. */ + pivots?: Pivot[]; + /** + * The desired report + * [sample](https://support.google.com/analytics/answer/2637192) size. + * If the the `samplingLevel` field is unspecified the `DEFAULT` sampling + * level is used. Every [ReportRequest](#ReportRequest) within a + * `batchGet` method must contain the same `samplingLevel` definition. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplingLevel?: string; + /** + * Segment the data returned for the request. A segment definition helps look + * at a subset of the segment request. A request can contain up to four + * segments. Every [ReportRequest](#ReportRequest) within a + * `batchGet` method must contain the same `segments` definition. Requests + * with segments must have the `ga:segment` dimension. + */ + segments?: Segment[]; + /** + * The Analytics + * [view ID](https://support.google.com/analytics/answer/1009618) + * from which to retrieve data. Every [ReportRequest](#ReportRequest) + * within a `batchGet` method must contain the same `viewId`. + */ + viewId?: string; + } + interface ReportRow { + /** List of requested dimensions. */ + dimensions?: string[]; + /** List of metrics for each requested DateRange. */ + metrics?: DateRangeValues[]; + } + interface Segment { + /** A dynamic segment definition in the request. */ + dynamicSegment?: DynamicSegment; + /** The segment ID of a built-in or custom segment, for example `gaid::-3`. */ + segmentId?: string; + } + interface SegmentDefinition { + /** + * A segment is defined by a set of segment filters which are combined + * together with a logical `AND` operation. + */ + segmentFilters?: SegmentFilter[]; + } + interface SegmentDimensionFilter { + /** Should the match be case sensitive, ignored for `IN_LIST` operator. */ + caseSensitive?: boolean; + /** Name of the dimension for which the filter is being applied. */ + dimensionName?: string; + /** The list of expressions, only the first element is used for all operators */ + expressions?: string[]; + /** Maximum comparison values for `BETWEEN` match type. */ + maxComparisonValue?: string; + /** Minimum comparison values for `BETWEEN` match type. */ + minComparisonValue?: string; + /** The operator to use to match the dimension with the expressions. */ + operator?: string; + } + interface SegmentFilter { + /** + * If true, match the complement of simple or sequence segment. + * For example, to match all visits not from "New York", we can define the + * segment as follows: + * + * "sessionSegment": { + * "segmentFilters": [{ + * "simpleSegment" :{ + * "orFiltersForSegment": [{ + * "segmentFilterClauses":[{ + * "dimensionFilter": { + * "dimensionName": "ga:city", + * "expressions": ["New York"] + * } + * }] + * }] + * }, + * "not": "True" + * }] + * }, + */ + not?: boolean; + /** + * Sequence conditions consist of one or more steps, where each step is + * defined by one or more dimension/metric conditions. Multiple steps can + * be combined with special sequence operators. + */ + sequenceSegment?: SequenceSegment; + /** + * A Simple segment conditions consist of one or more dimension/metric + * conditions that can be combined + */ + simpleSegment?: SimpleSegment; + } + interface SegmentFilterClause { + /** Dimension Filter for the segment definition. */ + dimensionFilter?: SegmentDimensionFilter; + /** Metric Filter for the segment definition. */ + metricFilter?: SegmentMetricFilter; + /** Matches the complement (`!`) of the filter. */ + not?: boolean; + } + interface SegmentMetricFilter { + /** + * The value to compare against. If the operator is `BETWEEN`, this value is + * treated as minimum comparison value. + */ + comparisonValue?: string; + /** Max comparison value is only used for `BETWEEN` operator. */ + maxComparisonValue?: string; + /** + * The metric that will be filtered on. A `metricFilter` must contain a + * metric name. + */ + metricName?: string; + /** + * Specifies is the operation to perform to compare the metric. The default + * is `EQUAL`. + */ + operator?: string; + /** + * Scope for a metric defines the level at which that metric is defined. The + * specified metric scope must be equal to or greater than its primary scope + * as defined in the data model. The primary scope is defined by if the + * segment is selecting users or sessions. + */ + scope?: string; + } + interface SegmentSequenceStep { + /** + * Specifies if the step immediately precedes or can be any time before the + * next step. + */ + matchType?: string; + /** + * A sequence is specified with a list of Or grouped filters which are + * combined with `AND` operator. + */ + orFiltersForSegment?: OrFiltersForSegment[]; + } + interface SequenceSegment { + /** + * If set, first step condition must match the first hit of the visitor (in + * the date range). + */ + firstStepShouldMatchFirstHit?: boolean; + /** The list of steps in the sequence. */ + segmentSequenceSteps?: SegmentSequenceStep[]; + } + interface SimpleSegment { + /** + * A list of segment filters groups which are combined with logical `AND` + * operator. + */ + orFiltersForSegment?: OrFiltersForSegment[]; + } + interface ReportsResource { + /** Returns the Analytics data. */ + batchGet(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.analyticsreporting/readme.md b/types/gapi.client.analyticsreporting/readme.md new file mode 100644 index 0000000000..96b09af1b4 --- /dev/null +++ b/types/gapi.client.analyticsreporting/readme.md @@ -0,0 +1,62 @@ +# TypeScript typings for Google Analytics Reporting API v4 +Accesses Analytics report data. +For detailed description please check [documentation](https://developers.google.com/analytics/devguides/reporting/core/v4/). + +## Installing + +Install typings for Google Analytics Reporting API: +``` +npm install @types/gapi.client.analyticsreporting@v4 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('analyticsreporting', 'v4', () => { + // now we can use gapi.client.analyticsreporting + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Google Analytics data + 'https://www.googleapis.com/auth/analytics', + + // View your Google Analytics data + 'https://www.googleapis.com/auth/analytics.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Analytics Reporting API resources: + +```typescript + +/* +Returns the Analytics data. +*/ +await gapi.client.reports.batchGet({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.analyticsreporting/tsconfig.json b/types/gapi.client.analyticsreporting/tsconfig.json new file mode 100644 index 0000000000..2f65484898 --- /dev/null +++ b/types/gapi.client.analyticsreporting/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.analyticsreporting-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.analyticsreporting/tslint.json b/types/gapi.client.analyticsreporting/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.analyticsreporting/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androiddeviceprovisioning/gapi.client.androiddeviceprovisioning-tests.ts b/types/gapi.client.androiddeviceprovisioning/gapi.client.androiddeviceprovisioning-tests.ts new file mode 100644 index 0000000000..b2c1cac362 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/gapi.client.androiddeviceprovisioning-tests.ts @@ -0,0 +1,24 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androiddeviceprovisioning', 'v1', () => { + /** now we can use gapi.client.androiddeviceprovisioning */ + + run(); + }); + + async function run() { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + } +}); diff --git a/types/gapi.client.androiddeviceprovisioning/index.d.ts b/types/gapi.client.androiddeviceprovisioning/index.d.ts new file mode 100644 index 0000000000..0b896d6fbb --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/index.d.ts @@ -0,0 +1,683 @@ +// Type definitions for Google Android Device Provisioning Partner API v1 1.0 +// Project: https://developers.google.com/zero-touch/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://androiddeviceprovisioning.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Android Device Provisioning Partner API v1 */ + function load(name: "androiddeviceprovisioning", version: "v1"): PromiseLike; + function load(name: "androiddeviceprovisioning", version: "v1", callback: () => any): void; + + const operations: androiddeviceprovisioning.OperationsResource; + + const partners: androiddeviceprovisioning.PartnersResource; + + namespace androiddeviceprovisioning { + interface ClaimDeviceRequest { + /** The customer to claim for. */ + customerId?: string; + /** The device identifier of the device to claim. */ + deviceIdentifier?: DeviceIdentifier; + /** The section to claim. */ + sectionType?: string; + } + interface ClaimDeviceResponse { + /** The device ID of the claimed device. */ + deviceId?: string; + /** + * The resource name of the device in the format + * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + */ + deviceName?: string; + } + interface ClaimDevicesRequest { + /** List of claims. */ + claims?: PartnerClaim[]; + } + interface Company { + /** + * Input only. Optional. Email address of customer's users in the admin role. + * Each email address must be associated with a Google Account. + */ + adminEmails?: string[]; + /** Output only. The ID of the company. Assigned by the server. */ + companyId?: string; + /** + * Required. The name of the company. For example _XYZ Corp_. Characters + * allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to the + * customer's employees in the zero-touch enrollment portal. + */ + companyName?: string; + /** + * Output only. The API resource name of the company in the format + * `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server. + */ + name?: string; + /** + * Input only. Email address of customer's users in the owner role. At least + * one `owner_email` is required. Each email address must be associated with a + * Google Account. Owners share the same access as admins but can also add, + * delete, and edit your organization's portal users. + */ + ownerEmails?: string[]; + } + interface CreateCustomerRequest { + /** + * Required. The company data to populate the new customer. Must contain a + * value for `companyName` and at least one `owner_email` that's associated + * with a Google Account. The values for `companyId` and `name` must be empty. + */ + customer?: Company; + } + interface Device { + /** Claims. */ + claims?: DeviceClaim[]; + /** + * The resource name of the configuration. + * Only set for customers. + */ + configuration?: string; + /** Device ID. */ + deviceId?: string; + /** Device identifier. */ + deviceIdentifier?: DeviceIdentifier; + /** Device metadata. */ + deviceMetadata?: DeviceMetadata; + /** Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. */ + name?: string; + } + interface DeviceClaim { + /** Owner ID. */ + ownerCompanyId?: string; + /** Section type of the device claim. */ + sectionType?: string; + } + interface DeviceIdentifier { + /** IMEI number. */ + imei?: string; + /** + * Manufacturer name to match `android.os.Build.MANUFACTURER` (required). + * Allowed values listed in + * [manufacturer names](/zero-touch/resources/manufacturer-names). + */ + manufacturer?: string; + /** MEID number. */ + meid?: string; + /** Serial number (optional). */ + serialNumber?: string; + } + interface DeviceMetadata { + /** Metadata entries */ + entries?: Record; + } + interface DevicesLongRunningOperationMetadata { + /** Number of devices parsed in your requests. */ + devicesCount?: number; + /** The overall processing status. */ + processingStatus?: string; + /** Processing progress from 0 to 100. */ + progress?: number; + } + interface DevicesLongRunningOperationResponse { + /** + * Processing status for each device. + * One `PerDeviceStatus` per device. The order is the same as in your requests. + */ + perDeviceStatus?: OperationPerDevice[]; + /** Number of succeesfully processed ones. */ + successCount?: number; + } + interface FindDevicesByDeviceIdentifierRequest { + /** The device identifier to search. */ + deviceIdentifier?: DeviceIdentifier; + /** Number of devices to show. */ + limit?: string; + /** Page token. */ + pageToken?: string; + } + interface FindDevicesByDeviceIdentifierResponse { + /** Found devices. */ + devices?: Device[]; + /** Page token of the next page. */ + nextPageToken?: string; + } + interface FindDevicesByOwnerRequest { + /** List of customer IDs to search for. */ + customerId?: string[]; + /** The number of devices to show in the result. */ + limit?: string; + /** Page token. */ + pageToken?: string; + /** The section type. */ + sectionType?: string; + } + interface FindDevicesByOwnerResponse { + /** Devices found. */ + devices?: Device[]; + /** Page token of the next page. */ + nextPageToken?: string; + } + interface ListCustomersResponse { + /** List of customers related to this partner. */ + customers?: Company[]; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** + * This field will always be not set if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error + * information for each device is set in `response.perDeviceStatus.result.status`. + */ + error?: Status; + /** + * This field will contain a `DevicesLongRunningOperationMetadata` object if the operation is created by `claimAsync`, `unclaimAsync`, or + * `updateMetadataAsync`. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * This field will contain a `DevicesLongRunningOperationResponse` object if the operation is created by `claimAsync`, `unclaimAsync`, or + * `updateMetadataAsync`. + */ + response?: Record; + } + interface OperationPerDevice { + /** Request to claim a device. */ + claim?: PartnerClaim; + /** Processing result for every device. */ + result?: PerDeviceStatusInBatch; + /** Request to unclaim a device. */ + unclaim?: PartnerUnclaim; + /** Request to set metadata for a device. */ + updateMetadata?: UpdateMetadataArguments; + } + interface PartnerClaim { + /** Customer ID to claim for. */ + customerId?: string; + /** Device identifier of the device. */ + deviceIdentifier?: DeviceIdentifier; + /** Metadata to set at claim. */ + deviceMetadata?: DeviceMetadata; + /** Section type to claim. */ + sectionType?: string; + } + interface PartnerUnclaim { + /** Device ID of the device. */ + deviceId?: string; + /** Device identifier of the device. */ + deviceIdentifier?: DeviceIdentifier; + /** Section type to unclaim. */ + sectionType?: string; + } + interface PerDeviceStatusInBatch { + /** Device ID of the device if process succeeds. */ + deviceId?: string; + /** Error identifier. */ + errorIdentifier?: string; + /** Error message. */ + errorMessage?: string; + /** Process result. */ + status?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface UnclaimDeviceRequest { + /** The device ID returned by `ClaimDevice`. */ + deviceId?: string; + /** The device identifier you used when you claimed this device. */ + deviceIdentifier?: DeviceIdentifier; + /** The section type to unclaim for. */ + sectionType?: string; + } + interface UnclaimDevicesRequest { + /** List of devices to unclaim. */ + unclaims?: PartnerUnclaim[]; + } + interface UpdateDeviceMetadataInBatchRequest { + /** List of metadata updates. */ + updates?: UpdateMetadataArguments[]; + } + interface UpdateDeviceMetadataRequest { + /** The metdata to set. */ + deviceMetadata?: DeviceMetadata; + } + interface UpdateMetadataArguments { + /** Device ID of the device. */ + deviceId?: string; + /** Device identifier. */ + deviceIdentifier?: DeviceIdentifier; + /** The metadata to update. */ + deviceMetadata?: DeviceMetadata; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CustomersResource { + /** + * Creates a customer for zero-touch enrollment. After the method returns + * successfully, admin and owner roles can manage devices and EMM configs + * by calling API methods or using their zero-touch enrollment portal. The API + * doesn't notify the customer that they have access. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The parent resource ID in format `partners/[PARTNER_ID]` that + * identifies the reseller. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists the customers that are enrolled to the reseller identified by the + * `partnerId` argument. This list includes customers that the reseller + * created and customers that enrolled themselves using the portal. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DevicesResource { + /** Claim the device identified by device identifier. */ + claim(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Claim devices asynchronously. */ + claimAsync(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Partner ID. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Find devices by device identifier. */ + findByIdentifier(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Find devices by ownership. */ + findByOwner(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get a device. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Update the metadata. */ + metadata(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** ID of the partner. */ + deviceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The owner of the newly set metadata. Set this to the partner ID. */ + metadataOwnerId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Unclaim the device identified by the `device_id` or the `deviceIdentifier`. */ + unclaim(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Unclaim devices asynchronously. */ + unclaimAsync(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Partner ID. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Set metadata in batch asynchronously. */ + updateMetadataAsync(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Partner ID. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface PartnersResource { + customers: CustomersResource; + devices: DevicesResource; + } + } +} diff --git a/types/gapi.client.androiddeviceprovisioning/readme.md b/types/gapi.client.androiddeviceprovisioning/readme.md new file mode 100644 index 0000000000..bdeb55a582 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/readme.md @@ -0,0 +1,42 @@ +# TypeScript typings for Android Device Provisioning Partner API v1 +Automates reseller integration into zero-touch enrollment by assigning devices to customers and creating device reports. +For detailed description please check [documentation](https://developers.google.com/zero-touch/). + +## Installing + +Install typings for Android Device Provisioning Partner API: +``` +npm install @types/gapi.client.androiddeviceprovisioning@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androiddeviceprovisioning', 'v1', () => { + // now we can use gapi.client.androiddeviceprovisioning + // ... +}); +``` + + + +After that you can use Android Device Provisioning Partner API resources: + +```typescript + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); +``` \ No newline at end of file diff --git a/types/gapi.client.androiddeviceprovisioning/tsconfig.json b/types/gapi.client.androiddeviceprovisioning/tsconfig.json new file mode 100644 index 0000000000..953923be00 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androiddeviceprovisioning-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androiddeviceprovisioning/tslint.json b/types/gapi.client.androiddeviceprovisioning/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androidenterprise/gapi.client.androidenterprise-tests.ts b/types/gapi.client.androidenterprise/gapi.client.androidenterprise-tests.ts new file mode 100644 index 0000000000..63c1f9101d --- /dev/null +++ b/types/gapi.client.androidenterprise/gapi.client.androidenterprise-tests.ts @@ -0,0 +1,559 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androidenterprise', 'v1', () => { + /** now we can use gapi.client.androidenterprise */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage corporate Android devices */ + 'https://www.googleapis.com/auth/androidenterprise', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves the details of a device. */ + await gapi.client.devices.get({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + await gapi.client.devices.getState({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Retrieves the IDs of all of a user's devices. */ + await gapi.client.devices.list({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + await gapi.client.devices.setState({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. */ + await gapi.client.enterprises.acknowledgeNotificationSet({ + notificationSetId: "notificationSetId", + }); + /** + * Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given + * Enterprise Token. + */ + await gapi.client.enterprises.completeSignup({ + completionToken: "completionToken", + enterpriseToken: "enterpriseToken", + }); + /** + * Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each + * token may only be used to start one UI session. See the javascript API documentation for further information. + */ + await gapi.client.enterprises.createWebToken({ + enterpriseId: "enterpriseId", + }); + /** + * Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled + * with the insert call, then enroll them again with the enroll call. + */ + await gapi.client.enterprises.delete({ + enterpriseId: "enterpriseId", + }); + /** Enrolls an enterprise with the calling EMM. */ + await gapi.client.enterprises.enroll({ + token: "token", + }); + /** Generates a sign-up URL. */ + await gapi.client.enterprises.generateSignupUrl({ + callbackUrl: "callbackUrl", + }); + /** Retrieves the name and domain of an enterprise. */ + await gapi.client.enterprises.get({ + enterpriseId: "enterpriseId", + }); + /** Returns the Android Device Policy config resource. */ + await gapi.client.enterprises.getAndroidDevicePolicyConfig({ + enterpriseId: "enterpriseId", + }); + /** + * Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to + * this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. + * + * This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it + * will return an error. + * + * Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. + * + * Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. + */ + await gapi.client.enterprises.getServiceAccount({ + enterpriseId: "enterpriseId", + keyType: "keyType", + }); + /** Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. */ + await gapi.client.enterprises.getStoreLayout({ + enterpriseId: "enterpriseId", + }); + /** Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. */ + await gapi.client.enterprises.insert({ + token: "token", + }); + /** + * Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not + * needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the + * Enterprises.generateSignupUrl call. + */ + await gapi.client.enterprises.list({ + domain: "domain", + }); + /** + * Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be + * empty if no notification are pending. + * A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set + * is empty. + * Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, + * and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. + * Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each + * caller, if any are pending. + * If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. + */ + await gapi.client.enterprises.pullNotificationSet({ + requestMode: "requestMode", + }); + /** Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. */ + await gapi.client.enterprises.sendTestPushNotification({ + enterpriseId: "enterpriseId", + }); + /** Sets the account that will be used to authenticate to the API as the enterprise. */ + await gapi.client.enterprises.setAccount({ + enterpriseId: "enterpriseId", + }); + /** + * Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified + * enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. + */ + await gapi.client.enterprises.setAndroidDevicePolicyConfig({ + enterpriseId: "enterpriseId", + }); + /** + * Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only + * contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on + * the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a + * homepage), the basic store layout is disabled. + */ + await gapi.client.enterprises.setStoreLayout({ + enterpriseId: "enterpriseId", + }); + /** Unenrolls an enterprise from the calling EMM. */ + await gapi.client.enterprises.unenroll({ + enterpriseId: "enterpriseId", + }); + /** Removes an entitlement to an app for a user. */ + await gapi.client.entitlements.delete({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + userId: "userId", + }); + /** Retrieves details of an entitlement. */ + await gapi.client.entitlements.get({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + userId: "userId", + }); + /** Lists all entitlements for the specified user. Only the ID is set. */ + await gapi.client.entitlements.list({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Adds or updates an entitlement to an app for a user. This method supports patch semantics. */ + await gapi.client.entitlements.patch({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + install: true, + userId: "userId", + }); + /** Adds or updates an entitlement to an app for a user. */ + await gapi.client.entitlements.update({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + install: true, + userId: "userId", + }); + /** Retrieves details of an enterprise's group license for a product. */ + await gapi.client.grouplicenses.get({ + enterpriseId: "enterpriseId", + groupLicenseId: "groupLicenseId", + }); + /** Retrieves IDs of all products for which the enterprise has a group license. */ + await gapi.client.grouplicenses.list({ + enterpriseId: "enterpriseId", + }); + /** Retrieves the IDs of the users who have been granted entitlements under the license. */ + await gapi.client.grouplicenseusers.list({ + enterpriseId: "enterpriseId", + groupLicenseId: "groupLicenseId", + }); + /** Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. */ + await gapi.client.installs.delete({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Retrieves details of an installation of an app on a device. */ + await gapi.client.installs.get({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Retrieves the details of all apps installed on the specified device. */ + await gapi.client.installs.list({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. + * This method supports patch semantics. + */ + await gapi.client.installs.patch({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. */ + await gapi.client.installs.update({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Removes a per-device managed configuration for an app for the specified device. */ + await gapi.client.managedconfigurationsfordevice.delete({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Retrieves details of a per-device managed configuration. */ + await gapi.client.managedconfigurationsfordevice.get({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Lists all the per-device managed configurations for the specified device. Only the ID is set. */ + await gapi.client.managedconfigurationsfordevice.list({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. */ + await gapi.client.managedconfigurationsfordevice.patch({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Adds or updates a per-device managed configuration for an app for the specified device. */ + await gapi.client.managedconfigurationsfordevice.update({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Removes a per-user managed configuration for an app for the specified user. */ + await gapi.client.managedconfigurationsforuser.delete({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Retrieves details of a per-user managed configuration for an app for the specified user. */ + await gapi.client.managedconfigurationsforuser.get({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Lists all the per-user managed configurations for the specified user. Only the ID is set. */ + await gapi.client.managedconfigurationsforuser.list({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. */ + await gapi.client.managedconfigurationsforuser.patch({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Adds or updates a per-user managed configuration for an app for the specified user. */ + await gapi.client.managedconfigurationsforuser.update({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Retrieves details of an Android app permission for display to an enterprise admin. */ + await gapi.client.permissions.get({ + language: "language", + permissionId: "permissionId", + }); + /** + * Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is + * 1,000. + * + * To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. + */ + await gapi.client.products.approve({ + enterpriseId: "enterpriseId", + productId: "productId", + }); + /** + * Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and + * accept them on behalf of their organization in order to approve that product. + * + * Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of + * this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display + * permissions for up to 1 day. + */ + await gapi.client.products.generateApprovalUrl({ + enterpriseId: "enterpriseId", + languageCode: "languageCode", + productId: "productId", + }); + /** Retrieves details of a product for display to an enterprise admin. */ + await gapi.client.products.get({ + enterpriseId: "enterpriseId", + language: "language", + productId: "productId", + }); + /** + * Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed + * configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed + * configuration based on the schema obtained using this API, see Managed Configurations through Play. + */ + await gapi.client.products.getAppRestrictionsSchema({ + enterpriseId: "enterpriseId", + language: "language", + productId: "productId", + }); + /** Retrieves the Android app permissions required by this app. */ + await gapi.client.products.getPermissions({ + enterpriseId: "enterpriseId", + productId: "productId", + }); + /** Finds approved products that match a query, or all approved products if there is no query. */ + await gapi.client.products.list({ + approved: true, + enterpriseId: "enterpriseId", + language: "language", + maxResults: 4, + query: "query", + token: "token", + }); + /** Unapproves the specified product (and the relevant app permissions, if any) */ + await gapi.client.products.unapprove({ + enterpriseId: "enterpriseId", + productId: "productId", + }); + /** + * Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been + * retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + */ + await gapi.client.serviceaccountkeys.delete({ + enterpriseId: "enterpriseId", + keyId: "keyId", + }); + /** + * Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling + * Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + * + * Only the type of the key should be populated in the resource to be inserted. + */ + await gapi.client.serviceaccountkeys.insert({ + enterpriseId: "enterpriseId", + }); + /** + * Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service + * account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling + * Enterprises.SetAccount. + */ + await gapi.client.serviceaccountkeys.list({ + enterpriseId: "enterpriseId", + }); + /** Deletes a cluster. */ + await gapi.client.storelayoutclusters.delete({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Retrieves details of a cluster. */ + await gapi.client.storelayoutclusters.get({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Inserts a new cluster in a page. */ + await gapi.client.storelayoutclusters.insert({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Retrieves the details of all clusters on the specified page. */ + await gapi.client.storelayoutclusters.list({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Updates a cluster. This method supports patch semantics. */ + await gapi.client.storelayoutclusters.patch({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Updates a cluster. */ + await gapi.client.storelayoutclusters.update({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Deletes a store page. */ + await gapi.client.storelayoutpages.delete({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Retrieves details of a store page. */ + await gapi.client.storelayoutpages.get({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Inserts a new store page. */ + await gapi.client.storelayoutpages.insert({ + enterpriseId: "enterpriseId", + }); + /** Retrieves the details of all pages in the store. */ + await gapi.client.storelayoutpages.list({ + enterpriseId: "enterpriseId", + }); + /** Updates the content of a store page. This method supports patch semantics. */ + await gapi.client.storelayoutpages.patch({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Updates the content of a store page. */ + await gapi.client.storelayoutpages.update({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Deleted an EMM-managed user. */ + await gapi.client.users.delete({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated + * token is single-use and expires after a few minutes. + * + * This call only works with EMM-managed accounts. + */ + await gapi.client.users.generateAuthenticationToken({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated + * token. + * + * This call only works with Google managed accounts. + */ + await gapi.client.users.generateToken({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Retrieves a user's details. */ + await gapi.client.users.get({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Retrieves the set of products a user is entitled to access. */ + await gapi.client.users.getAvailableProductSet({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Creates a new EMM-managed user. + * + * The Users resource passed in the body of the request should include an accountIdentifier and an accountType. + * If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName + * field can be changed. + */ + await gapi.client.users.insert({ + enterpriseId: "enterpriseId", + }); + /** + * Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because + * the id is already returned in the result of the Users.insert call. + */ + await gapi.client.users.list({ + email: "email", + enterpriseId: "enterpriseId", + }); + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. + */ + await gapi.client.users.patch({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Revokes a previously generated token (activation code) for the user. */ + await gapi.client.users.revokeToken({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that + * were previously approved (products with revoked approval) can be whitelisted. + */ + await gapi.client.users.setAvailableProductSet({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. + */ + await gapi.client.users.update({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.androidenterprise/index.d.ts b/types/gapi.client.androidenterprise/index.d.ts new file mode 100644 index 0000000000..1e81143609 --- /dev/null +++ b/types/gapi.client.androidenterprise/index.d.ts @@ -0,0 +1,2830 @@ +// Type definitions for Google Google Play EMM API v1 1.0 +// Project: https://developers.google.com/android/work/play/emm-api +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/androidenterprise/v1/rest + +/// + +declare namespace gapi.client { + /** Load Google Play EMM API v1 */ + function load(name: "androidenterprise", version: "v1"): PromiseLike; + function load(name: "androidenterprise", version: "v1", callback: () => any): void; + + const devices: androidenterprise.DevicesResource; + + const enterprises: androidenterprise.EnterprisesResource; + + const entitlements: androidenterprise.EntitlementsResource; + + const grouplicenses: androidenterprise.GrouplicensesResource; + + const grouplicenseusers: androidenterprise.GrouplicenseusersResource; + + const installs: androidenterprise.InstallsResource; + + const managedconfigurationsfordevice: androidenterprise.ManagedconfigurationsfordeviceResource; + + const managedconfigurationsforuser: androidenterprise.ManagedconfigurationsforuserResource; + + const permissions: androidenterprise.PermissionsResource; + + const products: androidenterprise.ProductsResource; + + const serviceaccountkeys: androidenterprise.ServiceaccountkeysResource; + + const storelayoutclusters: androidenterprise.StorelayoutclustersResource; + + const storelayoutpages: androidenterprise.StorelayoutpagesResource; + + const users: androidenterprise.UsersResource; + + namespace androidenterprise { + interface Administrator { + /** The admin's email address. */ + email?: string; + } + interface AdministratorWebToken { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#administratorWebToken". */ + kind?: string; + /** An opaque token to be passed to the Play front-end to generate an iframe. */ + token?: string; + } + interface AdministratorWebTokenSpec { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#administratorWebTokenSpec". */ + kind?: string; + /** The URI of the parent frame hosting the iframe. To prevent XSS, the iframe may not be hosted at other URIs. This URI must be https. */ + parent?: string; + /** + * The list of permissions the admin is granted within the iframe. The admin will only be allowed to view an iframe if they have all of the permissions + * associated with it. The only valid value is "approveApps" that will allow the admin to access the iframe in "approve" mode. + */ + permission?: string[]; + } + interface AndroidDevicePolicyConfig { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#androidDevicePolicyConfig". */ + kind?: string; + /** + * The state of Android Device Policy. "enabled" indicates that Android Device Policy is enabled for the enterprise and the EMM is allowed to manage + * devices with Android Device Policy, while "disabled" means that it cannot. + */ + state?: string; + } + interface AppRestrictionsSchema { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#appRestrictionsSchema". */ + kind?: string; + /** The set of restrictions that make up this schema. */ + restrictions?: AppRestrictionsSchemaRestriction[]; + } + interface AppRestrictionsSchemaChangeEvent { + /** The id of the product (e.g. "app:com.google.android.gm") for which the app restriction schema changed. This field will always be present. */ + productId?: string; + } + interface AppRestrictionsSchemaRestriction { + /** The default value of the restriction. bundle and bundleArray restrictions never have a default value. */ + defaultValue?: AppRestrictionsSchemaRestrictionRestrictionValue; + /** A longer description of the restriction, giving more detail of what it affects. */ + description?: string; + /** For choice or multiselect restrictions, the list of possible entries' human-readable names. */ + entry?: string[]; + /** + * For choice or multiselect restrictions, the list of possible entries' machine-readable values. These values should be used in the configuration, either + * as a single string value for a choice restriction or in a stringArray for a multiselect restriction. + */ + entryValue?: string[]; + /** The unique key that the product uses to identify the restriction, e.g. "com.google.android.gm.fieldname". */ + key?: string; + /** + * For bundle or bundleArray restrictions, the list of nested restrictions. A bundle restriction is always nested within a bundleArray restriction, and a + * bundleArray restriction is at most two levels deep. + */ + nestedRestriction?: AppRestrictionsSchemaRestriction[]; + /** The type of the restriction. */ + restrictionType?: string; + /** The name of the restriction. */ + title?: string; + } + interface AppRestrictionsSchemaRestrictionRestrictionValue { + /** The type of the value being provided. */ + type?: string; + /** The boolean value - this will only be present if type is bool. */ + valueBool?: boolean; + /** The integer value - this will only be present if type is integer. */ + valueInteger?: number; + /** The list of string values - this will only be present if type is multiselect. */ + valueMultiselect?: string[]; + /** The string value - this will be present for types string, choice and hidden. */ + valueString?: string; + } + interface AppUpdateEvent { + /** The id of the product (e.g. "app:com.google.android.gm") that was updated. This field will always be present. */ + productId?: string; + } + interface AppVersion { + /** The track that this app was published in. For example if track is "alpha", this is an alpha version of the app. */ + track?: string; + /** Unique increasing identifier for the app version. */ + versionCode?: number; + /** + * The string used in the Play store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the + * string could be "1.4"). + */ + versionString?: string; + } + interface ApprovalUrlInfo { + /** A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call. */ + approvalUrl?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo". */ + kind?: string; + } + interface AuthenticationToken { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#authenticationToken". */ + kind?: string; + /** + * The authentication token to be passed to the device policy client on the device where it can be used to provision the account for which this token was + * generated. + */ + token?: string; + } + interface Device { + /** The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0". */ + androidId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device". */ + kind?: string; + /** + * Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. + * + * Possible values include: + * - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. + * - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is + * unavailable to the DPC. + * - "containerApp", no longer used (deprecated). + * - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google + * Play, but the profile is itself not owned by a DPC. + */ + managementType?: string; + } + interface DeviceState { + /** + * The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services + * (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state. + */ + accountState?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#deviceState". */ + kind?: string; + } + interface DevicesListResponse { + /** A managed device. */ + device?: Device[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#devicesListResponse". */ + kind?: string; + } + interface Enterprise { + /** Admins of the enterprise. This is only supported for enterprises created via the EMM-initiated flow. */ + administrator?: Administrator[]; + /** The unique ID for the enterprise. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise". */ + kind?: string; + /** The name of the enterprise, for example, "Example, Inc". */ + name?: string; + /** The enterprise's primary domain, such as "example.com". */ + primaryDomain?: string; + } + interface EnterpriseAccount { + /** The email address of the service account. */ + accountEmail?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterpriseAccount". */ + kind?: string; + } + interface EnterprisesListResponse { + /** An enterprise. */ + enterprise?: Enterprise[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprisesListResponse". */ + kind?: string; + } + interface EnterprisesSendTestPushNotificationResponse { + /** The message ID of the test push notification that was sent. */ + messageId?: string; + /** The name of the Cloud Pub/Sub topic to which notifications for this enterprise's enrolled account will be sent. */ + topicName?: string; + } + interface Entitlement { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlement". */ + kind?: string; + /** The ID of the product that the entitlement is for. For example, "app:com.google.android.gm". */ + productId?: string; + /** + * The reason for the entitlement. For example, "free" for free apps. This property is temporary: it will be replaced by the acquisition kind field of + * group licenses. + */ + reason?: string; + } + interface EntitlementsListResponse { + /** + * An entitlement of a user to a product (e.g. an app). For example, a free app that they have installed, or a paid app that they have been allocated a + * license to. + */ + entitlement?: Entitlement[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlementsListResponse". */ + kind?: string; + } + interface GroupLicense { + /** + * How this group license was acquired. "bulkPurchase" means that this Grouplicenses resource was created because the enterprise purchased licenses for + * this product; otherwise, the value is "free" (for free products). + */ + acquisitionKind?: string; + /** + * Whether the product to which this group license relates is currently approved by the enterprise. Products are approved when a group license is first + * created, but this approval may be revoked by an enterprise admin via Google Play. Unapproved products will not be visible to end users in collections, + * and new entitlements to them should not normally be created. + */ + approval?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicense". */ + kind?: string; + /** The total number of provisioned licenses for this product. Returned by read operations, but ignored in write operations. */ + numProvisioned?: number; + /** + * The number of purchased licenses (possibly in multiple purchases). If this field is omitted, then there is no limit on the number of licenses that can + * be provisioned (for example, if the acquisition kind is "free"). + */ + numPurchased?: number; + /** + * The permission approval status of the product. This field is only set if the product is approved. Possible states are: + * - "currentApproved", the current set of permissions is approved, but additional permissions will require the administrator to reapprove the product (If + * the product was approved without specifying the approved permissions setting, then this is the default behavior.), + * - "needsReapproval", the product has unapproved permissions. No additional product licenses can be assigned until the product is reapproved, + * - "allCurrentAndFutureApproved", the current permissions are approved and any future permission updates will be automatically approved without + * administrator review. + */ + permissions?: string; + /** The ID of the product that the license is for. For example, "app:com.google.android.gm". */ + productId?: string; + } + interface GroupLicenseUsersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicenseUsersListResponse". */ + kind?: string; + /** A user of an enterprise. */ + user?: User[]; + } + interface GroupLicensesListResponse { + /** A group license for a product approved for use in the enterprise. */ + groupLicense?: GroupLicense[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicensesListResponse". */ + kind?: string; + } + interface Install { + /** + * Install state. The state "installPending" means that an install request has recently been made and download to the device is in progress. The state + * "installed" means that the app has been installed. This field is read-only. + */ + installState?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#install". */ + kind?: string; + /** The ID of the product that the install is for. For example, "app:com.google.android.gm". */ + productId?: string; + /** The version of the installed product. Guaranteed to be set only if the install state is "installed". */ + versionCode?: number; + } + interface InstallFailureEvent { + /** The Android ID of the device. This field will always be present. */ + deviceId?: string; + /** Additional details on the failure if applicable. */ + failureDetails?: string; + /** The reason for the installation failure. This field will always be present. */ + failureReason?: string; + /** The id of the product (e.g. "app:com.google.android.gm") for which the install failure event occured. This field will always be present. */ + productId?: string; + /** The ID of the user. This field will always be present. */ + userId?: string; + } + interface InstallsListResponse { + /** An installation of an app for a user on a specific device. The existence of an install implies that the user must have an entitlement to the app. */ + install?: Install[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#installsListResponse". */ + kind?: string; + } + interface LocalizedText { + /** The BCP47 tag for a locale. (e.g. "en-US", "de"). */ + locale?: string; + /** The text localized in the associated locale. */ + text?: string; + } + interface ManagedConfiguration { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration". */ + kind?: string; + /** The set of managed properties for this configuration. */ + managedProperty?: ManagedProperty[]; + /** The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm". */ + productId?: string; + } + interface ManagedConfigurationsForDeviceListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsForDeviceListResponse". */ + kind?: string; + /** A managed configuration for an app on a specific device. */ + managedConfigurationForDevice?: ManagedConfiguration[]; + } + interface ManagedConfigurationsForUserListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsForUserListResponse". */ + kind?: string; + /** A managed configuration for an app for a specific user. */ + managedConfigurationForUser?: ManagedConfiguration[]; + } + interface ManagedProperty { + /** The unique key that identifies the property. */ + key?: string; + /** The boolean value - this will only be present if type of the property is bool. */ + valueBool?: boolean; + /** The bundle of managed properties - this will only be present if type of the property is bundle. */ + valueBundle?: ManagedPropertyBundle; + /** The list of bundles of properties - this will only be present if type of the property is bundle_array. */ + valueBundleArray?: ManagedPropertyBundle[]; + /** The integer value - this will only be present if type of the property is integer. */ + valueInteger?: number; + /** The string value - this will only be present if type of the property is string, choice or hidden. */ + valueString?: string; + /** The list of string values - this will only be present if type of the property is multiselect. */ + valueStringArray?: string[]; + } + interface ManagedPropertyBundle { + /** The list of managed properties. */ + managedProperty?: ManagedProperty[]; + } + interface NewDeviceEvent { + /** The Android ID of the device. This field will always be present. */ + deviceId?: string; + /** + * Identifies the extent to which the device is controlled by an Android EMM in various deployment configurations. + * + * Possible values include: + * - "managedDevice", a device where the DPC is set as device owner, + * - "managedProfile", a device where the DPC is set as profile owner. + */ + managementType?: string; + /** The ID of the user. This field will always be present. */ + userId?: string; + } + interface NewPermissionsEvent { + /** + * The set of permissions that the enterprise admin has already approved for this application. Use Permissions.Get on the EMM API to retrieve details + * about these permissions. + */ + approvedPermissions?: string[]; + /** The id of the product (e.g. "app:com.google.android.gm") for which new permissions were added. This field will always be present. */ + productId?: string; + /** The set of permissions that the app is currently requesting. Use Permissions.Get on the EMM API to retrieve details about these permissions. */ + requestedPermissions?: string[]; + } + interface Notification { + /** Notifications about new app restrictions schema changes. */ + appRestrictionsSchemaChangeEvent?: AppRestrictionsSchemaChangeEvent; + /** Notifications about app updates. */ + appUpdateEvent?: AppUpdateEvent; + /** The ID of the enterprise for which the notification is sent. This will always be present. */ + enterpriseId?: string; + /** Notifications about an app installation failure. */ + installFailureEvent?: InstallFailureEvent; + /** Notifications about new devices. */ + newDeviceEvent?: NewDeviceEvent; + /** Notifications about new app permissions. */ + newPermissionsEvent?: NewPermissionsEvent; + /** Type of the notification. */ + notificationType?: string; + /** Notifications about changes to a product's approval status. */ + productApprovalEvent?: ProductApprovalEvent; + /** Notifications about product availability changes. */ + productAvailabilityChangeEvent?: ProductAvailabilityChangeEvent; + /** The time when the notification was published in milliseconds since 1970-01-01T00:00:00Z. This will always be present. */ + timestampMillis?: string; + } + interface NotificationSet { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#notificationSet". */ + kind?: string; + /** The notifications received, or empty if no notifications are present. */ + notification?: Notification[]; + /** + * The notification set ID, required to mark the notification as received with the Enterprises.AcknowledgeNotification API. This will be omitted if no + * notifications are present. + */ + notificationSetId?: string; + } + interface PageInfo { + resultPerPage?: number; + startIndex?: number; + totalResults?: number; + } + interface Permission { + /** A longer description of the Permissions resource, giving more details of what it affects. */ + description?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#permission". */ + kind?: string; + /** The name of the permission. */ + name?: string; + /** An opaque string uniquely identifying the permission. */ + permissionId?: string; + } + interface Product { + /** App versions currently available for this product. */ + appVersion?: AppVersion[]; + /** The name of the author of the product (for example, the app developer). */ + authorName?: string; + /** The tracks that are visible to the enterprise. */ + availableTracks?: string[]; + /** A link to the (consumer) Google Play details page for the product. */ + detailsUrl?: string; + /** + * How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play store and not + * restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by + * Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted. + */ + distributionChannel?: string; + /** A link to an image that can be used as an icon for the product. This image is suitable for use at up to 512px x 512px. */ + iconUrl?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". */ + kind?: string; + /** A string of the form app:. For example, app:com.google.android.gm represents the Gmail app. */ + productId?: string; + /** + * Whether this product is free, free with in-app purchases, or paid. If the pricing is unknown, this means the product is not generally available anymore + * (even though it might still be available to people who own it). + */ + productPricing?: string; + /** Deprecated. */ + requiresContainerApp?: boolean; + /** The certificate used to sign this product. */ + signingCertificate?: ProductSigningCertificate; + /** A link to a smaller image that can be used as an icon for the product. This image is suitable for use at up to 128px x 128px. */ + smallIconUrl?: string; + /** The name of the product. */ + title?: string; + /** A link to the managed Google Play details page for the product, for use by an Enterprise admin. */ + workDetailsUrl?: string; + } + interface ProductApprovalEvent { + /** Whether the product was approved or unapproved. This field will always be present. */ + approved?: string; + /** The id of the product (e.g. "app:com.google.android.gm") for which the approval status has changed. This field will always be present. */ + productId?: string; + } + interface ProductAvailabilityChangeEvent { + /** The new state of the product. This field will always be present. */ + availabilityStatus?: string; + /** The id of the product (e.g. "app:com.google.android.gm") for which the product availability changed. This field will always be present. */ + productId?: string; + } + interface ProductPermission { + /** An opaque string uniquely identifying the permission. */ + permissionId?: string; + /** Whether the permission has been accepted or not. */ + state?: string; + } + interface ProductPermissions { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". */ + kind?: string; + /** The permissions required by the app. */ + permission?: ProductPermission[]; + /** The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm". */ + productId?: string; + } + interface ProductSet { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet". */ + kind?: string; + /** The list of product IDs making up the set of products. */ + productId?: string[]; + /** + * The interpretation of this product set. "unknown" should never be sent and is ignored if received. "whitelist" means that the user is entitled to + * access the product set. "includeAll" means that all products are accessible, including products that are approved, products with revoked approval, and + * products that have never been approved. "allApproved" means that the user is entitled to access all products that are approved for the enterprise. If + * the value is "allApproved" or "includeAll", the productId field is ignored. If no value is provided, it is interpreted as "whitelist" for backwards + * compatibility. Further "allApproved" or "includeAll" does not enable automatic visibility of "alpha" or "beta" tracks for Android app. Use + * ProductVisibility to enable "alpha" or "beta" tracks per user. + */ + productSetBehavior?: string; + /** + * Other products that are part of the set, in addition to those specified in the productId array. The only difference between this field and the + * productId array is that it's possible to specify additional information about this product visibility, see ProductVisibility and its fields for more + * information. Specifying the same product ID both here and in the productId array is not allowed and it will result in an error. + */ + productVisibility?: ProductVisibility[]; + } + interface ProductSigningCertificate { + /** + * The base64 urlsafe encoded SHA1 hash of the certificate. (This field is deprecated in favor of SHA2-256. It should not be used and may be removed at + * any time.) + */ + certificateHashSha1?: string; + /** The base64 urlsafe encoded SHA2-256 hash of the certificate. */ + certificateHashSha256?: string; + } + interface ProductVisibility { + /** The product ID that should be made visible to the user. This is required. */ + productId?: string; + /** + * This allows to only grant visibility to the specified tracks of the app. For example, if an app has a prod version, a beta version and an alpha version + * and the enterprise has been granted visibility to both the alpha and beta tracks, if tracks is {"beta", "production"} the user will be able to install + * the app and they will get the beta version of the app. If there are no app versions in the specified track or if the enterprise wasn't granted + * visibility for the track, adding the "alpha" and "beta" values to the list of tracks will have no effect for now; however they will take effect once + * both conditions are met. Note that the enterprise itself needs to be granted access to the alpha and/or beta tracks, regardless of whether individual + * users or admins have access to those tracks. + * + * The allowed sets are: {} (considered equivalent to {"production"}) {"production"} {"beta", "production"} {"alpha", "beta", "production"} The order of + * elements is not relevant. Any other set of tracks will be rejected with an error. + */ + tracks?: string[]; + } + interface ProductsApproveRequest { + /** + * The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's + * entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new + * permissions if the product was updated since the URL was generated. + */ + approvalUrlInfo?: ApprovalUrlInfo; + /** + * Sets how new permission requests for the product are handled. "allPermissions" automatically approves all current and future permissions for the + * product. "currentPermissionsOnly" approves the current set of permissions for the product, but any future permissions added through updates will + * require manual reapproval. If not specified, only the current set of permissions will be approved. + */ + approvedPermissions?: string; + } + interface ProductsGenerateApprovalUrlResponse { + /** + * A URL that can be rendered in an iframe to display the permissions (if any) of a product. This URL can be used to approve the product only once and + * only within 24 hours of being generated, using the Products.approve call. If the product is currently unapproved and has no permissions, this URL will + * point to an empty page. If the product is currently approved, a URL will only be generated if that product has added permissions since it was last + * approved, and the URL will only display those new permissions that have not yet been accepted. + */ + url?: string; + } + interface ProductsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productsListResponse". */ + kind?: string; + /** General pagination information. */ + pageInfo?: PageInfo; + /** Information about a product (e.g. an app) in the Google Play store, for display to an enterprise admin. */ + product?: Product[]; + /** Pagination information for token pagination. */ + tokenPagination?: TokenPagination; + } + interface ServiceAccount { + /** Credentials that can be used to authenticate as this ServiceAccount. */ + key?: ServiceAccountKey; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccount". */ + kind?: string; + /** The account name of the service account, in the form of an email address. Assigned by the server. */ + name?: string; + } + interface ServiceAccountKey { + /** + * The body of the private key credentials file, in string format. This is only populated when the ServiceAccountKey is created, and is not stored by + * Google. + */ + data?: string; + /** An opaque, unique identifier for this ServiceAccountKey. Assigned by the server. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccountKey". */ + kind?: string; + /** + * Public key data for the credentials file. This is an X.509 cert. If you are using the googleCredentials key type, this is identical to the cert that + * can be retrieved by using the X.509 cert url inside of the credentials file. + */ + publicData?: string; + /** The file format of the generated key data. */ + type?: string; + } + interface ServiceAccountKeysListResponse { + /** The service account credentials. */ + serviceAccountKey?: ServiceAccountKey[]; + } + interface SignupInfo { + /** An opaque token that will be required, along with the Enterprise Token, for obtaining the enterprise resource from CompleteSignup. */ + completionToken?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#signupInfo". */ + kind?: string; + /** A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe. */ + url?: string; + } + interface StoreCluster { + /** Unique ID of this cluster. Assigned by the server. Immutable once assigned. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeCluster". */ + kind?: string; + /** + * Ordered list of localized strings giving the name of this page. The text displayed is the one that best matches the user locale, or the first entry if + * there is no good match. There needs to be at least one entry. + */ + name?: LocalizedText[]; + /** + * String (US-ASCII only) used to determine order of this cluster within the parent page's elements. Page elements are sorted in lexicographic order of + * this field. Duplicated values are allowed, but ordering between elements with duplicate order is undefined. + * + * The value of this field is never visible to a user, it is used solely for the purpose of defining an ordering. Maximum length is 256 characters. + */ + orderInPage?: string; + /** List of products in the order they are displayed in the cluster. There should not be duplicates within a cluster. */ + productId?: string[]; + } + interface StoreLayout { + /** + * The ID of the store page to be used as the homepage. The homepage is the first page shown in the managed Google Play Store. + * + * Not specifying a homepage is equivalent to setting the store layout type to "basic". + */ + homepageId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout". */ + kind?: string; + /** + * The store layout type. By default, this value is set to "basic" if the homepageId field is not set, and to "custom" otherwise. If set to "basic", the + * layout will consist of all approved apps that have been whitelisted for the user. + */ + storeLayoutType?: string; + } + interface StoreLayoutClustersListResponse { + /** A store cluster of an enterprise. */ + cluster?: StoreCluster[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayoutClustersListResponse". */ + kind?: string; + } + interface StoreLayoutPagesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayoutPagesListResponse". */ + kind?: string; + /** A store page of an enterprise. */ + page?: StorePage[]; + } + interface StorePage { + /** Unique ID of this page. Assigned by the server. Immutable once assigned. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storePage". */ + kind?: string; + /** + * Ordered list of pages a user should be able to reach from this page. The pages must exist, must not be this page, and once a link is created the page + * linked to cannot be deleted until all links to it are removed. It is recommended that the basic pages are created first, before adding the links + * between pages. + * + * No attempt is made to verify that all pages are reachable from the homepage. + */ + link?: string[]; + /** + * Ordered list of localized strings giving the name of this page. The text displayed is the one that best matches the user locale, or the first entry if + * there is no good match. There needs to be at least one entry. + */ + name?: LocalizedText[]; + } + interface TokenPagination { + nextPageToken?: string; + previousPageToken?: string; + } + interface User { + /** + * A unique identifier you create for this user, such as "user342" or "asset#44418". Do not use personally identifiable information (PII) for this + * property. Must always be set for EMM-managed users. Not set for Google-managed users. + */ + accountIdentifier?: string; + /** + * The type of account that this user represents. A userAccount can be installed on multiple devices, but a deviceAccount is specific to a single device. + * An EMM-managed user (emmManaged) can be either type (userAccount, deviceAccount), but a Google-managed user (googleManaged) is always a userAccount. + */ + accountType?: string; + /** + * The name that will appear in user interfaces. Setting this property is optional when creating EMM-managed users. If you do set this property, use + * something generic about the organization (such as "Example, Inc.") or your name (as EMM). Not used for Google-managed user accounts. + */ + displayName?: string; + /** The unique ID for the user. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user". */ + kind?: string; + /** + * The entity that manages the user. With googleManaged users, the source of truth is Google so EMMs have to make sure a Google Account exists for the + * user. With emmManaged users, the EMM is in charge. + */ + managementType?: string; + /** The user's primary email address, for example, "jsmith@example.com". Will always be set for Google managed users and not set for EMM managed users. */ + primaryEmail?: string; + } + interface UserToken { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken". */ + kind?: string; + /** The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0. */ + token?: string; + /** The unique ID for the user. */ + userId?: string; + } + interface UsersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#usersListResponse". */ + kind?: string; + /** A user of an enterprise. */ + user?: User[]; + } + interface DevicesResource { + /** Retrieves the details of a device. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + getState(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the IDs of all of a user's devices. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + setState(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EnterprisesResource { + /** Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. */ + acknowledgeNotificationSet(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. */ + notificationSetId?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given + * Enterprise Token. + */ + completeSignup(request: { + /** Data format for the response. */ + alt?: string; + /** The Completion token initially returned by GenerateSignupUrl. */ + completionToken?: string; + /** The Enterprise token appended to the Callback URL. */ + enterpriseToken?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each + * token may only be used to start one UI session. See the javascript API documentation for further information. + */ + createWebToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled + * with the insert call, then enroll them again with the enroll call. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enrolls an enterprise with the calling EMM. */ + enroll(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token provided by the enterprise to register the EMM. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Generates a sign-up URL. */ + generateSignupUrl(request: { + /** Data format for the response. */ + alt?: string; + /** + * The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single + * query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. + * Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes + * and, more importantly, the URL must be well-formed so that it can be parsed. + */ + callbackUrl?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the name and domain of an enterprise. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the Android Device Policy config resource. */ + getAndroidDevicePolicyConfig(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to + * this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. + * + * This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it + * will return an error. + * + * Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. + * + * Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. + */ + getServiceAccount(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The type of credential to return with the service account. Required. */ + keyType?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. */ + getStoreLayout(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token provided by the enterprise to register the EMM. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not + * needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the + * Enterprises.generateSignupUrl call. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The exact primary domain name of the enterprise to look up. */ + domain: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be + * empty if no notification are pending. + * A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set + * is empty. + * Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, + * and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. + * Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each + * caller, if any are pending. + * If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. + */ + pullNotificationSet(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The request mode for pulling notifications. + * Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification + * list if no notifications are present after some time. + * Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. + * If omitted, defaults to waitForNotifications. + */ + requestMode?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. */ + sendTestPushNotification(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the account that will be used to authenticate to the API as the enterprise. */ + setAccount(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified + * enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. + */ + setAndroidDevicePolicyConfig(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only + * contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on + * the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a + * homepage), the basic store layout is disabled. + */ + setStoreLayout(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Unenrolls an enterprise from the calling EMM. */ + unenroll(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EntitlementsResource { + /** Removes an entitlement to an app for a user. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of an entitlement. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all entitlements for the specified user. Only the ID is set. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates an entitlement to an app for a user. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this + * operation from returning successfully, as long as the entitlement was successfully assigned to the user. + */ + install?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates an entitlement to an app for a user. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this + * operation from returning successfully, as long as the entitlement was successfully assigned to the user. + */ + install?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GrouplicensesResource { + /** Retrieves details of an enterprise's group license for a product. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product the group license is for, e.g. "app:com.google.android.gm". */ + groupLicenseId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves IDs of all products for which the enterprise has a group license. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GrouplicenseusersResource { + /** Retrieves the IDs of the users who have been granted entitlements under the license. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product the group license is for, e.g. "app:com.google.android.gm". */ + groupLicenseId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InstallsResource { + /** Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of an installation of an app on a device. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the details of all apps installed on the specified device. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. + * This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManagedconfigurationsfordeviceResource { + /** Removes a per-device managed configuration for an app for the specified device. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a per-device managed configuration. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the per-device managed configurations for the specified device. Only the ID is set. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-device managed configuration for an app for the specified device. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManagedconfigurationsforuserResource { + /** Removes a per-user managed configuration for an app for the specified user. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a per-user managed configuration for an app for the specified user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the per-user managed configurations for the specified user. Only the ID is set. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-user managed configuration for an app for the specified user. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PermissionsResource { + /** Retrieves details of an Android app permission for display to an enterprise admin. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de") */ + language?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** + * Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is + * 1,000. + * + * To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. + */ + approve(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and + * accept them on behalf of their organization in order to approve that product. + * + * Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of + * this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display + * permissions for up to 1 day. + */ + generateApprovalUrl(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". */ + languageCode?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a product for display to an enterprise admin. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). */ + language?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product, e.g. "app:com.google.android.gm". */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed + * configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed + * configuration based on the schema obtained using this API, see Managed Configurations through Play. + */ + getAppRestrictionsSchema(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). */ + language?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the Android app permissions required by this app. */ + getPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Finds approved products that match a query, or all approved products if there is no query. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be + * specified. + */ + approved?: boolean; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language. */ + language?: string; + /** + * Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum + * retrievable within a single response. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), + * including apps that are not available in the store (e.g. unpublished apps). + */ + query?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A pagination token is contained in a request''s response when there are more products. The token can be used in a subsequent request to obtain more + * products, and so forth. This parameter cannot be used in the initial request. + */ + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Unapproves the specified product (and the relevant app permissions, if any) */ + unapprove(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ServiceaccountkeysResource { + /** + * Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been + * retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the key. */ + keyId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling + * Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + * + * Only the type of the key should be populated in the resource to be inserted. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service + * account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling + * Enterprises.SetAccount. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface StorelayoutclustersResource { + /** Deletes a cluster. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a cluster. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new cluster in a page. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the details of all clusters on the specified page. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a cluster. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a cluster. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface StorelayoutpagesResource { + /** Deletes a store page. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a store page. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new store page. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the details of all pages in the store. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the content of a store page. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the content of a store page. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UsersResource { + /** Deleted an EMM-managed user. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated + * token is single-use and expires after a few minutes. + * + * This call only works with EMM-managed accounts. + */ + generateAuthenticationToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated + * token. + * + * This call only works with Google managed accounts. + */ + generateToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a user's details. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the set of products a user is entitled to access. */ + getAvailableProductSet(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a new EMM-managed user. + * + * The Users resource passed in the body of the request should include an accountIdentifier and an accountType. + * If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName + * field can be changed. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because + * the id is already returned in the result of the Users.insert call. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The exact primary email address of the user to look up. */ + email: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Revokes a previously generated token (activation code) for the user. */ + revokeToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that + * were previously approved (products with revoked approval) can be whitelisted. + */ + setAvailableProductSet(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.androidenterprise/readme.md b/types/gapi.client.androidenterprise/readme.md new file mode 100644 index 0000000000..af095b5ae6 --- /dev/null +++ b/types/gapi.client.androidenterprise/readme.md @@ -0,0 +1,476 @@ +# TypeScript typings for Google Play EMM API v1 +Manages the deployment of apps to Android for Work users. +For detailed description please check [documentation](https://developers.google.com/android/work/play/emm-api). + +## Installing + +Install typings for Google Play EMM API: +``` +npm install @types/gapi.client.androidenterprise@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androidenterprise', 'v1', () => { + // now we can use gapi.client.androidenterprise + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage corporate Android devices + 'https://www.googleapis.com/auth/androidenterprise', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Play EMM API resources: + +```typescript + +/* +Retrieves the details of a device. +*/ +await gapi.client.devices.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. +*/ +await gapi.client.devices.getState({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves the IDs of all of a user's devices. +*/ +await gapi.client.devices.list({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. +*/ +await gapi.client.devices.setState({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. +*/ +await gapi.client.enterprises.acknowledgeNotificationSet({ }); + +/* +Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. +*/ +await gapi.client.enterprises.completeSignup({ }); + +/* +Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. +*/ +await gapi.client.enterprises.createWebToken({ enterpriseId: "enterpriseId", }); + +/* +Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled with the insert call, then enroll them again with the enroll call. +*/ +await gapi.client.enterprises.delete({ enterpriseId: "enterpriseId", }); + +/* +Enrolls an enterprise with the calling EMM. +*/ +await gapi.client.enterprises.enroll({ token: "token", }); + +/* +Generates a sign-up URL. +*/ +await gapi.client.enterprises.generateSignupUrl({ }); + +/* +Retrieves the name and domain of an enterprise. +*/ +await gapi.client.enterprises.get({ enterpriseId: "enterpriseId", }); + +/* +Returns the Android Device Policy config resource. +*/ +await gapi.client.enterprises.getAndroidDevicePolicyConfig({ enterpriseId: "enterpriseId", }); + +/* +Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. + +This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. + +Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. + +Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. +*/ +await gapi.client.enterprises.getServiceAccount({ enterpriseId: "enterpriseId", }); + +/* +Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. +*/ +await gapi.client.enterprises.getStoreLayout({ enterpriseId: "enterpriseId", }); + +/* +Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. +*/ +await gapi.client.enterprises.insert({ token: "token", }); + +/* +Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. +*/ +await gapi.client.enterprises.list({ domain: "domain", }); + +/* +Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. +A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. +Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. +Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. +If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. +*/ +await gapi.client.enterprises.pullNotificationSet({ }); + +/* +Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. +*/ +await gapi.client.enterprises.sendTestPushNotification({ enterpriseId: "enterpriseId", }); + +/* +Sets the account that will be used to authenticate to the API as the enterprise. +*/ +await gapi.client.enterprises.setAccount({ enterpriseId: "enterpriseId", }); + +/* +Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. +*/ +await gapi.client.enterprises.setAndroidDevicePolicyConfig({ enterpriseId: "enterpriseId", }); + +/* +Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. +*/ +await gapi.client.enterprises.setStoreLayout({ enterpriseId: "enterpriseId", }); + +/* +Unenrolls an enterprise from the calling EMM. +*/ +await gapi.client.enterprises.unenroll({ enterpriseId: "enterpriseId", }); + +/* +Removes an entitlement to an app for a user. +*/ +await gapi.client.entitlements.delete({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Retrieves details of an entitlement. +*/ +await gapi.client.entitlements.get({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Lists all entitlements for the specified user. Only the ID is set. +*/ +await gapi.client.entitlements.list({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Adds or updates an entitlement to an app for a user. This method supports patch semantics. +*/ +await gapi.client.entitlements.patch({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Adds or updates an entitlement to an app for a user. +*/ +await gapi.client.entitlements.update({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Retrieves details of an enterprise's group license for a product. +*/ +await gapi.client.grouplicenses.get({ enterpriseId: "enterpriseId", groupLicenseId: "groupLicenseId", }); + +/* +Retrieves IDs of all products for which the enterprise has a group license. +*/ +await gapi.client.grouplicenses.list({ enterpriseId: "enterpriseId", }); + +/* +Retrieves the IDs of the users who have been granted entitlements under the license. +*/ +await gapi.client.grouplicenseusers.list({ enterpriseId: "enterpriseId", groupLicenseId: "groupLicenseId", }); + +/* +Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. +*/ +await gapi.client.installs.delete({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Retrieves details of an installation of an app on a device. +*/ +await gapi.client.installs.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Retrieves the details of all apps installed on the specified device. +*/ +await gapi.client.installs.list({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics. +*/ +await gapi.client.installs.patch({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. +*/ +await gapi.client.installs.update({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Removes a per-device managed configuration for an app for the specified device. +*/ +await gapi.client.managedconfigurationsfordevice.delete({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Retrieves details of a per-device managed configuration. +*/ +await gapi.client.managedconfigurationsfordevice.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Lists all the per-device managed configurations for the specified device. Only the ID is set. +*/ +await gapi.client.managedconfigurationsfordevice.list({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. +*/ +await gapi.client.managedconfigurationsfordevice.patch({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Adds or updates a per-device managed configuration for an app for the specified device. +*/ +await gapi.client.managedconfigurationsfordevice.update({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Removes a per-user managed configuration for an app for the specified user. +*/ +await gapi.client.managedconfigurationsforuser.delete({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Retrieves details of a per-user managed configuration for an app for the specified user. +*/ +await gapi.client.managedconfigurationsforuser.get({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Lists all the per-user managed configurations for the specified user. Only the ID is set. +*/ +await gapi.client.managedconfigurationsforuser.list({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. +*/ +await gapi.client.managedconfigurationsforuser.patch({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Adds or updates a per-user managed configuration for an app for the specified user. +*/ +await gapi.client.managedconfigurationsforuser.update({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Retrieves details of an Android app permission for display to an enterprise admin. +*/ +await gapi.client.permissions.get({ permissionId: "permissionId", }); + +/* +Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. + +To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. +*/ +await gapi.client.products.approve({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + +Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. +*/ +await gapi.client.products.generateApprovalUrl({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Retrieves details of a product for display to an enterprise admin. +*/ +await gapi.client.products.get({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. +*/ +await gapi.client.products.getAppRestrictionsSchema({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Retrieves the Android app permissions required by this app. +*/ +await gapi.client.products.getPermissions({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Finds approved products that match a query, or all approved products if there is no query. +*/ +await gapi.client.products.list({ enterpriseId: "enterpriseId", }); + +/* +Unapproves the specified product (and the relevant app permissions, if any) +*/ +await gapi.client.products.unapprove({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. +*/ +await gapi.client.serviceaccountkeys.delete({ enterpriseId: "enterpriseId", keyId: "keyId", }); + +/* +Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + +Only the type of the key should be populated in the resource to be inserted. +*/ +await gapi.client.serviceaccountkeys.insert({ enterpriseId: "enterpriseId", }); + +/* +Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. +*/ +await gapi.client.serviceaccountkeys.list({ enterpriseId: "enterpriseId", }); + +/* +Deletes a cluster. +*/ +await gapi.client.storelayoutclusters.delete({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Retrieves details of a cluster. +*/ +await gapi.client.storelayoutclusters.get({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Inserts a new cluster in a page. +*/ +await gapi.client.storelayoutclusters.insert({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Retrieves the details of all clusters on the specified page. +*/ +await gapi.client.storelayoutclusters.list({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Updates a cluster. This method supports patch semantics. +*/ +await gapi.client.storelayoutclusters.patch({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Updates a cluster. +*/ +await gapi.client.storelayoutclusters.update({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Deletes a store page. +*/ +await gapi.client.storelayoutpages.delete({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Retrieves details of a store page. +*/ +await gapi.client.storelayoutpages.get({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Inserts a new store page. +*/ +await gapi.client.storelayoutpages.insert({ enterpriseId: "enterpriseId", }); + +/* +Retrieves the details of all pages in the store. +*/ +await gapi.client.storelayoutpages.list({ enterpriseId: "enterpriseId", }); + +/* +Updates the content of a store page. This method supports patch semantics. +*/ +await gapi.client.storelayoutpages.patch({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Updates the content of a store page. +*/ +await gapi.client.storelayoutpages.update({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Deleted an EMM-managed user. +*/ +await gapi.client.users.delete({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. + +This call only works with EMM-managed accounts. +*/ +await gapi.client.users.generateAuthenticationToken({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. + +This call only works with Google managed accounts. +*/ +await gapi.client.users.generateToken({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves a user's details. +*/ +await gapi.client.users.get({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves the set of products a user is entitled to access. +*/ +await gapi.client.users.getAvailableProductSet({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Creates a new EMM-managed user. + +The Users resource passed in the body of the request should include an accountIdentifier and an accountType. +If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. +*/ +await gapi.client.users.insert({ enterpriseId: "enterpriseId", }); + +/* +Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. +*/ +await gapi.client.users.list({ email: "email", enterpriseId: "enterpriseId", }); + +/* +Updates the details of an EMM-managed user. + +Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. +*/ +await gapi.client.users.patch({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Revokes a previously generated token (activation code) for the user. +*/ +await gapi.client.users.revokeToken({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted. +*/ +await gapi.client.users.setAvailableProductSet({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Updates the details of an EMM-managed user. + +Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. +*/ +await gapi.client.users.update({ enterpriseId: "enterpriseId", userId: "userId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.androidenterprise/tsconfig.json b/types/gapi.client.androidenterprise/tsconfig.json new file mode 100644 index 0000000000..d641db9824 --- /dev/null +++ b/types/gapi.client.androidenterprise/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androidenterprise-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androidenterprise/tslint.json b/types/gapi.client.androidenterprise/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androidenterprise/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androidmanagement/gapi.client.androidmanagement-tests.ts b/types/gapi.client.androidmanagement/gapi.client.androidmanagement-tests.ts new file mode 100644 index 0000000000..8710ad7485 --- /dev/null +++ b/types/gapi.client.androidmanagement/gapi.client.androidmanagement-tests.ts @@ -0,0 +1,52 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androidmanagement', 'v1', () => { + /** now we can use gapi.client.androidmanagement */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage Android devices and apps for your customers */ + 'https://www.googleapis.com/auth/androidmanagement', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Creates an enterprise by completing the enterprise signup flow. */ + await gapi.client.enterprises.create({ + enterpriseToken: "enterpriseToken", + projectId: "projectId", + signupUrlName: "signupUrlName", + }); + /** Gets an enterprise. */ + await gapi.client.enterprises.get({ + name: "name", + }); + /** Updates an enterprise. */ + await gapi.client.enterprises.patch({ + name: "name", + updateMask: "updateMask", + }); + /** Creates an enterprise signup URL. */ + await gapi.client.signupUrls.create({ + callbackUrl: "callbackUrl", + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.androidmanagement/index.d.ts b/types/gapi.client.androidmanagement/index.d.ts new file mode 100644 index 0000000000..b24ccab3e5 --- /dev/null +++ b/types/gapi.client.androidmanagement/index.d.ts @@ -0,0 +1,1385 @@ +// Type definitions for Google Android Management API v1 1.0 +// Project: https://developers.google.com/android/management +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://androidmanagement.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Android Management API v1 */ + function load(name: "androidmanagement", version: "v1"): PromiseLike; + function load(name: "androidmanagement", version: "v1", callback: () => any): void; + + const enterprises: androidmanagement.EnterprisesResource; + + const signupUrls: androidmanagement.SignupUrlsResource; + + namespace androidmanagement { + interface ApiLevelCondition { + /** + * The minimum desired Android Framework API level. If the device does not meet the minimum requirement, this condition is satisfied. Must be greater than + * zero. + */ + minApiLevel?: number; + } + interface Application { + /** The set of managed properties available to be pre-configured for the application. */ + managedProperties?: ManagedProperty[]; + /** The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} */ + name?: string; + /** The permissions required by the app. */ + permissions?: ApplicationPermission[]; + /** The title of the application. Localized. */ + title?: string; + } + interface ApplicationPermission { + /** A longer description of the permission, giving more details of what it affects. Localized. */ + description?: string; + /** The name of the permission. Localized. */ + name?: string; + /** An opaque string uniquely identifying the permission. Not localized. */ + permissionId?: string; + } + interface ApplicationPolicy { + /** + * The default policy for all permissions requested by the app. If specified, this overrides the policy-level default_permission_policy which applies to + * all apps. + */ + defaultPermissionPolicy?: string; + /** The type of installation to perform. */ + installType?: string; + /** Whether the application is allowed to lock itself in full-screen mode. */ + lockTaskAllowed?: boolean; + /** + * Managed configuration applied to the app. The format for the configuration is dictated by the ManagedProperty values supported by the app. Each field + * name in the managed configuration must match the key field of the ManagedProperty. The field value must be compatible with the type of the + * ManagedProperty: + * + * + *
typeJSON value
BOOLtrue or false
STRINGstring
INTEGERnumber
CHOICEstring
MULTISELECTarray of strings
HIDDENstring
BUNDLE_ARRAYarray of objects
+ */ + managedConfiguration?: Record; + /** The package name of the app, e.g. com.google.android.youtube for the YouTube app. */ + packageName?: string; + /** Explicit permission grants or denials for the app. These values override the default_permission_policy. */ + permissionGrants?: PermissionGrant[]; + } + interface Command { + /** The timestamp at which the command was created. The timestamp is automatically generated by the server. */ + createTime?: string; + /** + * The duration for which the command is valid. The command will expire if not executed by the device during this time. The default duration if + * unspecified is ten minutes. There is no maximum duration. + */ + duration?: string; + /** For commands of type RESET_PASSWORD, optionally specifies the new password. */ + newPassword?: string; + /** For commands of type RESET_PASSWORD, optionally specifies flags. */ + resetPasswordFlags?: string[]; + /** The type of the command. */ + type?: string; + } + interface ComplianceRule { + /** A condition which is satisfied if the Android Framework API level on the device does not meet a minimum requirement. */ + apiLevelCondition?: ApiLevelCondition; + /** + * If set to true, the rule includes a mitigating action to disable applications so that the device is effectively disabled, but application data is + * preserved. If the device is running an app in locked task mode, the app will be closed and a UI showing the reason for non-compliance will be + * displayed. + */ + disableApps?: boolean; + /** A condition which is satisfied if there exists any matching NonComplianceDetail for the device. */ + nonComplianceDetailCondition?: NonComplianceDetailCondition; + } + interface Device { + /** The API level of the Android platform version running on the device. */ + apiLevel?: number; + /** The name of the policy that is currently applied by the device. */ + appliedPolicyName?: string; + /** The version of the policy that is currently applied by the device. */ + appliedPolicyVersion?: string; + /** The state that is currently applied by the device. */ + appliedState?: string; + /** + * If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field may be + * modified by an update request. + */ + disabledReason?: UserFacingMessage; + /** Displays on the device. This information is only available when displayInfoEnabled is true in the device's policy. */ + displays?: Display[]; + /** The time of device enrollment. */ + enrollmentTime?: string; + /** If this device was enrolled with an enrollment token with additional data provided, this field contains that data. */ + enrollmentTokenData?: string; + /** If this device was enrolled with an enrollment token, this field contains the name of the token. */ + enrollmentTokenName?: string; + /** Detailed information about the device hardware. */ + hardwareInfo?: HardwareInfo; + /** Hardware status samples in chronological order. This information is only available when hardwareStatusEnabled is true in the device's policy. */ + hardwareStatusSamples?: HardwareStatus[]; + /** The last time the device sent a policy compliance report. */ + lastPolicyComplianceReportTime?: string; + /** The last time the device fetched its policy. */ + lastPolicySyncTime?: string; + /** The last time the device sent a status report. */ + lastStatusReportTime?: string; + /** + * Events related to memory and storage measurements in chronological order. This information is only available when memoryInfoEnabled is true in the + * device's policy. + */ + memoryEvents?: MemoryEvent[]; + /** Memory information. This information is only available when memoryInfoEnabled is true in the device's policy. */ + memoryInfo?: MemoryInfo; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name?: string; + /** Device network information. This information is only available when networkInfoEnabled is true in the device's policy. */ + networkInfo?: NetworkInfo; + /** Details about policy settings for which the device is not in compliance. */ + nonComplianceDetails?: NonComplianceDetail[]; + /** Whether the device is compliant with its policy. */ + policyCompliant?: boolean; + /** + * The name of the policy that is intended to be applied to the device. If empty, the policy with id default is applied. This field may be modified by an + * update request. The name of the policy is in the form enterprises/{enterpriseId}/policies/{policyId}. It is also permissible to only specify the + * policyId when updating this field as long as the policyId contains no slashes since the rest of the policy name can be inferred from context. + */ + policyName?: string; + /** + * Power management events on the device in chronological order. This information is only available when powerManagementEventsEnabled is true in the + * device's policy. + */ + powerManagementEvents?: PowerManagementEvent[]; + /** + * The previous device names used for the same physical device when it has been enrolled multiple times. The serial number is used as the unique + * identifier to determine if the same physical device has enrolled previously. The names are in chronological order. + */ + previousDeviceNames?: string[]; + /** Detailed information about the device software. This information is only available when softwareInfoEnabled is true in the device's policy. */ + softwareInfo?: SoftwareInfo; + /** + * The state that is intended to be applied to the device. This field may be modified by an update request. Note that UpdateDevice only handles toggling + * between ACTIVE and DISABLED states. Use the delete device method to cause the device to enter the DELETED state. + */ + state?: string; + /** + * The resource name of the user of the device in the form enterprises/{enterpriseId}/users/{userId}. This is the name of the device account automatically + * created for this device. + */ + userName?: string; + } + interface Display { + /** Display density expressed as dots-per-inch. */ + density?: number; + /** Unique display id. */ + displayId?: number; + /** Display height in pixels. */ + height?: number; + /** Name of the display. */ + name?: string; + /** Refresh rate of the display in frames per second. */ + refreshRate?: number; + /** State of the display. */ + state?: string; + /** Display width in pixels. */ + width?: number; + } + interface EnrollmentToken { + /** + * Optional, arbitrary data associated with the enrollment token. This could contain, for example, the id of an org unit to which the device is assigned + * after enrollment. After a device enrolls with the token, this data will be exposed in the enrollment_token_data field of the Device resource. The data + * must be 1024 characters or less; otherwise, the creation request will fail. + */ + additionalData?: string; + /** The duration of the token. If not specified, the duration will be 1 hour. The allowed range is 1 minute to 30 days. */ + duration?: string; + /** The expiration time of the token. This is a read-only field generated by the server. */ + expirationTimestamp?: string; + /** + * The name of the enrollment token, which is generated by the server during creation, in the form + * enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} + */ + name?: string; + /** + * The name of the policy that will be initially applied to the enrolled device in the form enterprises/{enterpriseId}/policies/{policyId}. If not + * specified, the policy with id default is applied. It is permissible to only specify the policyId when updating this field as long as the policyId + * contains no slashes since the rest of the policy name can be inferred from context. + */ + policyName?: string; + /** + * A JSON string whose UTF-8 representation can be used to generate a QR code to enroll a device with this enrollment token. To enroll a device using NFC, + * the NFC record must contain a serialized java.util.Properties representation of the properties in the JSON. + */ + qrCode?: string; + /** The token value which is passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. */ + value?: string; + } + interface Enterprise { + /** + * Whether app auto-approval is enabled. When enabled, apps installed via policy for this enterprise have all permissions automatically approved. When + * enabled, it is the caller's responsibility to display the permissions required by an app to the enterprise admin before setting the app to be installed + * in a policy. + */ + appAutoApprovalEnabled?: boolean; + /** The notification types to enable via Google Cloud Pub/Sub. */ + enabledNotificationTypes?: string[]; + /** The name of the enterprise as it will appear to users. */ + enterpriseDisplayName?: string; + /** + * An image displayed as a logo during device provisioning. Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, + * image/vnd.wap.wbmp, image/x-adobe-dng. + */ + logo?: ExternalData; + /** The name of the enterprise which is generated by the server during creation, in the form enterprises/{enterpriseId} */ + name?: string; + /** + * A color in RGB format indicating the predominant color to display in the device management app UI. The color components are stored as follows: (red << + * 16) | (green << 8) | blue, where each component may take a value between 0 and 255 inclusive. + */ + primaryColor?: number; + /** + * When Cloud Pub/Sub notifications are enabled, this field is required to indicate the topic to which the notifications will be published. The format of + * this field is projects/{project}/topics/{topic}. You must have granted the publish permission on this topic to + * android-cloud-policy@system.gserviceaccount.com + */ + pubsubTopic?: string; + } + interface ExternalData { + /** The base-64 encoded SHA-256 hash of the content hosted at url. If the content does not match this hash, Android Device Policy will not use the data. */ + sha256Hash?: string; + /** + * The absolute URL to the data, which must use either the http or https scheme. Android Device Policy does not provide any credentials in the GET + * request, so the URL must be publicly accessible. Including a long, random component in the URL may be used to prevent attackers from discovering the + * URL. + */ + url?: string; + } + interface HardwareInfo { + /** Battery shutdown temperature thresholds in Celsius for each battery on the device. */ + batteryShutdownTemperatures?: number[]; + /** Battery throttling temperature thresholds in Celsius for each battery on the device. */ + batteryThrottlingTemperatures?: number[]; + /** Brand of the device, e.g. Google. */ + brand?: string; + /** CPU shutdown temperature thresholds in Celsius for each CPU on the device. */ + cpuShutdownTemperatures?: number[]; + /** CPU throttling temperature thresholds in Celsius for each CPU on the device. */ + cpuThrottlingTemperatures?: number[]; + /** Baseband version, e.g. MDM9625_104662.22.05.34p. */ + deviceBasebandVersion?: string; + /** GPU shutdown temperature thresholds in Celsius for each GPU on the device. */ + gpuShutdownTemperatures?: number[]; + /** GPU throttling temperature thresholds in Celsius for each GPU on the device. */ + gpuThrottlingTemperatures?: number[]; + /** Name of the hardware, e.g. Angler. */ + hardware?: string; + /** Manufacturer, e.g. Motorola. */ + manufacturer?: string; + /** The model of the device, e.g. Asus Nexus 7. */ + model?: string; + /** The device serial number. */ + serialNumber?: string; + /** Device skin shutdown temperature thresholds in Celsius. */ + skinShutdownTemperatures?: number[]; + /** Device skin throttling temperature thresholds in Celsius. */ + skinThrottlingTemperatures?: number[]; + } + interface HardwareStatus { + /** Current battery temperatures in Celsius for each battery on the device. */ + batteryTemperatures?: number[]; + /** Current CPU temperatures in Celsius for each CPU on the device. */ + cpuTemperatures?: number[]; + /** + * CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported + * in the system. + */ + cpuUsages?: number[]; + /** The time the measurements were taken. */ + createTime?: string; + /** Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system. */ + fanSpeeds?: number[]; + /** Current GPU temperatures in Celsius for each GPU on the device. */ + gpuTemperatures?: number[]; + /** Current device skin temperatures in Celsius. */ + skinTemperatures?: number[]; + } + interface ListDevicesResponse { + /** The list of devices. */ + devices?: Device[]; + /** If there are more results, a token to retrieve next page of results. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface ListPoliciesResponse { + /** If there are more results, a token to retrieve next page of results. */ + nextPageToken?: string; + /** The list of policies. */ + policies?: Policy[]; + } + interface ManagedProperty { + /** The default value of the properties. BUNDLE_ARRAY properties never have a default value. */ + defaultValue?: any; + /** A longer description of the property, giving more detail of what it affects. Localized. */ + description?: string; + /** For CHOICE or MULTISELECT properties, the list of possible entries. */ + entries?: ManagedPropertyEntry[]; + /** The unique key that the application uses to identify the property, e.g. "com.google.android.gm.fieldname". */ + key?: string; + /** For BUNDLE_ARRAY properties, the list of nested properties. A BUNDLE_ARRAY property is at most two levels deep. */ + nestedProperties?: ManagedProperty[]; + /** The name of the property. Localized. */ + title?: string; + /** The type of the property. */ + type?: string; + } + interface ManagedPropertyEntry { + /** The human-readable name of the value. Localized. */ + name?: string; + /** The machine-readable value of the entry, which should be used in the configuration. Not localized. */ + value?: string; + } + interface MemoryEvent { + /** The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium. */ + byteCount?: string; + /** The creation time of the event. */ + createTime?: string; + /** Event type. */ + eventType?: string; + } + interface MemoryInfo { + /** Total internal storage on device in bytes. */ + totalInternalStorage?: string; + /** Total RAM on device in bytes. */ + totalRam?: string; + } + interface NetworkInfo { + /** IMEI number of the GSM device, e.g. A1000031212. */ + imei?: string; + /** MEID number of the CDMA device, e.g. A00000292788E1. */ + meid?: string; + /** WiFi MAC address of the device, e.g. 7c:11:11:11:11:11. */ + wifiMacAddress?: string; + } + interface NonComplianceDetail { + /** If the policy setting could not be applied, the current value of the setting on the device. */ + currentValue?: any; + /** + * For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is + * formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a + * dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate + * a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url + */ + fieldPath?: string; + /** + * If package_name is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app cannot be installed or + * updated. + */ + installationFailureReason?: string; + /** The reason the device is not in compliance with the setting. */ + nonComplianceReason?: string; + /** The package name indicating which application is out of compliance, if applicable. */ + packageName?: string; + /** The name of the policy setting. This is the JSON field name of a top-level Policy field. */ + settingName?: string; + } + interface NonComplianceDetailCondition { + /** The reason the device is not in compliance with the setting. If not set, then this condition matches any reason. */ + nonComplianceReason?: string; + /** The package name indicating which application is out of compliance. If not set, then this condition matches any package name. */ + packageName?: string; + /** The name of the policy setting. This is the JSON field name of a top-level Policy field. If not set, then this condition matches any setting name. */ + settingName?: string; + } + interface Operation { + /** If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some + * services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should + * have the format of operations/some/unique/name. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response + * should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred + * response type is TakeSnapshotResponse. + */ + response?: Record; + } + interface PasswordRequirements { + /** A device will be wiped after too many incorrect device-unlock passwords have been entered. A value of 0 means there is no restriction. */ + maximumFailedPasswordsForWipe?: number; + /** Password expiration timeout. */ + passwordExpirationTimeout?: string; + /** + * The length of the password history. After setting this, the user will not be able to enter a new password that is the same as any password in the + * history. A value of 0 means there is no restriction. + */ + passwordHistoryLength?: number; + /** + * The minimum allowed password length. A value of 0 means there is no restriction. Only enforced when password_quality is NUMERIC, NUMERIC_COMPLEX, + * ALPHABETIC, ALPHANUMERIC, or COMPLEX. + */ + passwordMinimumLength?: number; + /** Minimum number of letters required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumLetters?: number; + /** Minimum number of lower case letters required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumLowerCase?: number; + /** Minimum number of non-letter characters (numerical digits or symbols) required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumNonLetter?: number; + /** Minimum number of numerical digits required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumNumeric?: number; + /** Minimum number of symbols required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumSymbols?: number; + /** Minimum number of upper case letters required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumUpperCase?: number; + /** The required password quality. */ + passwordQuality?: string; + } + interface PermissionGrant { + /** The android permission, e.g. android.permission.READ_CALENDAR. */ + permission?: string; + /** The policy for granting the permission. */ + policy?: string; + } + interface PersistentPreferredActivity { + /** + * The intent actions to match in the filter. If any actions are included in the filter, then an intent's action must be one of those values for it to + * match. If no actions are included, the intent action is ignored. + */ + actions?: string[]; + /** + * The intent categories to match in the filter. An intent includes the categories that it requires, all of which must be included in the filter in order + * to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent. + */ + categories?: string[]; + /** + * The activity that should be the default intent handler. This should be an Android component name, e.g. com.android.enterprise.app/.MainActivity. + * Alternatively, the value may be the package name of an app, which causes Android Device Policy to choose an appropriate activity from the app to handle + * the intent. + */ + receiverActivity?: string; + } + interface Policy { + /** Whether adding new users and profiles is disabled. */ + addUserDisabled?: boolean; + /** Whether adjusting the master volume is disabled. */ + adjustVolumeDisabled?: boolean; + /** Policy applied to apps. */ + applications?: ApplicationPolicy[]; + /** Whether auto time is required, which prevents the user from manually setting the date and time. */ + autoTimeRequired?: boolean; + /** + * Whether applications other than the ones configured in applications are blocked from being installed. When set, applications that were installed under + * a previous policy but no longer appear in the policy are automatically uninstalled. + */ + blockApplicationsEnabled?: boolean; + /** Whether all cameras on the device are disabled. */ + cameraDisabled?: boolean; + /** + * Rules declaring which mitigating actions to take when a device is not compliant with its policy. When the conditions for multiple rules are satisfied, + * all of the mitigating actions for the rules are taken. There is a maximum limit of 100 rules. + */ + complianceRules?: ComplianceRule[]; + /** Whether the user is allowed to enable debugging features. */ + debuggingFeaturesAllowed?: boolean; + /** The default permission policy for requests for runtime permissions. */ + defaultPermissionPolicy?: string; + /** Whether factory resetting from settings is disabled. */ + factoryResetDisabled?: boolean; + /** + * Email addresses of device administrators for factory reset protection. When the device is factory reset, it will require one of these admins to log in + * with the Google account email and password to unlock the device. If no admins are specified, the device will not provide factory reset protection. + */ + frpAdminEmails?: string[]; + /** Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled. */ + funDisabled?: boolean; + /** Whether the user is allowed to enable the "Unknown Sources" setting, which allows installation of apps from unknown sources. */ + installUnknownSourcesAllowed?: boolean; + /** Whether the keyguard is disabled. */ + keyguardDisabled?: boolean; + /** Maximum time in milliseconds for user activity until the device will lock. A value of 0 means there is no restriction. */ + maximumTimeToLock?: string; + /** Whether adding or removing accounts is disabled. */ + modifyAccountsDisabled?: boolean; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name?: string; + /** + * Whether the network escape hatch is enabled. If a network connection can't be made at boot time, the escape hatch prompts the user to temporarily + * connect to a network in order to refresh the device policy. After applying policy, the temporary network will be forgotten and the device will continue + * booting. This prevents being unable to connect to a network if there is no suitable network in the last policy and the device boots into an app in lock + * task mode, or the user is otherwise unable to reach device settings. + */ + networkEscapeHatchEnabled?: boolean; + /** Network configuration for the device. See configure networks for more information. */ + openNetworkConfiguration?: Record; + /** Password requirements. */ + passwordRequirements?: PasswordRequirements; + /** Default intent handler activities. */ + persistentPreferredActivities?: PersistentPreferredActivity[]; + /** Whether removing other users is disabled. */ + removeUserDisabled?: boolean; + /** Whether rebooting the device into safe boot is disabled. */ + safeBootDisabled?: boolean; + /** Whether screen capture is disabled. */ + screenCaptureDisabled?: boolean; + /** Whether the status bar is disabled. This disables notifications, quick settings and other screen overlays that allow escape from full-screen mode. */ + statusBarDisabled?: boolean; + /** Status reporting settings */ + statusReportingSettings?: StatusReportingSettings; + /** + * The battery plugged in modes for which the device stays on. When using this setting, it is recommended to clear maximum_time_to_lock so that the device + * doesn't lock itself while it stays on. + */ + stayOnPluggedModes?: string[]; + /** + * The system update policy, which controls how OS updates are applied. If the update type is WINDOWED and the device has a device account, the update + * window will automatically apply to Play app updates as well. + */ + systemUpdate?: SystemUpdate; + /** Whether the microphone is muted and adjusting microphone volume is disabled. */ + unmuteMicrophoneDisabled?: boolean; + /** The version of the policy. This is a read-only field. The version is incremented each time the policy is updated. */ + version?: string; + /** Whether configuring WiFi access points is disabled. */ + wifiConfigDisabled?: boolean; + /** Whether WiFi networks defined in Open Network Configuration are locked so they cannot be edited by the user. */ + wifiConfigsLockdownEnabled?: boolean; + } + interface PowerManagementEvent { + /** For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage. */ + batteryLevel?: number; + /** The creation time of the event. */ + createTime?: string; + /** Event type. */ + eventType?: string; + } + interface SignupUrl { + /** The name of the resource. This must be included in the create enterprise request at the end of the signup flow. */ + name?: string; + /** A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe. */ + url?: string; + } + interface SoftwareInfo { + /** Android build Id string meant for displaying to the user, e.g. shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. */ + androidBuildNumber?: string; + /** Build time. */ + androidBuildTime?: string; + /** The user visible Android version string, e.g. 6.0.1. */ + androidVersion?: string; + /** The system bootloader version number, e.g. 0.6.7. */ + bootloaderVersion?: string; + /** Kernel version, e.g. 2.6.32.9-g103d848. */ + deviceKernelVersion?: string; + /** Security patch level, e.g. 2016-05-01. */ + securityPatchLevel?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface StatusReportingSettings { + /** Whether displays reporting is enabled. */ + displayInfoEnabled?: boolean; + /** Whether hardware status reporting is enabled. */ + hardwareStatusEnabled?: boolean; + /** Whether memory info reporting is enabled. */ + memoryInfoEnabled?: boolean; + /** Whether network info reporting is enabled. */ + networkInfoEnabled?: boolean; + /** Whether power management event reporting is enabled. */ + powerManagementEventsEnabled?: boolean; + /** Whether software info reporting is enabled. */ + softwareInfoEnabled?: boolean; + } + interface SystemUpdate { + /** + * If the type is WINDOWED, the end of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be + * between 0 and 1439, inclusive. If this value is less than start_minutes, then the maintenance window spans midnight. If the maintenance window + * specified is smaller than 30 minutes, the actual window is extended to 30 minutes beyond the start time. + */ + endMinutes?: number; + /** + * If the type is WINDOWED, the start of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be + * between 0 and 1439, inclusive. + */ + startMinutes?: number; + /** The type of system update to configure. */ + type?: string; + } + interface UserFacingMessage { + /** + * The default message that gets displayed if no localized message is specified, or the user's locale does not match with any of the localized messages. A + * default message must be provided if any localized messages are provided. + */ + defaultMessage?: string; + /** A map which contains pairs. The locale is a BCP 47 language code, e.g. en-US, es-ES, fr. */ + localizedMessages?: Record; + } + interface WebToken { + /** The name of the web token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. */ + name?: string; + /** + * The URL of the parent frame hosting the iframe with the embedded UI. To prevent XSS, the iframe may not be hosted at other URLs. The URL must use the + * https scheme. + */ + parentFrameUrl?: string; + /** Permissions the admin may exercise in the embedded UI. The admin must have all of these permissions in order to view the UI. */ + permissions?: string[]; + /** The token value which is used in the hosting page to generate the iframe with the embedded UI. This is a read-only field generated by the server. */ + value?: string; + } + interface ApplicationsResource { + /** Gets info about an application. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The preferred language for localized application info, as a BCP47 tag (e.g. "en-US", "de"). If not specified the default language of the application + * will be used. + */ + languageCode?: string; + /** The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If + * the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check + * whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; + * instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name + * binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API + * services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name + * includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection + * id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DevicesResource { + /** Deletes a device, which causes the device to be wiped. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a device. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status + * of the command. + */ + issueCommand(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists devices for a given enterprise. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The requested page size. The actual page size may be fixed to a min or max value. */ + pageSize?: number; + /** A token identifying a page of results the server should return. */ + pageToken?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a device. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The field mask indicating the fields to update. If not set, all modifiable fields will be modified. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + operations: OperationsResource; + } + interface EnrollmentTokensResource { + /** Creates an enrollment token for a given enterprise. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes an enrollment token, which prevents future use of the token. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface PoliciesResource { + /** Deletes a policy. This operation is only permitted if no devices are currently referencing the policy. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a policy. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists policies for a given enterprise. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The requested page size. The actual page size may be fixed to a min or max value. */ + pageSize?: number; + /** A token identifying a page of results the server should return. */ + pageToken?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates or creates a policy. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The field mask indicating the fields to update. If not set, all modifiable fields will be modified. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface WebTokensResource { + /** Creates a web token to access an embeddable managed Google Play web UI for a given enterprise. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface EnterprisesResource { + /** Creates an enterprise by completing the enterprise signup flow. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The enterprise token appended to the callback URL. */ + enterpriseToken?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The id of the Google Cloud Platform project which will own the enterprise. */ + projectId?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the SignupUrl used to sign up for the enterprise. */ + signupUrlName?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets an enterprise. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates an enterprise. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The field mask indicating the fields to update. If not set, all modifiable fields will be modified. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + applications: ApplicationsResource; + devices: DevicesResource; + enrollmentTokens: EnrollmentTokensResource; + policies: PoliciesResource; + webTokens: WebTokensResource; + } + interface SignupUrlsResource { + /** Creates an enterprise signup URL. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The callback URL to which the admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a query + * parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed + * then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes. + */ + callbackUrl?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The id of the Google Cloud Platform project which will own the enterprise. */ + projectId?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.androidmanagement/readme.md b/types/gapi.client.androidmanagement/readme.md new file mode 100644 index 0000000000..e38e2b2653 --- /dev/null +++ b/types/gapi.client.androidmanagement/readme.md @@ -0,0 +1,74 @@ +# TypeScript typings for Android Management API v1 +The Android Management API provides remote enterprise management of Android devices and apps. +For detailed description please check [documentation](https://developers.google.com/android/management). + +## Installing + +Install typings for Android Management API: +``` +npm install @types/gapi.client.androidmanagement@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androidmanagement', 'v1', () => { + // now we can use gapi.client.androidmanagement + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage Android devices and apps for your customers + 'https://www.googleapis.com/auth/androidmanagement', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Android Management API resources: + +```typescript + +/* +Creates an enterprise by completing the enterprise signup flow. +*/ +await gapi.client.enterprises.create({ }); + +/* +Gets an enterprise. +*/ +await gapi.client.enterprises.get({ name: "name", }); + +/* +Updates an enterprise. +*/ +await gapi.client.enterprises.patch({ name: "name", }); + +/* +Creates an enterprise signup URL. +*/ +await gapi.client.signupUrls.create({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.androidmanagement/tsconfig.json b/types/gapi.client.androidmanagement/tsconfig.json new file mode 100644 index 0000000000..3cfbad08e0 --- /dev/null +++ b/types/gapi.client.androidmanagement/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androidmanagement-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androidmanagement/tslint.json b/types/gapi.client.androidmanagement/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androidmanagement/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androidpublisher/gapi.client.androidpublisher-tests.ts b/types/gapi.client.androidpublisher/gapi.client.androidpublisher-tests.ts new file mode 100644 index 0000000000..6dfad512ac --- /dev/null +++ b/types/gapi.client.androidpublisher/gapi.client.androidpublisher-tests.ts @@ -0,0 +1,122 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androidpublisher', 'v2', () => { + /** now we can use gapi.client.androidpublisher */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Google Play Developer account */ + 'https://www.googleapis.com/auth/androidpublisher', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Commits/applies the changes made in this edit back to the app. */ + await gapi.client.edits.commit({ + editId: "editId", + packageName: "packageName", + }); + /** + * Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to + * preemptively abandon an edit. + */ + await gapi.client.edits.delete({ + editId: "editId", + packageName: "packageName", + }); + /** Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). */ + await gapi.client.edits.get({ + editId: "editId", + packageName: "packageName", + }); + /** Creates a new edit for an app, populated with the app's current state. */ + await gapi.client.edits.insert({ + packageName: "packageName", + }); + /** Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. */ + await gapi.client.edits.validate({ + editId: "editId", + packageName: "packageName", + }); + /** Lists the user's current inapp item or subscription entitlements */ + await gapi.client.entitlements.list({ + maxResults: 1, + packageName: "packageName", + productId: "productId", + startIndex: 4, + token: "token", + }); + await gapi.client.inappproducts.batch({ + }); + /** Delete an in-app product for an app. */ + await gapi.client.inappproducts.delete({ + packageName: "packageName", + sku: "sku", + }); + /** Returns information about the in-app product specified. */ + await gapi.client.inappproducts.get({ + packageName: "packageName", + sku: "sku", + }); + /** Creates a new in-app product for an app. */ + await gapi.client.inappproducts.insert({ + autoConvertMissingPrices: true, + packageName: "packageName", + }); + /** List all the in-app products for an Android app, both subscriptions and managed in-app products.. */ + await gapi.client.inappproducts.list({ + maxResults: 1, + packageName: "packageName", + startIndex: 3, + token: "token", + }); + /** Updates the details of an in-app product. This method supports patch semantics. */ + await gapi.client.inappproducts.patch({ + autoConvertMissingPrices: true, + packageName: "packageName", + sku: "sku", + }); + /** Updates the details of an in-app product. */ + await gapi.client.inappproducts.update({ + autoConvertMissingPrices: true, + packageName: "packageName", + sku: "sku", + }); + /** Returns a single review. */ + await gapi.client.reviews.get({ + packageName: "packageName", + reviewId: "reviewId", + translationLanguage: "translationLanguage", + }); + /** Returns a list of reviews. Only reviews from last week will be returned. */ + await gapi.client.reviews.list({ + maxResults: 1, + packageName: "packageName", + startIndex: 3, + token: "token", + translationLanguage: "translationLanguage", + }); + /** Reply to a single review, or update an existing reply. */ + await gapi.client.reviews.reply({ + packageName: "packageName", + reviewId: "reviewId", + }); + } +}); diff --git a/types/gapi.client.androidpublisher/index.d.ts b/types/gapi.client.androidpublisher/index.d.ts new file mode 100644 index 0000000000..beae0fb512 --- /dev/null +++ b/types/gapi.client.androidpublisher/index.d.ts @@ -0,0 +1,2062 @@ +// Type definitions for Google Google Play Developer API v2 2.0 +// Project: https://developers.google.com/android-publisher +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/androidpublisher/v2/rest + +/// + +declare namespace gapi.client { + /** Load Google Play Developer API v2 */ + function load(name: "androidpublisher", version: "v2"): PromiseLike; + function load(name: "androidpublisher", version: "v2", callback: () => any): void; + + const edits: androidpublisher.EditsResource; + + const entitlements: androidpublisher.EntitlementsResource; + + const inappproducts: androidpublisher.InappproductsResource; + + const purchases: androidpublisher.PurchasesResource; + + const reviews: androidpublisher.ReviewsResource; + + namespace androidpublisher { + interface Apk { + /** Information about the binary payload of this APK. */ + binary?: ApkBinary; + /** The version code of the APK, as specified in the APK's manifest file. */ + versionCode?: number; + } + interface ApkBinary { + /** A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command. */ + sha1?: string; + /** A sha256 hash of the APK payload, encoded as a hex string and matching the output of the sha256sum command. */ + sha256?: string; + } + interface ApkListing { + /** The language code, in BCP 47 format (eg "en-US"). */ + language?: string; + /** Describe what's new in your APK. */ + recentChanges?: string; + } + interface ApkListingsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apkListingsListResponse". */ + kind?: string; + listings?: ApkListing[]; + } + interface ApksAddExternallyHostedRequest { + /** The definition of the externally-hosted APK and where it is located. */ + externallyHostedApk?: ExternallyHostedApk; + } + interface ApksAddExternallyHostedResponse { + /** The definition of the externally-hosted APK and where it is located. */ + externallyHostedApk?: ExternallyHostedApk; + } + interface ApksListResponse { + apks?: Apk[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apksListResponse". */ + kind?: string; + } + interface AppDetails { + /** The user-visible support email for this app. */ + contactEmail?: string; + /** The user-visible support telephone number for this app. */ + contactPhone?: string; + /** The user-visible website for this app. */ + contactWebsite?: string; + /** Default language code, in BCP 47 format (eg "en-US"). */ + defaultLanguage?: string; + } + interface AppEdit { + /** The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). */ + expiryTimeSeconds?: string; + /** The ID of the edit that can be used in subsequent API calls. */ + id?: string; + } + interface Comment { + /** A comment from a developer. */ + developerComment?: DeveloperComment; + /** A comment from a user. */ + userComment?: UserComment; + } + interface DeobfuscationFile { + /** The type of the deobfuscation file. */ + symbolType?: string; + } + interface DeobfuscationFilesUploadResponse { + deobfuscationFile?: DeobfuscationFile; + } + interface DeveloperComment { + /** The last time at which this comment was updated. */ + lastModified?: Timestamp; + /** The content of the comment, i.e. reply body. */ + text?: string; + } + interface DeviceMetadata { + /** Device CPU make e.g. "Qualcomm" */ + cpuMake?: string; + /** Device CPU model e.g. "MSM8974" */ + cpuModel?: string; + /** Device class (e.g. tablet) */ + deviceClass?: string; + /** OpenGL version */ + glEsVersion?: number; + /** Device manufacturer (e.g. Motorola) */ + manufacturer?: string; + /** Comma separated list of native platforms (e.g. "arm", "arm7") */ + nativePlatform?: string; + /** Device model name (e.g. Droid) */ + productName?: string; + /** Device RAM in Megabytes e.g. "2048" */ + ramMb?: number; + /** Screen density in DPI */ + screenDensityDpi?: number; + /** Screen height in pixels */ + screenHeightPx?: number; + /** Screen width in pixels */ + screenWidthPx?: number; + } + interface Entitlement { + /** This kind represents an entitlement object in the androidpublisher service. */ + kind?: string; + /** The SKU of the product. */ + productId?: string; + /** + * The type of the inapp product. Possible values are: + * - In-app item: "inapp" + * - Subscription: "subs" + */ + productType?: string; + /** The token which can be verified using the subscriptions or products API. */ + token?: string; + } + interface EntitlementsListResponse { + pageInfo?: PageInfo; + resources?: Entitlement[]; + tokenPagination?: TokenPagination; + } + interface ExpansionFile { + /** + * If set this field indicates that this APK has an Expansion File uploaded to it: this APK does not reference another APK's Expansion File. The field's + * value is the size of the uploaded Expansion File in bytes. + */ + fileSize?: string; + /** If set this APK's Expansion File references another APK's Expansion File. The file_size field will not be set. */ + referencesVersion?: number; + } + interface ExpansionFilesUploadResponse { + expansionFile?: ExpansionFile; + } + interface ExternallyHostedApk { + /** The application label. */ + applicationLabel?: string; + /** A certificate (or array of certificates if a certificate-chain is used) used to signed this APK, represented as a base64 encoded byte array. */ + certificateBase64s?: string[]; + /** The URL at which the APK is hosted. This must be an https URL. */ + externallyHostedUrl?: string; + /** The SHA1 checksum of this APK, represented as a base64 encoded byte array. */ + fileSha1Base64?: string; + /** The SHA256 checksum of this APK, represented as a base64 encoded byte array. */ + fileSha256Base64?: string; + /** The file size in bytes of this APK. */ + fileSize?: string; + /** The icon image from the APK, as a base64 encoded byte array. */ + iconBase64?: string; + /** The maximum SDK supported by this APK (optional). */ + maximumSdk?: number; + /** The minimum SDK targeted by this APK. */ + minimumSdk?: number; + /** The native code environments supported by this APK (optional). */ + nativeCodes?: string[]; + /** The package name. */ + packageName?: string; + /** The features required by this APK (optional). */ + usesFeatures?: string[]; + /** The permissions requested by this APK. */ + usesPermissions?: ExternallyHostedApkUsesPermission[]; + /** The version code of this APK. */ + versionCode?: number; + /** The version name of this APK. */ + versionName?: string; + } + interface ExternallyHostedApkUsesPermission { + /** Optionally, the maximum SDK version for which the permission is required. */ + maxSdkVersion?: number; + /** The name of the permission requested. */ + name?: string; + } + interface Image { + /** A unique id representing this image. */ + id?: string; + /** A sha1 hash of the image that was uploaded. */ + sha1?: string; + /** A URL that will serve a preview of the image. */ + url?: string; + } + interface ImagesDeleteAllResponse { + deleted?: Image[]; + } + interface ImagesListResponse { + images?: Image[]; + } + interface ImagesUploadResponse { + image?: Image; + } + interface InAppProduct { + /** The default language of the localized data, as defined by BCP 47. e.g. "en-US", "en-GB". */ + defaultLanguage?: string; + /** Default price cannot be zero. In-app products can never be free. Default price is always in the developer's Checkout merchant currency. */ + defaultPrice?: Price; + /** List of localized title and description data. */ + listings?: Record; + /** The package name of the parent app. */ + packageName?: string; + /** Prices per buyer region. None of these prices should be zero. In-app products can never be free. */ + prices?: Record; + /** Purchase type enum value. Unmodifiable after creation. */ + purchaseType?: string; + /** Definition of a season for a seasonal subscription. Can be defined only for yearly subscriptions. */ + season?: Season; + /** The stock-keeping-unit (SKU) of the product, unique within an app. */ + sku?: string; + status?: string; + /** + * Subscription period, specified in ISO 8601 format. Acceptable values are "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), + * and "P1Y" (one year). + */ + subscriptionPeriod?: string; + /** + * Trial period, specified in ISO 8601 format. Acceptable values are anything between "P7D" (seven days) and "P999D" (999 days). Seasonal subscriptions + * cannot have a trial period. + */ + trialPeriod?: string; + } + interface InAppProductListing { + description?: string; + title?: string; + } + interface InappproductsBatchRequest { + entrys?: InappproductsBatchRequestEntry[]; + } + interface InappproductsBatchRequestEntry { + batchId?: number; + inappproductsinsertrequest?: InappproductsInsertRequest; + inappproductsupdaterequest?: InappproductsUpdateRequest; + methodName?: string; + } + interface InappproductsBatchResponse { + entrys?: InappproductsBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsBatchResponse". */ + kind?: string; + } + interface InappproductsBatchResponseEntry { + batchId?: number; + inappproductsinsertresponse?: InappproductsInsertResponse; + inappproductsupdateresponse?: InappproductsUpdateResponse; + } + interface InappproductsInsertRequest { + inappproduct?: InAppProduct; + } + interface InappproductsInsertResponse { + inappproduct?: InAppProduct; + } + interface InappproductsListResponse { + inappproduct?: InAppProduct[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsListResponse". */ + kind?: string; + pageInfo?: PageInfo; + tokenPagination?: TokenPagination; + } + interface InappproductsUpdateRequest { + inappproduct?: InAppProduct; + } + interface InappproductsUpdateResponse { + inappproduct?: InAppProduct; + } + interface Listing { + /** Full description of the app; this may be up to 4000 characters in length. */ + fullDescription?: string; + /** Language localization code (for example, "de-AT" for Austrian German). */ + language?: string; + /** Short description of the app (previously known as promo text); this may be up to 80 characters in length. */ + shortDescription?: string; + /** App's localized title. */ + title?: string; + /** URL of a promotional YouTube video for the app. */ + video?: string; + } + interface ListingsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#listingsListResponse". */ + kind?: string; + listings?: Listing[]; + } + interface MonthDay { + /** Day of a month, value in [1, 31] range. Valid range depends on the specified month. */ + day?: number; + /** Month of a year. e.g. 1 = JAN, 2 = FEB etc. */ + month?: number; + } + interface PageInfo { + resultPerPage?: number; + startIndex?: number; + totalResults?: number; + } + interface Price { + /** 3 letter Currency code, as defined by ISO 4217. */ + currency?: string; + /** The price in millionths of the currency base unit represented as a string. */ + priceMicros?: string; + } + interface ProductPurchase { + /** + * The consumption state of the inapp product. Possible values are: + * - Yet to be consumed + * - Consumed + */ + consumptionState?: number; + /** A developer-specified string that contains supplemental information about an order. */ + developerPayload?: string; + /** This kind represents an inappPurchase object in the androidpublisher service. */ + kind?: string; + /** The order id associated with the purchase of the inapp product. */ + orderId?: string; + /** + * The purchase state of the order. Possible values are: + * - Purchased + * - Cancelled + */ + purchaseState?: number; + /** The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). */ + purchaseTimeMillis?: string; + } + interface Prorate { + /** + * Default price cannot be zero and must be less than the full subscription price. Default price is always in the developer's Checkout merchant currency. + * Targeted countries have their prices set automatically based on the default_price. + */ + defaultPrice?: Price; + /** Defines the first day on which the price takes effect. */ + start?: MonthDay; + } + interface Review { + /** The name of the user who wrote the review. */ + authorName?: string; + /** A repeated field containing comments for the review. */ + comments?: Comment[]; + /** Unique identifier for this review. */ + reviewId?: string; + } + interface ReviewReplyResult { + /** The time at which the reply took effect. */ + lastEdited?: Timestamp; + /** The reply text that was applied. */ + replyText?: string; + } + interface ReviewsListResponse { + pageInfo?: PageInfo; + reviews?: Review[]; + tokenPagination?: TokenPagination; + } + interface ReviewsReplyRequest { + /** The text to set as the reply. Replies of more than approximately 350 characters will be rejected. HTML tags will be stripped. */ + replyText?: string; + } + interface ReviewsReplyResponse { + result?: ReviewReplyResult; + } + interface Season { + /** Inclusive end date of the recurrence period. */ + end?: MonthDay; + /** + * Optionally present list of prorations for the season. Each proration is a one-off discounted entry into a subscription. Each proration contains the + * first date on which the discount is available and the new pricing information. + */ + prorations?: Prorate[]; + /** Inclusive start date of the recurrence period. */ + start?: MonthDay; + } + interface SubscriptionDeferralInfo { + /** + * The desired next expiry time to assign to the subscription, in milliseconds since the Epoch. The given time must be later/greater than the current + * expiry time for the subscription. + */ + desiredExpiryTimeMillis?: string; + /** + * The expected expiry time for the subscription. If the current expiry time for the subscription is not the value specified here, the deferral will not + * occur. + */ + expectedExpiryTimeMillis?: string; + } + interface SubscriptionPurchase { + /** Whether the subscription will automatically be renewed when it reaches its current expiry time. */ + autoRenewing?: boolean; + /** + * The reason why a subscription was cancelled or is not auto-renewing. Possible values are: + * - User cancelled the subscription + * - Subscription was cancelled by the system, for example because of a billing problem + * - Subscription was replaced with a new subscription + */ + cancelReason?: number; + /** ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. */ + countryCode?: string; + /** A developer-specified string that contains supplemental information about an order. */ + developerPayload?: string; + /** Time at which the subscription will expire, in milliseconds since the Epoch. */ + expiryTimeMillis?: string; + /** This kind represents a subscriptionPurchase object in the androidpublisher service. */ + kind?: string; + /** The order id of the latest recurring order associated with the purchase of the subscription. */ + orderId?: string; + /** + * The payment state of the subscription. Possible values are: + * - Payment pending + * - Payment received + * - Free trial + */ + paymentState?: number; + /** + * Price of the subscription, not including tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For + * example, if the subscription price is €1.99, price_amount_micros is 1990000. + */ + priceAmountMicros?: string; + /** ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". */ + priceCurrencyCode?: string; + /** Time at which the subscription was granted, in milliseconds since the Epoch. */ + startTimeMillis?: string; + /** The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. */ + userCancellationTimeMillis?: string; + } + interface SubscriptionPurchasesDeferRequest { + /** The information about the new desired expiry time for the subscription. */ + deferralInfo?: SubscriptionDeferralInfo; + } + interface SubscriptionPurchasesDeferResponse { + /** The new expiry time for the subscription in milliseconds since the Epoch. */ + newExpiryTimeMillis?: string; + } + interface Testers { + googleGroups?: string[]; + googlePlusCommunities?: string[]; + } + interface Timestamp { + nanos?: number; + seconds?: string; + } + interface TokenPagination { + nextPageToken?: string; + previousPageToken?: string; + } + interface Track { + track?: string; + userFraction?: number; + versionCodes?: number[]; + } + interface TracksListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#tracksListResponse". */ + kind?: string; + tracks?: Track[]; + } + interface UserComment { + /** Integer Android SDK version of the user's device at the time the review was written, e.g. 23 is Marshmallow. May be absent. */ + androidOsVersion?: number; + /** Integer version code of the app as installed at the time the review was written. May be absent. */ + appVersionCode?: number; + /** String version name of the app as installed at the time the review was written. May be absent. */ + appVersionName?: string; + /** Codename for the reviewer's device, e.g. klte, flounder. May be absent. */ + device?: string; + /** Some information about the characteristics of the user's device */ + deviceMetadata?: DeviceMetadata; + /** The last time at which this comment was updated. */ + lastModified?: Timestamp; + /** Untranslated text of the review, in the case where the review has been translated. If the review has not been translated this is left blank. */ + originalText?: string; + /** + * Language code for the reviewer. This is taken from the device settings so is not guaranteed to match the language the review is written in. May be + * absent. + */ + reviewerLanguage?: string; + /** The star rating associated with the review, from 1 to 5. */ + starRating?: number; + /** + * The content of the comment, i.e. review body. In some cases users have been able to write a review with separate title and body; in those cases the + * title and body are concatenated and separated by a tab character. + */ + text?: string; + /** Number of users who have given this review a thumbs down */ + thumbsDownCount?: number; + /** Number of users who have given this review a thumbs up */ + thumbsUpCount?: number; + } + interface VoidedPurchase { + /** This kind represents a voided purchase object in the androidpublisher service. */ + kind?: string; + /** The time at which the purchase was made, in milliseconds since the epoch (Jan 1, 1970). */ + purchaseTimeMillis?: string; + /** The token that was generated when a purchase was made. This uniquely identifies a purchase. */ + purchaseToken?: string; + /** The time at which the purchase was cancelled/refunded/charged-back, in milliseconds since the epoch (Jan 1, 1970). */ + voidedTimeMillis?: string; + } + interface VoidedPurchasesListResponse { + pageInfo?: PageInfo; + tokenPagination?: TokenPagination; + voidedPurchases?: VoidedPurchase[]; + } + interface ApklistingsResource { + /** Deletes the APK-specific localized listing for a specified APK and language code. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes all the APK-specific localized listings for a specified APK. */ + deleteall(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetches the APK-specific localized listing for a specified APK and language code. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the APK-specific localized listings for a specified APK. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates or creates the APK-specific localized listing for a specified APK and language code. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ApksResource { + /** + * Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to + * enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain. + */ + addexternallyhosted(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + upload(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DeobfuscationfilesResource { + /** Uploads the deobfuscation file of the specified APK. If a deobfuscation file already exists, it will be replaced. */ + upload(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose deobfuscation file is being uploaded. */ + apkVersionCode: number; + deobfuscationFileType: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DetailsResource { + /** Fetches app details for this edit. This includes the default language and developer support contact information. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates app details for this edit. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates app details for this edit. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ExpansionfilesResource { + /** Fetches the Expansion File configuration for the APK specified. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This + * method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Uploads and attaches a new Expansion File to the APK specified. */ + upload(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ImagesResource { + /** Deletes the image (specified by id) from the edit. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Unique identifier an image within the set of images attached to this edit. */ + imageId: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes all images for the specified language and image type. */ + deleteall(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all images for the specified language and image type. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Uploads a new image and adds it to the list of images for the specified language and image type. */ + upload(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ListingsResource { + /** Deletes the specified localized store listing from an edit. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes all localized listings from an edit. */ + deleteall(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetches information about a localized store listing. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns all of the localized store listings attached to this edit. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates or updates a localized store listing. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates or updates a localized store listing. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TestersResource { + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TracksResource { + /** Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The track type to read or modify. */ + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the track configurations for this edit. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new + * APKs will cause it to resume. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The track type to read or modify. */ + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new + * APKs will cause it to resume. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The track type to read or modify. */ + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EditsResource { + /** Commits/applies the changes made in this edit back to the app. */ + commit(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to + * preemptively abandon an edit. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new edit for an app, populated with the app's current state. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. */ + validate(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + apklistings: ApklistingsResource; + apks: ApksResource; + deobfuscationfiles: DeobfuscationfilesResource; + details: DetailsResource; + expansionfiles: ExpansionfilesResource; + images: ImagesResource; + listings: ListingsResource; + testers: TestersResource; + tracks: TracksResource; + } + interface EntitlementsResource { + /** Lists the user's current inapp item or subscription entitlements */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application the inapp product was sold in (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The product id of the inapp product (for example, 'sku1'). This can be used to restrict the result set. */ + productId?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InappproductsResource { + batch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete an in-app product for an app. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns information about the in-app product specified. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new in-app product for an app. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the + * target currency based on the default price. Defaults to false. + */ + autoConvertMissingPrices?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all the in-app products for an Android app, both subscriptions and managed in-app products.. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with in-app products; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the details of an in-app product. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the + * target currency based on the default price. Defaults to false. + */ + autoConvertMissingPrices?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the details of an in-app product. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the + * target currency based on the default price. Defaults to false. + */ + autoConvertMissingPrices?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** Checks the purchase and consumption status of an inapp item. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application the inapp product was sold in (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The inapp product SKU (for example, 'com.some.thing.inapp1'). */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token provided to the user's device when the inapp product was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SubscriptionsResource { + /** Cancels a user's subscription purchase. The subscription remains valid until its expiration time. */ + cancel(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Defers a user's subscription purchase until a specified future expiration time. */ + defer(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Checks whether a user's subscription purchase is valid and returns its expiry time. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur. */ + refund(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring. */ + revoke(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VoidedpurchasesResource { + /** Lists the purchases that were cancelled, refunded or charged-back. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * The time, in milliseconds since the Epoch, of the newest voided in-app product purchase that you want to see in the response. The value of this + * parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is + * applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + /** + * The time, in milliseconds since the Epoch, of the oldest voided in-app product purchase that you want to see in the response. The value of this + * parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is + * applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + */ + startTime?: string; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PurchasesResource { + products: ProductsResource; + subscriptions: SubscriptionsResource; + voidedpurchases: VoidedpurchasesResource; + } + interface ReviewsResource { + /** Returns a single review. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + reviewId: string; + translationLanguage?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a list of reviews. Only reviews from last week will be returned. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + translationLanguage?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Reply to a single review, or update an existing reply. */ + reply(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + reviewId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.androidpublisher/readme.md b/types/gapi.client.androidpublisher/readme.md new file mode 100644 index 0000000000..a4bbff05c0 --- /dev/null +++ b/types/gapi.client.androidpublisher/readme.md @@ -0,0 +1,134 @@ +# TypeScript typings for Google Play Developer API v2 +Lets Android application developers access their Google Play accounts. +For detailed description please check [documentation](https://developers.google.com/android-publisher). + +## Installing + +Install typings for Google Play Developer API: +``` +npm install @types/gapi.client.androidpublisher@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androidpublisher', 'v2', () => { + // now we can use gapi.client.androidpublisher + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Google Play Developer account + 'https://www.googleapis.com/auth/androidpublisher', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Play Developer API resources: + +```typescript + +/* +Commits/applies the changes made in this edit back to the app. +*/ +await gapi.client.edits.commit({ editId: "editId", packageName: "packageName", }); + +/* +Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit. +*/ +await gapi.client.edits.delete({ editId: "editId", packageName: "packageName", }); + +/* +Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). +*/ +await gapi.client.edits.get({ editId: "editId", packageName: "packageName", }); + +/* +Creates a new edit for an app, populated with the app's current state. +*/ +await gapi.client.edits.insert({ packageName: "packageName", }); + +/* +Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. +*/ +await gapi.client.edits.validate({ editId: "editId", packageName: "packageName", }); + +/* +Lists the user's current inapp item or subscription entitlements +*/ +await gapi.client.entitlements.list({ packageName: "packageName", }); + +/* +undefined +*/ +await gapi.client.inappproducts.batch({ }); + +/* +Delete an in-app product for an app. +*/ +await gapi.client.inappproducts.delete({ packageName: "packageName", sku: "sku", }); + +/* +Returns information about the in-app product specified. +*/ +await gapi.client.inappproducts.get({ packageName: "packageName", sku: "sku", }); + +/* +Creates a new in-app product for an app. +*/ +await gapi.client.inappproducts.insert({ packageName: "packageName", }); + +/* +List all the in-app products for an Android app, both subscriptions and managed in-app products.. +*/ +await gapi.client.inappproducts.list({ packageName: "packageName", }); + +/* +Updates the details of an in-app product. This method supports patch semantics. +*/ +await gapi.client.inappproducts.patch({ packageName: "packageName", sku: "sku", }); + +/* +Updates the details of an in-app product. +*/ +await gapi.client.inappproducts.update({ packageName: "packageName", sku: "sku", }); + +/* +Returns a single review. +*/ +await gapi.client.reviews.get({ packageName: "packageName", reviewId: "reviewId", }); + +/* +Returns a list of reviews. Only reviews from last week will be returned. +*/ +await gapi.client.reviews.list({ packageName: "packageName", }); + +/* +Reply to a single review, or update an existing reply. +*/ +await gapi.client.reviews.reply({ packageName: "packageName", reviewId: "reviewId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.androidpublisher/tsconfig.json b/types/gapi.client.androidpublisher/tsconfig.json new file mode 100644 index 0000000000..6f724fe172 --- /dev/null +++ b/types/gapi.client.androidpublisher/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androidpublisher-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androidpublisher/tslint.json b/types/gapi.client.androidpublisher/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androidpublisher/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.appengine/gapi.client.appengine-tests.ts b/types/gapi.client.appengine/gapi.client.appengine-tests.ts new file mode 100644 index 0000000000..221a648770 --- /dev/null +++ b/types/gapi.client.appengine/gapi.client.appengine-tests.ts @@ -0,0 +1,64 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('appengine', 'v1', () => { + /** now we can use gapi.client.appengine */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your applications deployed on Google App Engine */ + 'https://www.googleapis.com/auth/appengine.admin', + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Creates an App Engine application for a Google Cloud Platform project. Required fields: + * id - The ID of the target Cloud Platform project. + * location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about + * App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/). + */ + await gapi.client.apps.create({ + }); + /** Gets information about an application. */ + await gapi.client.apps.get({ + appsId: "appsId", + }); + /** + * Updates the specified Application resource. You can update the following fields: + * auth_domain - Google authentication domain for controlling user access to the application. + * default_cookie_expiration - Cookie expiration policy for the application. + */ + await gapi.client.apps.patch({ + appsId: "appsId", + updateMask: "updateMask", + }); + /** + * Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. + * Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. + */ + await gapi.client.apps.repair({ + appsId: "appsId", + }); + } +}); diff --git a/types/gapi.client.appengine/index.d.ts b/types/gapi.client.appengine/index.d.ts new file mode 100644 index 0000000000..2b97368fb5 --- /dev/null +++ b/types/gapi.client.appengine/index.d.ts @@ -0,0 +1,2263 @@ +// Type definitions for Google Google App Engine Admin API v1 1.0 +// Project: https://cloud.google.com/appengine/docs/admin-api/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://appengine.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google App Engine Admin API v1 */ + function load(name: "appengine", version: "v1"): PromiseLike; + function load(name: "appengine", version: "v1", callback: () => any): void; + + const apps: appengine.AppsResource; + + namespace appengine { + interface ApiConfigHandler { + /** Action to take when users access resources that require authentication. Defaults to redirect. */ + authFailAction?: string; + /** Level of login required to access this resource. Defaults to optional. */ + login?: string; + /** Path to the script from the application root directory. */ + script?: string; + /** Security (HTTPS) enforcement for this URL. */ + securityLevel?: string; + /** URL to serve the endpoint at. */ + url?: string; + } + interface ApiEndpointHandler { + /** Path to the script from the application root directory. */ + scriptPath?: string; + } + interface Application { + /** Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. */ + authDomain?: string; + /** + * Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can + * be used by the gcloud deployment commands.@OutputOnly + */ + codeBucket?: string; + /** Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly */ + defaultBucket?: string; + /** Cookie expiration policy for this application. */ + defaultCookieExpiration?: string; + /** Hostname used to reach this application, as resolved by App Engine.@OutputOnly */ + defaultHostname?: string; + /** + * HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 + * dispatch rules can be supported.@OutputOnly + */ + dispatchRules?: UrlDispatchRule[]; + /** The feature specific settings to be used in the application. */ + featureSettings?: FeatureSettings; + /** The Google Container Registry domain used for storing managed build docker images for this application. */ + gcrDomain?: string; + iap?: IdentityAwareProxy; + /** + * Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy + * your application. Example: myapp. + */ + id?: string; + /** + * Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of + * the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern + * US + */ + locationId?: string; + /** Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly */ + name?: string; + /** Serving status of this application. */ + servingStatus?: string; + } + interface AuthorizedCertificate { + /** The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority. */ + certificateRawData?: CertificateRawData; + /** The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate. */ + displayName?: string; + /** + * Aggregate count of the domain mappings with this certificate mapped. This count includes domain mappings on applications for which the user does not + * have VIEWER permissions.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + */ + domainMappingsCount?: number; + /** Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly */ + domainNames?: string[]; + /** + * The time when this certificate expires. To update the renewal time on this certificate, upload an SSL certificate with a different expiration time + * using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly + */ + expireTime?: string; + /** Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 12345.@OutputOnly */ + id?: string; + /** Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly */ + name?: string; + /** + * The full paths to user visible Domain Mapping resources that have this certificate mapped. Example: apps/myapp/domainMappings/example.com.This may not + * represent the full list of mapped domain mappings if the user does not have VIEWER permissions on all of the applications that have this certificate + * mapped. See domain_mappings_count for a complete count.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE + * option.@OutputOnly + */ + visibleDomainMappings?: string[]; + } + interface AuthorizedDomain { + /** Fully qualified domain name of the domain authorized for use. Example: example.com. */ + id?: string; + /** Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly */ + name?: string; + } + interface AutomaticScaling { + /** + * Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. + * Only applicable for VM runtimes. + */ + coolDownPeriod?: string; + /** Target scaling by CPU usage. */ + cpuUtilization?: CpuUtilization; + /** Target scaling by disk usage. */ + diskUtilization?: DiskUtilization; + /** Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value. */ + maxConcurrentRequests?: number; + /** Maximum number of idle instances that should be maintained for this version. */ + maxIdleInstances?: number; + /** Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it. */ + maxPendingLatency?: string; + /** Maximum number of instances that should be started to handle requests. */ + maxTotalInstances?: number; + /** Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a service. */ + minIdleInstances?: number; + /** Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it. */ + minPendingLatency?: string; + /** Minimum number of instances that should be maintained for this version. */ + minTotalInstances?: number; + /** Target scaling by network usage. */ + networkUtilization?: NetworkUtilization; + /** Target scaling by request utilization. */ + requestUtilization?: RequestUtilization; + } + interface BasicScaling { + /** Duration of time after the last request that an instance must wait before the instance is shut down. */ + idleTimeout?: string; + /** Maximum number of instances to create for this version. */ + maxInstances?: number; + } + interface BatchUpdateIngressRulesRequest { + /** A list of FirewallRules to replace the existing set. */ + ingressRules?: FirewallRule[]; + } + interface BatchUpdateIngressRulesResponse { + /** The full list of ingress FirewallRules for this application. */ + ingressRules?: FirewallRule[]; + } + interface CertificateRawData { + /** + * Unencrypted PEM encoded RSA private key. This field is set once on certificate creation and then encrypted. The key size must be 2048 bits or fewer. + * Must include the header and footer. Example:
 -----BEGIN RSA PRIVATE KEY-----  -----END RSA PRIVATE KEY----- 
+ * @InputOnly + */ + privateKey?: string; + /** + * PEM encoded x.509 public key certificate. This field is set once on certificate creation. Must include the header and footer. Example:
 -----BEGIN
+             * CERTIFICATE-----  -----END CERTIFICATE----- 
+ */ + publicCertificate?: string; + } + interface ContainerInfo { + /** + * URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: + * "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + */ + image?: string; + } + interface CpuUtilization { + /** Period of time over which CPU utilization is calculated. */ + aggregationWindowLength?: string; + /** Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1. */ + targetUtilization?: number; + } + interface DebugInstanceRequest { + /** + * Public SSH key to add to the instance. Examples: + * [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] + * [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For more information, see Adding and Removing SSH Keys + * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + sshKey?: string; + } + interface Deployment { + /** The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment. */ + container?: ContainerInfo; + /** + * Manifest of the files stored in Google Cloud Storage that are included as part of this version. All files must be readable using the credentials + * supplied with this call. + */ + files?: Record; + /** The zip file for this deployment, if this is a zip deployment. */ + zip?: ZipInfo; + } + interface DiskUtilization { + /** Target bytes read per second. */ + targetReadBytesPerSecond?: number; + /** Target ops read per seconds. */ + targetReadOpsPerSecond?: number; + /** Target bytes written per second. */ + targetWriteBytesPerSecond?: number; + /** Target ops written per second. */ + targetWriteOpsPerSecond?: number; + } + interface DomainMapping { + /** Relative name of the domain serving the application. Example: example.com. */ + id?: string; + /** Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly */ + name?: string; + /** + * The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the + * application via this domain mapping.@OutputOnly + */ + resourceRecords?: ResourceRecord[]; + /** SSL configuration for this domain. If unconfigured, this domain will not serve with SSL. */ + sslSettings?: SslSettings; + } + interface EndpointsApiService { + /** Endpoints service configuration id as specified by the Service Management API. For example "2016-09-19r1" */ + configId?: string; + /** Endpoints service name which is the name of the "service" resource in the Service Management API. For example "myapi.endpoints.myproject.cloud.goog" */ + name?: string; + } + interface ErrorHandler { + /** Error condition this handler applies to. */ + errorCode?: string; + /** MIME type of file. Defaults to text/html. */ + mimeType?: string; + /** Static file content to be served for this error. */ + staticFile?: string; + } + interface FeatureSettings { + /** + * Boolean value indicating if split health checks should be used instead of the legacy health checks. At an app.yaml level, this means defaulting to + * 'readiness_check' and 'liveness_check' values instead of 'health_check' ones. Once the legacy 'health_check' behavior is deprecated, and this value is + * always true, this setting can be removed. + */ + splitHealthChecks?: boolean; + } + interface FileInfo { + /** The MIME type of the file.Defaults to the value from Google Cloud Storage. */ + mimeType?: string; + /** The SHA1 hash of the file, in hex. */ + sha1Sum?: string; + /** + * URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com//'. + */ + sourceUrl?: string; + } + interface FirewallRule { + /** The action to take on matched requests. */ + action?: string; + /** An optional string description of this rule. This field has a maximum length of 100 characters. */ + description?: string; + /** + * A positive integer between 1, Int32.MaxValue-1 that defines the order of rule evaluation. Rules with the lowest priority are evaluated first.A default + * rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic when no previous rule matches. Only the action of this rule can be modified by the + * user. + */ + priority?: number; + /** + * IP address or range, defined using CIDR notation, of requests that this rule applies to. You can use the wildcard character "*" to match all IPs + * equivalent to "0/0" and "::/0" together. Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or + * 2001:0db8:0000:0042:0000:8a2e:0370:7334.

Truncation will be silently performed on addresses which are not properly truncated. For example, 1.2.3.4/24 + * is accepted as the same address as 1.2.3.0/24. Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as 2001:db8::/32. + */ + sourceRange?: string; + } + interface HealthCheck { + /** Interval between health checks. */ + checkInterval?: string; + /** Whether to explicitly disable health checks for this instance. */ + disableHealthCheck?: boolean; + /** Number of consecutive successful health checks required before receiving traffic. */ + healthyThreshold?: number; + /** Host header to send when performing an HTTP health check. Example: "myapp.appspot.com" */ + host?: string; + /** Number of consecutive failed health checks required before an instance is restarted. */ + restartThreshold?: number; + /** Time before the health check is considered failed. */ + timeout?: string; + /** Number of consecutive failed health checks required before removing traffic. */ + unhealthyThreshold?: number; + } + interface IdentityAwareProxy { + /** + * Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields + * must be non-empty. + */ + enabled?: boolean; + /** OAuth2 client ID to use for the authentication flow. */ + oauth2ClientId?: string; + /** + * OAuth2 client secret to use for the authentication flow.For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of + * the value is returned in the oauth2_client_secret_sha256 field.@InputOnly + */ + oauth2ClientSecret?: string; + /** Hex-encoded SHA-256 hash of the client secret.@OutputOnly */ + oauth2ClientSecretSha256?: string; + } + interface Instance { + /** App Engine release this instance is running on.@OutputOnly */ + appEngineRelease?: string; + /** Availability of the instance.@OutputOnly */ + availability?: string; + /** Average latency (ms) over the last minute.@OutputOnly */ + averageLatency?: number; + /** Number of errors since this instance was started.@OutputOnly */ + errors?: number; + /** Relative name of the instance within the version. Example: instance-1.@OutputOnly */ + id?: string; + /** Total memory in use (bytes).@OutputOnly */ + memoryUsage?: string; + /** Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly */ + name?: string; + /** Average queries per second (QPS) over the last minute.@OutputOnly */ + qps?: number; + /** Number of requests since this instance was started.@OutputOnly */ + requests?: number; + /** Time that this instance was started.@OutputOnly */ + startTime?: string; + /** Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmDebugEnabled?: boolean; + /** Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmId?: string; + /** The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmIp?: string; + /** Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmName?: string; + /** Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmStatus?: string; + /** Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmZoneName?: string; + } + interface Library { + /** Name of the library. Example: "django". */ + name?: string; + /** Version of the library to select, or "latest". */ + version?: string; + } + interface ListAuthorizedCertificatesResponse { + /** The SSL certificates the user is authorized to administer. */ + certificates?: AuthorizedCertificate[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListAuthorizedDomainsResponse { + /** The authorized domains belonging to the user. */ + domains?: AuthorizedDomain[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListDomainMappingsResponse { + /** The domain mappings for the application. */ + domainMappings?: DomainMapping[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListIngressRulesResponse { + /** The ingress FirewallRules for this application. */ + ingressRules?: FirewallRule[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListInstancesResponse { + /** The instances belonging to the requested version. */ + instances?: Instance[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface ListServicesResponse { + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + /** The services belonging to the requested application. */ + services?: Service[]; + } + interface ListVersionsResponse { + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + /** The versions belonging to the requested service. */ + versions?: Version[]; + } + interface LivenessCheck { + /** Interval between health checks. */ + checkInterval?: string; + /** Number of consecutive failed checks required before considering the VM unhealthy. */ + failureThreshold?: number; + /** Host header to send when performing a HTTP Liveness check. Example: "myapp.appspot.com" */ + host?: string; + /** The initial delay before starting to execute the checks. */ + initialDelay?: string; + /** The request path. */ + path?: string; + /** Number of consecutive successful checks required before considering the VM healthy. */ + successThreshold?: number; + /** Time before the check is considered failed. */ + timeout?: string; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: "us-east1". */ + locationId?: string; + /** Service-specific metadata. For example the available capacity at the given location. */ + metadata?: Record; + /** Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1" */ + name?: string; + } + interface LocationMetadata { + /** App Engine Flexible Environment is available in the given location.@OutputOnly */ + flexibleEnvironmentAvailable?: boolean; + /** App Engine Standard Environment is available in the given location.@OutputOnly */ + standardEnvironmentAvailable?: boolean; + } + interface ManualScaling { + /** + * Number of instances to assign to the service at the start. This number can later be altered by using the Modules API + * (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function. + */ + instances?: number; + } + interface Network { + /** + * List of ports, or port pairs, to forward from the virtual machine to the application container. Only applicable for App Engine flexible environment + * versions. + */ + forwardedPorts?: string[]; + /** Tag to apply to the VM instance during creation. Only applicable for for App Engine flexible environment versions. */ + instanceTag?: string; + /** Google Compute Engine network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default. */ + name?: string; + /** + * Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is + * specified, a network name will also be required unless it is for the default network. + * If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. + * If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) + * and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. + * If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is + * created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the App Engine flexible environment + * application. + */ + subnetworkName?: string; + } + interface NetworkUtilization { + /** Target bytes received per second. */ + targetReceivedBytesPerSecond?: number; + /** Target packets received per second. */ + targetReceivedPacketsPerSecond?: number; + /** Target bytes sent per second. */ + targetSentBytesPerSecond?: number; + /** Target packets sent per second. */ + targetSentPacketsPerSecond?: number; + } + interface Operation { + /** If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some + * services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should + * have the format of operations/some/unique/name. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response + * should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred + * response type is TakeSnapshotResponse. + */ + response?: Record; + } + interface OperationMetadata { + /** Timestamp that this operation completed.@OutputOnly */ + endTime?: string; + /** Timestamp that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1beta4.Version.CreateVersion.@OutputOnly */ + method?: string; + /** Type of this operation. Deprecated, use method field instead. Example: "create_version".@OutputOnly */ + operationType?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + } + interface OperationMetadataExperimental { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.experimental.CustomDomains.CreateCustomDomain.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + } + interface OperationMetadataV1 { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Ephemeral message that may change every time the operation is polled. @OutputOnly */ + ephemeralMessage?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + /** Durable messages that persist on every operation poll. @OutputOnly */ + warning?: string[]; + } + interface OperationMetadataV1Alpha { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Ephemeral message that may change every time the operation is polled. @OutputOnly */ + ephemeralMessage?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + /** Durable messages that persist on every operation poll. @OutputOnly */ + warning?: string[]; + } + interface OperationMetadataV1Beta { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Ephemeral message that may change every time the operation is polled. @OutputOnly */ + ephemeralMessage?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1beta.Versions.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + /** Durable messages that persist on every operation poll. @OutputOnly */ + warning?: string[]; + } + interface OperationMetadataV1Beta5 { + /** Timestamp that this operation completed.@OutputOnly */ + endTime?: string; + /** Timestamp that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + } + interface ReadinessCheck { + /** + * A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to + * serve traffic. + */ + appStartTimeout?: string; + /** Interval between health checks. */ + checkInterval?: string; + /** Number of consecutive failed checks required before removing traffic. */ + failureThreshold?: number; + /** Host header to send when performing a HTTP Readiness check. Example: "myapp.appspot.com" */ + host?: string; + /** The request path. */ + path?: string; + /** Number of consecutive successful checks required before receiving traffic. */ + successThreshold?: number; + /** Time before the check is considered failed. */ + timeout?: string; + } + interface RequestUtilization { + /** Target number of concurrent requests. */ + targetConcurrentRequests?: number; + /** Target requests per second. */ + targetRequestCountPerSecond?: number; + } + interface ResourceRecord { + /** Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'. */ + name?: string; + /** Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). */ + rrdata?: string; + /** Resource record type. Example: AAAA. */ + type?: string; + } + interface Resources { + /** Number of CPU cores needed. */ + cpu?: number; + /** Disk size (GB) needed. */ + diskGb?: number; + /** Memory (GB) needed. */ + memoryGb?: number; + /** User specified volumes. */ + volumes?: Volume[]; + } + interface ScriptHandler { + /** Path to the script from the application root directory. */ + scriptPath?: string; + } + interface Service { + /** Relative name of the service within the application. Example: default.@OutputOnly */ + id?: string; + /** Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly */ + name?: string; + /** Mapping that defines fractional HTTP traffic diversion to different versions within the service. */ + split?: TrafficSplit; + } + interface SslSettings { + /** ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support. Example: 12345. */ + certificateId?: string; + } + interface StaticFilesHandler { + /** + * Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served + * to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas. + */ + applicationReadable?: boolean; + /** Time a static file served by this handler should be cached by web proxies and browsers. */ + expiration?: string; + /** HTTP headers to use for all responses from these URLs. */ + httpHeaders?: Record; + /** MIME type used to serve all files served by this handler.Defaults to file-specific MIME types, which are derived from each file's filename extension. */ + mimeType?: string; + /** + * Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL + * pattern. + */ + path?: string; + /** Whether this handler should match the request if the file referenced by the handler does not exist. */ + requireMatchingFile?: boolean; + /** Regular expression that matches the file paths for all files that should be referenced by this handler. */ + uploadPathRegex?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TrafficSplit { + /** + * Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, + * but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service + * is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up + * to three decimal places is supported for cookie-based splits. + */ + allocations?: Record; + /** + * Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are + * changed. + */ + shardBy?: string; + } + interface UrlDispatchRule { + /** Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". */ + domain?: string; + /** + * Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path.The sum of the lengths of the domain and path may + * not exceed 100 characters. + */ + path?: string; + /** Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default. */ + service?: string; + } + interface UrlMap { + /** Uses API Endpoints to handle requests. */ + apiEndpoint?: ApiEndpointHandler; + /** Action to take when users access resources that require authentication. Defaults to redirect. */ + authFailAction?: string; + /** Level of login required to access this resource. */ + login?: string; + /** 30x code to use when performing redirects for the secure field. Defaults to 302. */ + redirectHttpResponseCode?: string; + /** Executes a script to handle the request that matches this URL pattern. */ + script?: ScriptHandler; + /** Security (HTTPS) enforcement for this URL. */ + securityLevel?: string; + /** Returns the contents of a file, such as an image, as the response. */ + staticFiles?: StaticFilesHandler; + /** + * URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that + * begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path. + */ + urlRegex?: string; + } + interface Version { + /** + * Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL + * is set. + */ + apiConfig?: ApiConfigHandler; + /** Automatic scaling is based on request rate, response latencies, and other application metrics. */ + automaticScaling?: AutomaticScaling; + /** + * A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by user activity. + */ + basicScaling?: BasicScaling; + /** Metadata settings that are supplied to this version to enable beta runtime features. */ + betaSettings?: Record; + /** Time that this version was created.@OutputOnly */ + createTime?: string; + /** Email address of the user who created this version.@OutputOnly */ + createdBy?: string; + /** + * Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration + * time.Only returned in GET requests if view=FULL is set. + */ + defaultExpiration?: string; + /** Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set. */ + deployment?: Deployment; + /** Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly */ + diskUsageBytes?: string; + /** + * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API + * implemented by the app. + */ + endpointsApiService?: EndpointsApiService; + /** App Engine execution environment for this version.Defaults to standard. */ + env?: string; + /** Environment variables available to the application.Only returned in GET requests if view=FULL is set. */ + envVariables?: Record; + /** Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. */ + errorHandlers?: ErrorHandler[]; + /** + * An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request + * handlers are not attempted.Only returned in GET requests if view=FULL is set. + */ + handlers?: UrlMap[]; + /** + * Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only + * returned in GET requests if view=FULL is set. + */ + healthCheck?: HealthCheck; + /** + * Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: + * "default", "latest", and any name with the prefix "ah-". + */ + id?: string; + /** Before an application can receive email or XMPP messages, the application must be configured to enable the service. */ + inboundServices?: string[]; + /** + * Instance class that is used to run this version. Valid values are: + * AutomaticScaling: F1, F2, F4, F4_1G + * ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. + */ + instanceClass?: string; + /** Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set. */ + libraries?: Library[]; + /** + * Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if + * view=FULL is set. + */ + livenessCheck?: LivenessCheck; + /** A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. */ + manualScaling?: ManualScaling; + /** Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly */ + name?: string; + /** Extra network settings. Only applicable for App Engine flexible environment versions. */ + network?: Network; + /** Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. */ + nobuildFilesRegex?: string; + /** + * Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests + * if view=FULL is set. + */ + readinessCheck?: ReadinessCheck; + /** Machine resources for this version. Only applicable for VM runtimes. */ + resources?: Resources; + /** Desired runtime. Example: python27. */ + runtime?: string; + /** + * The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at + * https://cloud.google.com/appengine/docs/standard//config/appref + */ + runtimeApiVersion?: string; + /** + * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an + * invalid value. Defaults to SERVING. + */ + servingStatus?: string; + /** Whether multiple requests can be dispatched to this version at once. */ + threadsafe?: boolean; + /** Serving URL for this version. Example: "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly */ + versionUrl?: string; + /** Whether to deploy this version in a container on a virtual machine. */ + vm?: boolean; + } + interface Volume { + /** Unique name for the volume. */ + name?: string; + /** Volume size in gigabytes. */ + sizeGb?: number; + /** Underlying volume type, e.g. 'tmpfs'. */ + volumeType?: string; + } + interface ZipInfo { + /** + * An estimate of the number of files in a zip for a zip deployment. If set, must be greater than or equal to the actual number of files. Used for + * optimizing performance; if not provided, deployment may be slow. + */ + filesCount?: number; + /** + * URL of the zip file to deploy from. Must be a URL to a resource in Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com//'. + */ + sourceUrl?: string; + } + interface AuthorizedCertificatesResource { + /** Uploads the specified SSL certificate. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the specified SSL certificate. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. */ + appsId: string; + /** Part of `name`. See documentation of `appsId`. */ + authorizedCertificatesId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets the specified SSL certificate. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. */ + appsId: string; + /** Part of `name`. See documentation of `appsId`. */ + authorizedCertificatesId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Controls the set of fields returned in the GET response. */ + view?: string; + }): Request; + /** Lists all SSL certificates the user is authorized to administer. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Controls the set of fields returned in the LIST response. */ + view?: string; + }): Request; + /** + * Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new + * certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. */ + appsId: string; + /** Part of `name`. See documentation of `appsId`. */ + authorizedCertificatesId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface AuthorizedDomainsResource { + /** Lists all domains the user is authorized to administer. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DomainMappingsResource { + /** + * Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available + * authorized domains, see AuthorizedDomains.ListAuthorizedDomains. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Part of `name`. See documentation of `appsId`. */ + domainMappingsId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets the specified domain mapping. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Part of `name`. See documentation of `appsId`. */ + domainMappingsId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists the domain mappings on an application. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate + * resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Part of `name`. See documentation of `appsId`. */ + domainMappingsId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface IngressRulesResource { + /** + * Replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules.If the + * final rule does not match traffic with the '*' wildcard IP range, then an "allow all" rule is explicitly added to the end of the list. + */ + batchUpdate(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Creates a firewall rule for the application. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the specified firewall rule. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + ingressRulesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets the specified firewall rule. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + ingressRulesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists the firewall rules of an application. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from + * this IP. + */ + matchingAddress?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates the specified firewall rule. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + ingressRulesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FirewallResource { + ingressRules: IngressRulesResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Resource name for the location. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Part of `name`. See documentation of `appsId`. */ + locationsId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. The resource that owns the locations collection, if applicable. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. The name of the operation resource. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Part of `name`. See documentation of `appsId`. */ + operationsId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name + * binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API + * services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name + * includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection + * id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. The name of the operation's parent resource. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface InstancesResource { + /** + * Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug + * mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over + * and determine if another instance should be started.Only applicable for instances in App Engine flexible environment. + */ + debug(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + instancesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** Stops a running instance. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + instancesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** Gets instance information. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + instancesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** + * Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API + * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `parent`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `parent`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + } + interface VersionsResource { + /** Deploys code and resource files to a new version. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `parent`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes an existing Version resource. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + /** Controls the set of fields returned in the Get response. */ + view?: string; + }): Request; + /** Lists the versions of a service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `parent`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Controls the set of fields returned in the List response. */ + view?: string; + }): Request; + /** + * Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the + * version resource uses: + * serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version + * resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. + * instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version + * resources that run in the App Engine standard environment. + * automatic_scaling.min_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine standard environment. + * automatic_scaling.max_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine standard environment. + * automatic_scaling.min_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + * automatic_scaling.max_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + * automatic_scaling.cool_down_period_sec + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + * automatic_scaling.cpu_utilization.target_utilization + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + instances: InstancesResource; + } + interface ServicesResource { + /** Deletes the specified service and all enclosed versions. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets the current configuration of the specified service. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the services in the application. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates the configuration of the specified service. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic + * migration, the target versions must be located within instances that are configured for both warmup requests + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and automatic scaling + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the shardBy + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is + * not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic + * (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + */ + migrateTraffic?: boolean; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + versions: VersionsResource; + } + interface AppsResource { + /** + * Creates an App Engine application for a Google Cloud Platform project. Required fields: + * id - The ID of the target Cloud Platform project. + * location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about + * App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets information about an application. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Application resource to get. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified Application resource. You can update the following fields: + * auth_domain - Google authentication domain for controlling user access to the application. + * default_cookie_expiration - Cookie expiration policy for the application. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Application resource to update. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. + * Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. + */ + repair(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the application to repair. Example: apps/myapp */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + authorizedCertificates: AuthorizedCertificatesResource; + authorizedDomains: AuthorizedDomainsResource; + domainMappings: DomainMappingsResource; + firewall: FirewallResource; + locations: LocationsResource; + operations: OperationsResource; + services: ServicesResource; + } + } +} diff --git a/types/gapi.client.appengine/readme.md b/types/gapi.client.appengine/readme.md new file mode 100644 index 0000000000..c038ebf322 --- /dev/null +++ b/types/gapi.client.appengine/readme.md @@ -0,0 +1,84 @@ +# TypeScript typings for Google App Engine Admin API v1 +The App Engine Admin API enables developers to provision and manage their App Engine applications. +For detailed description please check [documentation](https://cloud.google.com/appengine/docs/admin-api/). + +## Installing + +Install typings for Google App Engine Admin API: +``` +npm install @types/gapi.client.appengine@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('appengine', 'v1', () => { + // now we can use gapi.client.appengine + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your applications deployed on Google App Engine + 'https://www.googleapis.com/auth/appengine.admin', + + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google App Engine Admin API resources: + +```typescript + +/* +Creates an App Engine application for a Google Cloud Platform project. Required fields: +id - The ID of the target Cloud Platform project. +location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/). +*/ +await gapi.client.apps.create({ }); + +/* +Gets information about an application. +*/ +await gapi.client.apps.get({ appsId: "appsId", }); + +/* +Updates the specified Application resource. You can update the following fields: +auth_domain - Google authentication domain for controlling user access to the application. +default_cookie_expiration - Cookie expiration policy for the application. +*/ +await gapi.client.apps.patch({ appsId: "appsId", }); + +/* +Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. +*/ +await gapi.client.apps.repair({ appsId: "appsId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.appengine/tsconfig.json b/types/gapi.client.appengine/tsconfig.json new file mode 100644 index 0000000000..0af2b9eade --- /dev/null +++ b/types/gapi.client.appengine/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.appengine-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.appengine/tslint.json b/types/gapi.client.appengine/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.appengine/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.appsactivity/gapi.client.appsactivity-tests.ts b/types/gapi.client.appsactivity/gapi.client.appsactivity-tests.ts new file mode 100644 index 0000000000..aa972684b8 --- /dev/null +++ b/types/gapi.client.appsactivity/gapi.client.appsactivity-tests.ts @@ -0,0 +1,54 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('appsactivity', 'v1', () => { + /** now we can use gapi.client.appsactivity */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View the activity history of your Google apps */ + 'https://www.googleapis.com/auth/activity', + /** View and manage the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive', + /** View and manage metadata of files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata', + /** View metadata for files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata.readonly', + /** View the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was + * acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is + * scoped to activities from a given Google service using the source parameter. + */ + await gapi.client.activities.list({ + "drive.ancestorId": "drive.ancestorId", + "drive.fileId": "drive.fileId", + groupingStrategy: "groupingStrategy", + pageSize: 4, + pageToken: "pageToken", + source: "source", + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.appsactivity/index.d.ts b/types/gapi.client.appsactivity/index.d.ts new file mode 100644 index 0000000000..e8c9c49f18 --- /dev/null +++ b/types/gapi.client.appsactivity/index.d.ts @@ -0,0 +1,168 @@ +// Type definitions for Google G Suite Activity API v1 1.0 +// Project: https://developers.google.com/google-apps/activity/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/appsactivity/v1/rest + +/// + +declare namespace gapi.client { + /** Load G Suite Activity API v1 */ + function load(name: "appsactivity", version: "v1"): PromiseLike; + function load(name: "appsactivity", version: "v1", callback: () => any): void; + + const activities: appsactivity.ActivitiesResource; + + namespace appsactivity { + interface Activity { + /** The fields common to all of the singleEvents that make up the Activity. */ + combinedEvent?: Event; + /** A list of all the Events that make up the Activity. */ + singleEvents?: Event[]; + } + interface Event { + /** + * Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document, + * renaming it, and sharing it may be part of a single file-creation event. + */ + additionalEventTypes?: string[]; + /** The time at which the event occurred formatted as Unix time in milliseconds. */ + eventTimeMillis?: string; + /** Whether this event is caused by a user being deleted. */ + fromUserDeletion?: boolean; + /** Extra information for move type events, such as changes in an object's parents. */ + move?: Move; + /** Extra information for permissionChange type events, such as the user or group the new permission applies to. */ + permissionChanges?: PermissionChange[]; + /** The main type of event that occurred. */ + primaryEventType?: string; + /** Extra information for rename type events, such as the old and new names. */ + rename?: Rename; + /** Information specific to the Target object modified by the event. */ + target?: Target; + /** Represents the user responsible for the event. */ + user?: User; + } + interface ListActivitiesResponse { + /** List of activities. */ + activities?: Activity[]; + /** Token for the next page of results. */ + nextPageToken?: string; + } + interface Move { + /** The added parent(s). */ + addedParents?: Parent[]; + /** The removed parent(s). */ + removedParents?: Parent[]; + } + interface Parent { + /** The parent's ID. */ + id?: string; + /** Whether this is the root folder. */ + isRoot?: boolean; + /** The parent's title. */ + title?: string; + } + interface Permission { + /** The name of the user or group the permission applies to. */ + name?: string; + /** The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. */ + permissionId?: string; + /** Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file. */ + role?: string; + /** Indicates how widely permissions are granted. */ + type?: string; + /** The user's information if the type is USER. */ + user?: User; + /** Whether the permission requires a link to the file. */ + withLink?: boolean; + } + interface PermissionChange { + /** Lists all Permission objects added. */ + addedPermissions?: Permission[]; + /** Lists all Permission objects removed. */ + removedPermissions?: Permission[]; + } + interface Photo { + /** The URL of the photo. */ + url?: string; + } + interface Rename { + /** The new title. */ + newTitle?: string; + /** The old title. */ + oldTitle?: string; + } + interface Target { + /** The ID of the target. For example, in Google Drive, this is the file or folder ID. */ + id?: string; + /** The MIME type of the target. */ + mimeType?: string; + /** The name of the target. For example, in Google Drive, this is the title of the file. */ + name?: string; + } + interface User { + /** A boolean which indicates whether the specified User was deleted. If true, name, photo and permission_id will be omitted. */ + isDeleted?: boolean; + /** Whether the user is the authenticated user. */ + isMe?: boolean; + /** The displayable name of the user. */ + name?: string; + /** + * The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions + * resource. + */ + permissionId?: string; + /** The profile photo of the user. Not present if the user has no profile photo. */ + photo?: Photo; + } + interface ActivitiesResource { + /** + * Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was + * acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is + * scoped to activities from a given Google service using the source parameter. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Identifies the Drive folder containing the items for which to return activities. */ + "drive.ancestorId"?: string; + /** Identifies the Drive item to return activities for. */ + "drive.fileId"?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object. */ + groupingStrategy?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of events to return on a page. The response includes a continuation token if there are more events. */ + pageSize?: number; + /** A token to retrieve a specific page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The Google service from which to return activities. Possible values of source are: + * - drive.google.com + */ + source?: string; + /** Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user. */ + userId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.appsactivity/readme.md b/types/gapi.client.appsactivity/readme.md new file mode 100644 index 0000000000..9f6052ff29 --- /dev/null +++ b/types/gapi.client.appsactivity/readme.md @@ -0,0 +1,71 @@ +# TypeScript typings for G Suite Activity API v1 +Provides a historical view of activity. +For detailed description please check [documentation](https://developers.google.com/google-apps/activity/). + +## Installing + +Install typings for G Suite Activity API: +``` +npm install @types/gapi.client.appsactivity@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('appsactivity', 'v1', () => { + // now we can use gapi.client.appsactivity + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View the activity history of your Google apps + 'https://www.googleapis.com/auth/activity', + + // View and manage the files in your Google Drive + 'https://www.googleapis.com/auth/drive', + + // View and manage metadata of files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata', + + // View metadata for files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata.readonly', + + // View the files in your Google Drive + 'https://www.googleapis.com/auth/drive.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use G Suite Activity API resources: + +```typescript + +/* +Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter. +*/ +await gapi.client.activities.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.appsactivity/tsconfig.json b/types/gapi.client.appsactivity/tsconfig.json new file mode 100644 index 0000000000..0afc87f3ad --- /dev/null +++ b/types/gapi.client.appsactivity/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.appsactivity-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.appsactivity/tslint.json b/types/gapi.client.appsactivity/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.appsactivity/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.appstate/gapi.client.appstate-tests.ts b/types/gapi.client.appstate/gapi.client.appstate-tests.ts new file mode 100644 index 0000000000..d34d46e2ee --- /dev/null +++ b/types/gapi.client.appstate/gapi.client.appstate-tests.ts @@ -0,0 +1,64 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('appstate', 'v1', () => { + /** now we can use gapi.client.appstate */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data for this application */ + 'https://www.googleapis.com/auth/appstate', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a + * conflict error on version mismatch. + */ + await gapi.client.states.clear({ + currentDataVersion: "currentDataVersion", + stateKey: 2, + }); + /** + * Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe + * in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result + * in data loss and data corruption. + */ + await gapi.client.states.delete({ + stateKey: 1, + }); + /** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */ + await gapi.client.states.get({ + stateKey: 1, + }); + /** Lists all the states keys, and optionally the state data. */ + await gapi.client.states.list({ + includeData: true, + }); + /** + * Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face + * of concurrent writes. Maximum per-key size is 128KB. + */ + await gapi.client.states.update({ + currentStateVersion: "currentStateVersion", + stateKey: 2, + }); + } +}); diff --git a/types/gapi.client.appstate/index.d.ts b/types/gapi.client.appstate/index.d.ts new file mode 100644 index 0000000000..9ae6561cb1 --- /dev/null +++ b/types/gapi.client.appstate/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for Google Google App State API v1 1.0 +// Project: https://developers.google.com/games/services/web/api/states +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/appstate/v1/rest + +/// + +declare namespace gapi.client { + /** Load Google App State API v1 */ + function load(name: "appstate", version: "v1"): PromiseLike; + function load(name: "appstate", version: "v1", callback: () => any): void; + + const states: appstate.StatesResource; + + namespace appstate { + interface GetResponse { + /** The current app state version. */ + currentStateVersion?: string; + /** The requested data. */ + data?: string; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse. */ + kind?: string; + /** The key for the data. */ + stateKey?: number; + } + interface ListResponse { + /** The app state data. */ + items?: GetResponse[]; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse. */ + kind?: string; + /** The maximum number of keys allowed for this user. */ + maximumKeyCount?: number; + } + interface UpdateRequest { + /** The new app state data that your application is trying to update with. */ + data?: string; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest. */ + kind?: string; + } + interface WriteResult { + /** The version of the data for this key on the server. */ + currentStateVersion?: string; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult. */ + kind?: string; + /** The written key. */ + stateKey?: number; + } + interface StatesResource { + /** + * Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a + * conflict error on version mismatch. + */ + clear(request: { + /** Data format for the response. */ + alt?: string; + /** The version of the data to be cleared. Version strings are returned by the server. */ + currentDataVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe + * in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result + * in data loss and data corruption. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the states keys, and optionally the state data. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include the full data in addition to the version number */ + includeData?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face + * of concurrent writes. Maximum per-key size is 128KB. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict + * error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter. + */ + currentStateVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.appstate/readme.md b/types/gapi.client.appstate/readme.md new file mode 100644 index 0000000000..a98a3e7942 --- /dev/null +++ b/types/gapi.client.appstate/readme.md @@ -0,0 +1,79 @@ +# TypeScript typings for Google App State API v1 +The Google App State API. +For detailed description please check [documentation](https://developers.google.com/games/services/web/api/states). + +## Installing + +Install typings for Google App State API: +``` +npm install @types/gapi.client.appstate@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('appstate', 'v1', () => { + // now we can use gapi.client.appstate + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data for this application + 'https://www.googleapis.com/auth/appstate', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google App State API resources: + +```typescript + +/* +Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch. +*/ +await gapi.client.states.clear({ stateKey: 1, }); + +/* +Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption. +*/ +await gapi.client.states.delete({ stateKey: 1, }); + +/* +Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. +*/ +await gapi.client.states.get({ stateKey: 1, }); + +/* +Lists all the states keys, and optionally the state data. +*/ +await gapi.client.states.list({ }); + +/* +Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB. +*/ +await gapi.client.states.update({ stateKey: 1, }); +``` \ No newline at end of file diff --git a/types/gapi.client.appstate/tsconfig.json b/types/gapi.client.appstate/tsconfig.json new file mode 100644 index 0000000000..e9b5b7a850 --- /dev/null +++ b/types/gapi.client.appstate/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.appstate-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.appstate/tslint.json b/types/gapi.client.appstate/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.appstate/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.bigquery/gapi.client.bigquery-tests.ts b/types/gapi.client.bigquery/gapi.client.bigquery-tests.ts new file mode 100644 index 0000000000..3bdcc43b1d --- /dev/null +++ b/types/gapi.client.bigquery/gapi.client.bigquery-tests.ts @@ -0,0 +1,202 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('bigquery', 'v2', () => { + /** now we can use gapi.client.bigquery */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data in Google BigQuery */ + 'https://www.googleapis.com/auth/bigquery', + /** Insert data into Google BigQuery */ + 'https://www.googleapis.com/auth/bigquery.insertdata', + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** Manage your data and permissions in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.full_control', + /** View your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_only', + /** Manage your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_write', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying + * deleteContents. Immediately after deletion, you can create another dataset with the same name. + */ + await gapi.client.datasets.delete({ + datasetId: "datasetId", + deleteContents: true, + projectId: "projectId", + }); + /** Returns the dataset specified by datasetID. */ + await gapi.client.datasets.get({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** Creates a new empty dataset. */ + await gapi.client.datasets.insert({ + projectId: "projectId", + }); + /** Lists all datasets in the specified project to which you have been granted the READER dataset role. */ + await gapi.client.datasets.list({ + all: true, + filter: "filter", + maxResults: 3, + pageToken: "pageToken", + projectId: "projectId", + }); + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. This method supports patch semantics. + */ + await gapi.client.datasets.patch({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. + */ + await gapi.client.datasets.update({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** + * Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed + * successfully. Cancelled jobs may still incur costs. + */ + await gapi.client.jobs.cancel({ + jobId: "jobId", + projectId: "projectId", + }); + /** + * Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran + * the job, or have the Is Owner project role. + */ + await gapi.client.jobs.get({ + jobId: "jobId", + projectId: "projectId", + }); + /** Retrieves the results of a query job. */ + await gapi.client.jobs.getQueryResults({ + jobId: "jobId", + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + startIndex: "startIndex", + timeoutMs: 6, + }); + /** Starts a new asynchronous job. Requires the Can View project role. */ + await gapi.client.jobs.insert({ + projectId: "projectId", + }); + /** + * Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in + * reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. + */ + await gapi.client.jobs.list({ + allUsers: true, + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + projection: "projection", + stateFilter: "stateFilter", + }); + /** Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. */ + await gapi.client.jobs.query({ + projectId: "projectId", + }); + /** Returns the email address of the service account for your project used for interactions with Google Cloud KMS. */ + await gapi.client.projects.getServiceAccount({ + projectId: "projectId", + }); + /** Lists all projects to which you have been granted any project role. */ + await gapi.client.projects.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. */ + await gapi.client.tabledata.insertAll({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + /** Retrieves table data from a specified set of rows. Requires the READER dataset role. */ + await gapi.client.tabledata.list({ + datasetId: "datasetId", + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + selectedFields: "selectedFields", + startIndex: "startIndex", + tableId: "tableId", + }); + /** Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. */ + await gapi.client.tables.delete({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + /** + * Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes + * the structure of this table. + */ + await gapi.client.tables.get({ + datasetId: "datasetId", + projectId: "projectId", + selectedFields: "selectedFields", + tableId: "tableId", + }); + /** Creates a new, empty table in the dataset. */ + await gapi.client.tables.insert({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** Lists all tables in the specified dataset. Requires the READER dataset role. */ + await gapi.client.tables.list({ + datasetId: "datasetId", + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + }); + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. This method supports patch semantics. + */ + await gapi.client.tables.patch({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. + */ + await gapi.client.tables.update({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + } +}); diff --git a/types/gapi.client.bigquery/index.d.ts b/types/gapi.client.bigquery/index.d.ts new file mode 100644 index 0000000000..813d668ea7 --- /dev/null +++ b/types/gapi.client.bigquery/index.d.ts @@ -0,0 +1,1810 @@ +// Type definitions for Google BigQuery API v2 2.0 +// Project: https://cloud.google.com/bigquery/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest + +/// + +declare namespace gapi.client { + /** Load BigQuery API v2 */ + function load(name: "bigquery", version: "v2"): PromiseLike; + function load(name: "bigquery", version: "v2", callback: () => any): void; + + const datasets: bigquery.DatasetsResource; + + const jobs: bigquery.JobsResource; + + const projects: bigquery.ProjectsResource; + + const tabledata: bigquery.TabledataResource; + + const tables: bigquery.TablesResource; + + namespace bigquery { + interface BigtableColumn { + /** + * [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text + * strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. + * However, the setting at this level takes precedence if 'encoding' is set at both levels. + */ + encoding?: string; + /** + * [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as + * the column field name and is used as field name in queries. + */ + fieldName?: string; + /** + * [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. + * However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels. + */ + onlyReadLatest?: boolean; + /** + * [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid + * UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field + * name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, + * a valid identifier must be provided as field_name. + */ + qualifierEncoded?: string; + qualifierString?: string; + /** + * [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using + * the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can + * also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels. + */ + type?: string; + } + interface BigtableColumnFamily { + /** + * [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier + * matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field. + */ + columns?: BigtableColumn[]; + /** + * [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text + * strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing + * that column in 'columns' and specifying an encoding for it. + */ + encoding?: string; + /** Identifier of the column family. */ + familyId?: string; + /** + * [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific + * column by listing that column in 'columns' and specifying a different setting for that column. + */ + onlyReadLatest?: boolean; + /** + * [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when + * using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This + * can be overridden for a specific column by listing that column in 'columns' and specifying a type for it. + */ + type?: string; + } + interface BigtableOptions { + /** + * [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced + * in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this + * list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced + * in that query are read from Bigtable. + */ + columnFamilies?: BigtableColumnFamily[]; + /** + * [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, + * they are read with BYTES type values. The default value is false. + */ + ignoreUnspecifiedColumnFamilies?: boolean; + /** + * [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and + * users need to manually cast them with CAST if necessary. The default value is false. + */ + readRowkeyAsString?: boolean; + } + interface CsvOptions { + /** + * [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as + * null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is + * returned in the job result. The default value is false. + */ + allowJaggedRows?: boolean; + /** [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false. */ + allowQuotedNewlines?: boolean; + /** + * [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data + * after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. + */ + encoding?: string; + /** + * [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded + * string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a + * comma (','). + */ + fieldDelimiter?: string; + /** + * [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first + * byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted + * sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines + * property to true. + */ + quote?: string; + /** + * [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful + * if you have header rows in the file that should be skipped. + */ + skipLeadingRows?: string; + } + interface Dataset { + /** + * [Optional] An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in + * order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following + * entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: + * projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER; + */ + access?: Array<{ + /** [Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: "example.com". */ + domain?: string; + /** [Pick one] An email address of a Google Group to grant access to. */ + groupByEmail?: string; + /** + * [Required] Describes the rights granted to the user specified by the other member of the access object. The following string values are supported: + * READER, WRITER, OWNER. + */ + role?: string; + /** + * [Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the + * enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users. + */ + specialGroup?: string; + /** [Pick one] An email address of a user to grant access to. For example: fred@example.com. */ + userByEmail?: string; + /** + * [Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The + * role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update + * operation. + */ + view?: TableReference; + }>; + /** [Output-only] The time when this dataset was created, in milliseconds since the epoch. */ + creationTime?: string; + /** [Required] A reference that identifies the dataset. */ + datasetReference?: DatasetReference; + /** + * [Optional] The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property + * is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and + * changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted + * automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating + * a table, that value takes precedence over the default expiration time indicated by this property. + */ + defaultTableExpirationMs?: string; + /** [Optional] A user-friendly description of the dataset. */ + description?: string; + /** [Output-only] A hash of the resource. */ + etag?: string; + /** [Optional] A descriptive name for the dataset. */ + friendlyName?: string; + /** + * [Output-only] The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in + * the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field. + */ + id?: string; + /** [Output-only] The resource type. */ + kind?: string; + /** + * The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a + * dataset. See Labeling Datasets for more information. + */ + labels?: Record; + /** [Output-only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch. */ + lastModifiedTime?: string; + /** The geographic location where the dataset should reside. Possible values include EU and US. The default value is US. */ + location?: string; + /** [Output-only] A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource. */ + selfLink?: string; + } + interface DatasetList { + /** + * An array of the dataset resources in the project. Each resource contains basic information. For full information about a particular dataset resource, + * use the Datasets: get method. This property is omitted when there are no datasets in the project. + */ + datasets?: Array<{ + /** The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID. */ + datasetReference?: DatasetReference; + /** A descriptive name for the dataset, if one exists. */ + friendlyName?: string; + /** The fully-qualified, unique, opaque ID of the dataset. */ + id?: string; + /** The resource type. This property always returns the value "bigquery#dataset". */ + kind?: string; + /** The labels associated with this dataset. You can use these to organize and group your datasets. */ + labels?: Record; + }>; + /** A hash value of the results page. You can use this property to determine if the page has changed since the last request. */ + etag?: string; + /** The list type. This property always returns the value "bigquery#datasetList". */ + kind?: string; + /** A token that can be used to request the next results page. This property is omitted on the final results page. */ + nextPageToken?: string; + } + interface DatasetReference { + /** + * [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The + * maximum length is 1,024 characters. + */ + datasetId?: string; + /** [Optional] The ID of the project containing this dataset. */ + projectId?: string; + } + interface EncryptionConfiguration { + /** + * [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with + * your project requires access to this encryption key. + */ + kmsKeyName?: string; + } + interface ErrorProto { + /** Debugging information. This property is internal to Google and should not be used. */ + debugInfo?: string; + /** Specifies where the error occurred, if present. */ + location?: string; + /** A human-readable description of the error. */ + message?: string; + /** A short error code that summarizes the error. */ + reason?: string; + } + interface ExplainQueryStage { + /** Milliseconds the average shard spent on CPU-bound tasks. */ + computeMsAvg?: string; + /** Milliseconds the slowest shard spent on CPU-bound tasks. */ + computeMsMax?: string; + /** Relative amount of time the average shard spent on CPU-bound tasks. */ + computeRatioAvg?: number; + /** Relative amount of time the slowest shard spent on CPU-bound tasks. */ + computeRatioMax?: number; + /** Unique ID for stage within plan. */ + id?: string; + /** Human-readable name for stage. */ + name?: string; + /** Milliseconds the average shard spent reading input. */ + readMsAvg?: string; + /** Milliseconds the slowest shard spent reading input. */ + readMsMax?: string; + /** Relative amount of time the average shard spent reading input. */ + readRatioAvg?: number; + /** Relative amount of time the slowest shard spent reading input. */ + readRatioMax?: number; + /** Number of records read into the stage. */ + recordsRead?: string; + /** Number of records written by the stage. */ + recordsWritten?: string; + /** Total number of bytes written to shuffle. */ + shuffleOutputBytes?: string; + /** Total number of bytes written to shuffle and spilled to disk. */ + shuffleOutputBytesSpilled?: string; + /** Current status for the stage. */ + status?: string; + /** List of operations within the stage in dependency order (approximately chronological). */ + steps?: ExplainQueryStep[]; + /** Milliseconds the average shard spent waiting to be scheduled. */ + waitMsAvg?: string; + /** Milliseconds the slowest shard spent waiting to be scheduled. */ + waitMsMax?: string; + /** Relative amount of time the average shard spent waiting to be scheduled. */ + waitRatioAvg?: number; + /** Relative amount of time the slowest shard spent waiting to be scheduled. */ + waitRatioMax?: number; + /** Milliseconds the average shard spent on writing output. */ + writeMsAvg?: string; + /** Milliseconds the slowest shard spent on writing output. */ + writeMsMax?: string; + /** Relative amount of time the average shard spent on writing output. */ + writeRatioAvg?: number; + /** Relative amount of time the slowest shard spent on writing output. */ + writeRatioMax?: number; + } + interface ExplainQueryStep { + /** Machine-readable operation type. */ + kind?: string; + /** Human-readable stage descriptions. */ + substeps?: string[]; + } + interface ExternalDataConfiguration { + /** Try to detect schema and format options automatically. Any option specified explicitly will be honored. */ + autodetect?: boolean; + /** [Optional] Additional options if sourceFormat is set to BIGTABLE. */ + bigtableOptions?: BigtableOptions; + /** + * [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for + * Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats. + */ + compression?: string; + /** Additional properties to set if sourceFormat is set to CSV. */ + csvOptions?: CsvOptions; + /** [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS. */ + googleSheetsOptions?: GoogleSheetsOptions; + /** + * [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If + * false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. + * The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that + * don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This + * setting is ignored. + */ + ignoreUnknownValues?: boolean; + /** + * [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid + * error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud + * Bigtable, Google Cloud Datastore backups and Avro formats. + */ + maxBadRecords?: number; + /** + * [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore + * backups, and Avro formats. + */ + schema?: TableSchema; + /** + * [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify + * "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Beta] For Google Cloud + * Bigtable, specify "BIGTABLE". + */ + sourceFormat?: string; + /** + * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard + * character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: + * Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore + * backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed. + */ + sourceUris?: string[]; + } + interface GetQueryResultsResponse { + /** Whether the query result was fetched from the query cache. */ + cacheHit?: boolean; + /** + * [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the + * process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. + */ + errors?: ErrorProto[]; + /** A hash of this response. */ + etag?: string; + /** Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available. */ + jobComplete?: boolean; + /** + * Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case + * GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages + * can be fetched via the same mechanism (GetQueryResults). + */ + jobReference?: JobReference; + /** The resource type of the response. */ + kind?: string; + /** [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. */ + numDmlAffectedRows?: string; + /** A token used for paging results. */ + pageToken?: string; + /** + * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults + * and specify the jobReference returned above. Present only when the query completes successfully. + */ + rows?: TableRow[]; + /** The schema of the results. Present only when the query completes successfully. */ + schema?: TableSchema; + /** The total number of bytes processed for this query. */ + totalBytesProcessed?: string; + /** + * The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when + * the query completes successfully. + */ + totalRows?: string; + } + interface GetServiceAccountResponse { + /** The service account email address. */ + email?: string; + /** The resource type of the response. */ + kind?: string; + } + interface GoogleSheetsOptions { + /** + * [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if + * you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to + * detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * + * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - + * Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract + * column names for the detected schema. + */ + skipLeadingRows?: string; + } + interface Job { + /** [Required] Describes the job configuration. */ + configuration?: JobConfiguration; + /** [Output-only] A hash of this resource. */ + etag?: string; + /** [Output-only] Opaque ID field of the job */ + id?: string; + /** [Optional] Reference describing the unique-per-user name of the job. */ + jobReference?: JobReference; + /** [Output-only] The type of the resource. */ + kind?: string; + /** [Output-only] A URL that can be used to access this resource again. */ + selfLink?: string; + /** [Output-only] Information about the job, including starting time and ending time of the job. */ + statistics?: JobStatistics; + /** [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete. */ + status?: JobStatus; + /** [Output-only] Email address of the user who ran the job. */ + user_email?: string; + } + interface JobCancelResponse { + /** The final state of the job. */ + job?: Job; + /** The resource type of the response. */ + kind?: string; + } + interface JobConfiguration { + /** [Pick one] Copies a table. */ + copy?: JobConfigurationTableCopy; + /** + * [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid + * query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined. + */ + dryRun?: boolean; + /** [Pick one] Configures an extract job. */ + extract?: JobConfigurationExtract; + /** + * [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 + * characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are + * optional. Label keys must start with a letter and each label in the list must have a different key. + */ + labels?: Record; + /** [Pick one] Configures a load job. */ + load?: JobConfigurationLoad; + /** [Pick one] Configures a query job. */ + query?: JobConfigurationQuery; + } + interface JobConfigurationExtract { + /** [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE. */ + compression?: string; + /** + * [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or + * repeated fields cannot be exported as CSV. + */ + destinationFormat?: string; + /** + * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted + * table should be written. + */ + destinationUri?: string; + /** [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written. */ + destinationUris?: string[]; + /** [Optional] Delimiter to use between fields in the exported data. Default is ',' */ + fieldDelimiter?: string; + /** [Optional] Whether to print out a header row in the results. Default is true. */ + printHeader?: boolean; + /** [Required] A reference to the table being exported. */ + sourceTable?: TableReference; + } + interface JobConfigurationLoad { + /** + * [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing + * columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. + * Only applicable to CSV, ignored for other formats. + */ + allowJaggedRows?: boolean; + /** Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false. */ + allowQuotedNewlines?: boolean; + /** Indicates if we should automatically infer the options and schema for CSV and JSON sources. */ + autodetect?: boolean; + /** + * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The + * default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + */ + createDisposition?: string; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + destinationEncryptionConfiguration?: EncryptionConfiguration; + /** [Required] The destination table to load the data into. */ + destinationTable?: TableReference; + /** + * [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data + * after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. + */ + encoding?: string; + /** + * [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, + * you must encode the character as UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split + * the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (','). + */ + fieldDelimiter?: string; + /** + * [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If + * false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. + * The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that + * don't match any column names + */ + ignoreUnknownValues?: boolean; + /** + * [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an invalid + * error is returned in the job result. The default value is 0, which requires that all records are valid. + */ + maxBadRecords?: number; + /** + * [Optional] Specifies a string that represents a null value in a CSV file. For example, if you specify "\N", BigQuery interprets "\N" as a null value + * when loading a CSV file. The default value is the empty string. If you set this property to a custom value, BigQuery throws an error if an empty string + * is present for all data types except for STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the empty string as an empty value. + */ + nullMarker?: string; + /** + * If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are + * case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in + * the Cloud Datastore backup, an invalid error is returned in the job result. + */ + projectionFields?: string[]; + /** + * [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first + * byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted + * sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines + * property to true. + */ + quote?: string; + /** + * [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from + * Google Cloud Datastore. + */ + schema?: TableSchema; + /** [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT". */ + schemaInline?: string; + /** [Deprecated] The format of the schemaInline property. */ + schemaInlineFormat?: string; + /** + * [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job if a schema is autodetected or supplied in + * the job configuration. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE + * and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the + * schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: + * allow relaxing a required field in the original schema to nullable. + */ + schemaUpdateOptions?: string[]; + /** + * [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful + * if you have header rows in the file that should be skipped. + */ + skipLeadingRows?: number; + /** + * [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, + * specify "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". The default value is CSV. + */ + sourceFormat?: string; + /** + * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard + * character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: + * Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore + * backups: Exactly one URI can be specified. Also, the '*' wildcard character is not allowed. + */ + sourceUris?: string[]; + /** [Experimental] If specified, configures time-based partitioning for the destination table. */ + timePartitioning?: TimePartitioning; + /** + * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table + * already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If + * the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_APPEND. Each action is atomic + * and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job + * completion. + */ + writeDisposition?: string; + } + interface JobConfigurationQuery { + /** + * [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. + * Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set + * destinationTable when result size exceeds the allowed maximum response size. + */ + allowLargeResults?: boolean; + /** + * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The + * default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + */ + createDisposition?: string; + /** [Optional] Specifies the default dataset to use for unqualified table names in the query. */ + defaultDataset?: DatasetReference; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + destinationEncryptionConfiguration?: EncryptionConfiguration; + /** + * [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This + * property must be set for large results that exceed the maximum response size. + */ + destinationTable?: TableReference; + /** + * [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if + * this is set to false. For standard SQL queries, this flag is ignored and results are never flattened. + */ + flattenResults?: boolean; + /** + * [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If + * unspecified, this will be set to your project default. + */ + maximumBillingTier?: number; + /** + * [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If + * unspecified, this will be set to your project default. + */ + maximumBytesBilled?: string; + /** Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. */ + parameterMode?: string; + /** [Deprecated] This property is deprecated. */ + preserveNulls?: boolean; + /** [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. */ + priority?: string; + /** [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL. */ + query?: string; + /** Query parameters for standard SQL queries. */ + queryParameters?: QueryParameter[]; + /** + * [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two + * cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by + * partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: + * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to + * nullable. + */ + schemaUpdateOptions?: string[]; + /** + * [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By + * defining these properties, the data source can then be queried as if it were a standard BigQuery table. + */ + tableDefinitions?: Record; + /** [Experimental] If specified, configures time-based partitioning for the destination table. */ + timePartitioning?: TimePartitioning; + /** + * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's + * standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be + * run as if flattenResults is false. + */ + useLegacySql?: boolean; + /** + * [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query + * are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true. + */ + useQueryCache?: boolean; + /** Describes user-defined function resources used in the query. */ + userDefinedFunctionResources?: UserDefinedFunctionResource[]; + /** + * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table + * already exists, BigQuery overwrites the table data and uses the schema from the query result. WRITE_APPEND: If the table already exists, BigQuery + * appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The + * default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and + * append actions occur as one atomic update upon job completion. + */ + writeDisposition?: string; + } + interface JobConfigurationTableCopy { + /** + * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The + * default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + */ + createDisposition?: string; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + destinationEncryptionConfiguration?: EncryptionConfiguration; + /** [Required] The destination table */ + destinationTable?: TableReference; + /** [Pick one] Source table to copy. */ + sourceTable?: TableReference; + /** [Pick one] Source tables to copy. */ + sourceTables?: TableReference[]; + /** + * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table + * already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If + * the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic + * and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job + * completion. + */ + writeDisposition?: string; + } + interface JobList { + /** A hash of this page of results. */ + etag?: string; + /** List of jobs that were requested. */ + jobs?: Array<{ + /** [Full-projection-only] Specifies the job configuration. */ + configuration?: JobConfiguration; + /** A result object that will be present only if the job has failed. */ + errorResult?: ErrorProto; + /** Unique opaque ID of the job. */ + id?: string; + /** Job reference uniquely identifying the job. */ + jobReference?: JobReference; + /** The resource type. */ + kind?: string; + /** Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed. */ + state?: string; + /** [Output-only] Information about the job, including starting time and ending time of the job. */ + statistics?: JobStatistics; + /** [Full-projection-only] Describes the state of the job. */ + status?: JobStatus; + /** [Full-projection-only] Email address of the user who ran the job. */ + user_email?: string; + }>; + /** The resource type of the response. */ + kind?: string; + /** A token to request the next page of results. */ + nextPageToken?: string; + } + interface JobReference { + /** + * [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 + * characters. + */ + jobId?: string; + /** [Required] The ID of the project containing this job. */ + projectId?: string; + } + interface JobStatistics { + /** [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs. */ + creationTime?: string; + /** [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state. */ + endTime?: string; + /** [Output-only] Statistics for an extract job. */ + extract?: JobStatistics4; + /** [Output-only] Statistics for a load job. */ + load?: JobStatistics3; + /** [Output-only] Statistics for a query job. */ + query?: JobStatistics2; + /** + * [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to + * either RUNNING or DONE. + */ + startTime?: string; + /** [Output-only] [Deprecated] Use the bytes processed in the query statistics instead. */ + totalBytesProcessed?: string; + } + interface JobStatistics2 { + /** [Output-only] Billing tier for the job. */ + billingTier?: number; + /** [Output-only] Whether the query result was fetched from the query cache. */ + cacheHit?: boolean; + /** [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. */ + numDmlAffectedRows?: string; + /** [Output-only] Describes execution plan for the query. */ + queryPlan?: ExplainQueryStage[]; + /** [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list. */ + referencedTables?: TableReference[]; + /** [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries. */ + schema?: TableSchema; + /** [Output-only, Experimental] The type of query statement, if valid. */ + statementType?: string; + /** [Output-only] Total bytes billed for the job. */ + totalBytesBilled?: string; + /** [Output-only] Total bytes processed for the job. */ + totalBytesProcessed?: string; + /** [Output-only] Slot-milliseconds for the job. */ + totalSlotMs?: string; + /** [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation. */ + undeclaredQueryParameters?: QueryParameter[]; + } + interface JobStatistics3 { + /** + * [Output-only] The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed + * in the load job configuration, then this number can be less than the total number of bad records present in the input data. + */ + badRecords?: string; + /** [Output-only] Number of bytes of source data in a load job. */ + inputFileBytes?: string; + /** [Output-only] Number of source files in a load job. */ + inputFiles?: string; + /** [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change. */ + outputBytes?: string; + /** [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change. */ + outputRows?: string; + } + interface JobStatistics4 { + /** + * [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the + * URIs specified in the 'destinationUris' field. + */ + destinationUriFileCounts?: string[]; + } + interface JobStatus { + /** [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful. */ + errorResult?: ErrorProto; + /** + * [Output-only] The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to + * stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. + */ + errors?: ErrorProto[]; + /** [Output-only] Running state of the job. */ + state?: string; + } + interface JsonObject { + [key: string]: any; + } + interface ProjectList { + /** A hash of the page of results */ + etag?: string; + /** The type of list. */ + kind?: string; + /** A token to request the next page of results. */ + nextPageToken?: string; + /** Projects to which you have at least READ access. */ + projects?: Array<{ + /** A descriptive name for this project. */ + friendlyName?: string; + /** An opaque ID of this project. */ + id?: string; + /** The resource type. */ + kind?: string; + /** The numeric ID of this project. */ + numericId?: string; + /** A unique reference to this project. */ + projectReference?: ProjectReference; + }>; + /** The total number of projects in the list. */ + totalItems?: number; + } + interface ProjectReference { + /** [Required] ID of the project. Can be either the numeric ID or the assigned ID of the project. */ + projectId?: string; + } + interface QueryParameter { + /** [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query. */ + name?: string; + /** [Required] The type of this parameter. */ + parameterType?: QueryParameterType; + /** [Required] The value of this parameter. */ + parameterValue?: QueryParameterValue; + } + interface QueryParameterType { + /** [Optional] The type of the array's elements, if this is an array. */ + arrayType?: QueryParameterType; + /** [Optional] The types of the fields of this struct, in order, if this is a struct. */ + structTypes?: Array<{ + /** [Optional] Human-oriented description of the field. */ + description?: string; + /** [Optional] The name of this field. */ + name?: string; + /** [Required] The type of this field. */ + type?: QueryParameterType; + }>; + /** [Required] The top level type of this field. */ + type?: string; + } + interface QueryParameterValue { + /** [Optional] The array values, if this is an array type. */ + arrayValues?: QueryParameterValue[]; + /** [Optional] The struct field values, in order of the struct type's declaration. */ + structValues?: Record; + /** [Optional] The value of this value, if a simple scalar type. */ + value?: string; + } + interface QueryRequest { + /** + * [Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the + * query string must be qualified in the format 'datasetId.tableId'. + */ + defaultDataset?: DatasetReference; + /** + * [Optional] If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many + * bytes would be processed. If the query is invalid, an error returns. The default value is false. + */ + dryRun?: boolean; + /** The resource type of the request. */ + kind?: string; + /** + * [Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through + * results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there + * is no maximum row count, and only the byte limit applies. + */ + maxResults?: number; + /** Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. */ + parameterMode?: string; + /** [Deprecated] This property is deprecated. */ + preserveNulls?: boolean; + /** + * [Required] A query string, following the BigQuery query syntax, of the query to execute. Example: "SELECT count(f1) FROM + * [myProjectId:myDatasetId.myTableId]". + */ + query?: string; + /** Query parameters for Standard SQL queries. */ + queryParameters?: QueryParameter[]; + /** + * [Optional] How long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for + * the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' + * flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 + * seconds). + */ + timeoutMs?: number; + /** + * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's + * standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be + * run as if flattenResults is false. + */ + useLegacySql?: boolean; + /** + * [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query + * are modified. The default value is true. + */ + useQueryCache?: boolean; + } + interface QueryResponse { + /** Whether the query result was fetched from the query cache. */ + cacheHit?: boolean; + /** + * [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the + * process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. + */ + errors?: ErrorProto[]; + /** Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available. */ + jobComplete?: boolean; + /** + * Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case + * GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages + * can be fetched via the same mechanism (GetQueryResults). + */ + jobReference?: JobReference; + /** The resource type. */ + kind?: string; + /** [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. */ + numDmlAffectedRows?: string; + /** A token used for paging results. */ + pageToken?: string; + /** + * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults + * and specify the jobReference returned above. + */ + rows?: TableRow[]; + /** The schema of the results. Present only when the query completes successfully. */ + schema?: TableSchema; + /** + * The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were + * run. + */ + totalBytesProcessed?: string; + /** The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. */ + totalRows?: string; + } + interface Streamingbuffer { + /** [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer. */ + estimatedBytes?: string; + /** [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer. */ + estimatedRows?: string; + /** + * [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is + * available. + */ + oldestEntryTime?: string; + } + interface Table { + /** [Output-only] The time when this table was created, in milliseconds since the epoch. */ + creationTime?: string; + /** [Optional] A user-friendly description of this table. */ + description?: string; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + encryptionConfiguration?: EncryptionConfiguration; + /** [Output-only] A hash of this resource. */ + etag?: string; + /** + * [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will + * be deleted and their storage reclaimed. + */ + expirationTime?: string; + /** + * [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data + * source can then be queried as if it were a standard BigQuery table. + */ + externalDataConfiguration?: ExternalDataConfiguration; + /** [Optional] A descriptive name for this table. */ + friendlyName?: string; + /** [Output-only] An opaque ID uniquely identifying the table. */ + id?: string; + /** [Output-only] The type of the resource. */ + kind?: string; + /** + * [Experimental] The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than + * 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are + * optional. Label keys must start with a letter and each label in the list must have a different key. + */ + labels?: Record; + /** [Output-only] The time when this table was last modified, in milliseconds since the epoch. */ + lastModifiedTime?: string; + /** [Output-only] The geographic location where the table resides. This value is inherited from the dataset. */ + location?: string; + /** [Output-only] The size of this table in bytes, excluding any data in the streaming buffer. */ + numBytes?: string; + /** [Output-only] The number of bytes in the table that are considered "long-term storage". */ + numLongTermBytes?: string; + /** [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer. */ + numRows?: string; + /** [Optional] Describes the schema of this table. */ + schema?: TableSchema; + /** [Output-only] A URL that can be used to access this resource again. */ + selfLink?: string; + /** + * [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being + * streamed to or if there is no data in the streaming buffer. + */ + streamingBuffer?: Streamingbuffer; + /** [Required] Reference describing the ID of this table. */ + tableReference?: TableReference; + /** [Experimental] If specified, configures time-based partitioning for this table. */ + timePartitioning?: TimePartitioning; + /** + * [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL + * query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE. + */ + type?: string; + /** [Optional] The view definition. */ + view?: ViewDefinition; + } + interface TableCell { + v?: any; + } + interface TableDataInsertAllRequest { + /** + * [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values + * as errors. + */ + ignoreUnknownValues?: boolean; + /** The resource type of the response. */ + kind?: string; + /** The rows to insert. */ + rows?: Array<{ + /** [Optional] A unique ID for each row. BigQuery uses this property to detect duplicate insertion requests on a best-effort basis. */ + insertId?: string; + /** [Required] A JSON object that contains a row of data. The object's properties and values must match the destination table's schema. */ + json?: JsonObject; + }>; + /** + * [Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any + * invalid rows exist. + */ + skipInvalidRows?: boolean; + /** + * [Experimental] If specified, treats the destination table as a base template, and inserts the rows into an instance table named + * "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See + * https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables. + */ + templateSuffix?: string; + } + interface TableDataInsertAllResponse { + /** An array of errors for rows that were not inserted. */ + insertErrors?: Array<{ + /** Error information for the row indicated by the index property. */ + errors?: ErrorProto[]; + /** The index of the row that error applies to. */ + index?: number; + }>; + /** The resource type of the response. */ + kind?: string; + } + interface TableDataList { + /** A hash of this page of results. */ + etag?: string; + /** The resource type of the response. */ + kind?: string; + /** + * A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table + * is changing. + */ + pageToken?: string; + /** Rows of results. */ + rows?: TableRow[]; + /** The total number of rows in the complete table. */ + totalRows?: string; + } + interface TableFieldSchema { + /** [Optional] The field description. The maximum length is 1,024 characters. */ + description?: string; + /** [Optional] Describes the nested schema fields if the type property is set to RECORD. */ + fields?: TableFieldSchema[]; + /** [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE. */ + mode?: string; + /** + * [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + */ + name?: string; + /** + * [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL + * (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD). + */ + type?: string; + } + interface TableList { + /** A hash of this page of results. */ + etag?: string; + /** The type of list. */ + kind?: string; + /** A token to request the next page of results. */ + nextPageToken?: string; + /** Tables in the requested dataset. */ + tables?: Array<{ + /** The time when this table was created, in milliseconds since the epoch. */ + creationTime?: string; + /** + * [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will + * be deleted and their storage reclaimed. + */ + expirationTime?: string; + /** The user-friendly name for this table. */ + friendlyName?: string; + /** An opaque ID of the table */ + id?: string; + /** The resource type. */ + kind?: string; + /** [Experimental] The labels associated with this table. You can use these to organize and group your tables. */ + labels?: Record; + /** A reference uniquely identifying the table. */ + tableReference?: TableReference; + /** [Experimental] The time-based partitioning for this table. */ + timePartitioning?: TimePartitioning; + /** The type of table. Possible values are: TABLE, VIEW. */ + type?: string; + /** Additional details for a view. */ + view?: { + /** True if view is defined in legacy SQL dialect, false if in standard SQL. */ + useLegacySql?: boolean; + }; + }>; + /** The total number of tables in the dataset. */ + totalItems?: number; + } + interface TableReference { + /** [Required] The ID of the dataset containing this table. */ + datasetId?: string; + /** [Required] The ID of the project containing this table. */ + projectId?: string; + /** [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters. */ + tableId?: string; + } + interface TableRow { + /** Represents a single row in the result set, consisting of one or more fields. */ + f?: TableCell[]; + } + interface TableSchema { + /** Describes the fields in a table. */ + fields?: TableFieldSchema[]; + } + interface TimePartitioning { + /** [Optional] Number of milliseconds for which to keep the storage for a partition. */ + expirationMs?: string; + /** + * [Experimental] [Optional] If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if set, the table is partitioned by this field. The + * field must be a top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED. + */ + field?: string; + /** [Required] The only type supported is DAY, which will generate one partition per day. */ + type?: string; + } + interface UserDefinedFunctionResource { + /** + * [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI + * for a file containing the same code. + */ + inlineCode?: string; + /** [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path). */ + resourceUri?: string; + } + interface ViewDefinition { + /** [Required] A query that BigQuery executes when the view is referenced. */ + query?: string; + /** + * Specifies whether to use BigQuery's legacy SQL for this view. The default value is true. If set to false, the view will use BigQuery's standard SQL: + * https://cloud.google.com/bigquery/sql-reference/ Queries and views that reference this view must use the same flag value. + */ + useLegacySql?: boolean; + /** Describes user-defined function resources used in the query. */ + userDefinedFunctionResources?: UserDefinedFunctionResource[]; + } + interface DatasetsResource { + /** + * Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying + * deleteContents. Immediately after deletion, you can create another dataset with the same name. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of dataset being deleted */ + datasetId: string; + /** If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False */ + deleteContents?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the dataset being deleted */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the dataset specified by datasetID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the requested dataset */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the requested dataset */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new empty dataset. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the new dataset */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all datasets in the specified project to which you have been granted the READER dataset role. */ + list(request: { + /** Whether to list all datasets, including hidden ones */ + all?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by + * connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the datasets to be listed */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the dataset being updated */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the dataset being updated */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the dataset being updated */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the dataset being updated */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface JobsResource { + /** + * Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed + * successfully. Cancelled jobs may still incur costs. + */ + cancel(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] Job ID of the job to cancel */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** [Required] Project ID of the job to cancel */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran + * the job, or have the Is Owner project role. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] Job ID of the requested job */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** [Required] Project ID of the requested job */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the results of a query job. */ + getQueryResults(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] Job ID of the query job */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to read */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** [Required] Project ID of the query job */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Zero-based index of the starting row */ + startIndex?: string; + /** + * How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, + * the 'jobComplete' field in the response will be false + */ + timeoutMs?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Starts a new asynchronous job. Requires the Can View project role. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the project that will be billed for the job */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in + * reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. + */ + list(request: { + /** Whether to display jobs owned by all users in the project. Default false */ + allUsers?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the jobs to list */ + projectId: string; + /** Restrict information returned to a set of selected fields */ + projection?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Filter for job state */ + stateFilter?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the project billed for the query */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Returns the email address of the service account for your project used for interactions with Google Cloud KMS. */ + getServiceAccount(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for which the service account is requested. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all projects to which you have been granted any project role. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TabledataResource { + /** Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. */ + insertAll(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the destination table. */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the destination table. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the destination table. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves table data from a specified set of rows. Requires the READER dataset role. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to read */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, identifying the result set */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to read */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List of fields to return (comma-separated). If unspecified, all fields are returned */ + selectedFields?: string; + /** Zero-based index of the starting row to read */ + startIndex?: string; + /** Table ID of the table to read */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TablesResource { + /** Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to delete */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to delete */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the table to delete */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes + * the structure of this table. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the requested table */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the requested table */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List of fields to return (comma-separated). If unspecified, all fields are returned */ + selectedFields?: string; + /** Table ID of the requested table */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new, empty table in the dataset. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the new table */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the new table */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Lists all tables in the specified dataset. Requires the READER dataset role. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the tables to list */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the tables to list */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to update */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to update */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the table to update */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to update */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to update */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the table to update */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + } + } +} diff --git a/types/gapi.client.bigquery/readme.md b/types/gapi.client.bigquery/readme.md new file mode 100644 index 0000000000..4a76f83277 --- /dev/null +++ b/types/gapi.client.bigquery/readme.md @@ -0,0 +1,182 @@ +# TypeScript typings for BigQuery API v2 +A data platform for customers to create, manage, share and query data. +For detailed description please check [documentation](https://cloud.google.com/bigquery/). + +## Installing + +Install typings for BigQuery API: +``` +npm install @types/gapi.client.bigquery@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('bigquery', 'v2', () => { + // now we can use gapi.client.bigquery + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data in Google BigQuery + 'https://www.googleapis.com/auth/bigquery', + + // Insert data into Google BigQuery + 'https://www.googleapis.com/auth/bigquery.insertdata', + + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // Manage your data and permissions in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.full_control', + + // View your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_only', + + // Manage your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_write', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use BigQuery API resources: + +```typescript + +/* +Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name. +*/ +await gapi.client.datasets.delete({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Returns the dataset specified by datasetID. +*/ +await gapi.client.datasets.get({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Creates a new empty dataset. +*/ +await gapi.client.datasets.insert({ projectId: "projectId", }); + +/* +Lists all datasets in the specified project to which you have been granted the READER dataset role. +*/ +await gapi.client.datasets.list({ projectId: "projectId", }); + +/* +Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics. +*/ +await gapi.client.datasets.patch({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. +*/ +await gapi.client.datasets.update({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs. +*/ +await gapi.client.jobs.cancel({ jobId: "jobId", projectId: "projectId", }); + +/* +Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role. +*/ +await gapi.client.jobs.get({ jobId: "jobId", projectId: "projectId", }); + +/* +Retrieves the results of a query job. +*/ +await gapi.client.jobs.getQueryResults({ jobId: "jobId", projectId: "projectId", }); + +/* +Starts a new asynchronous job. Requires the Can View project role. +*/ +await gapi.client.jobs.insert({ projectId: "projectId", }); + +/* +Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. +*/ +await gapi.client.jobs.list({ projectId: "projectId", }); + +/* +Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. +*/ +await gapi.client.jobs.query({ projectId: "projectId", }); + +/* +Returns the email address of the service account for your project used for interactions with Google Cloud KMS. +*/ +await gapi.client.projects.getServiceAccount({ projectId: "projectId", }); + +/* +Lists all projects to which you have been granted any project role. +*/ +await gapi.client.projects.list({ }); + +/* +Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. +*/ +await gapi.client.tabledata.insertAll({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Retrieves table data from a specified set of rows. Requires the READER dataset role. +*/ +await gapi.client.tabledata.list({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. +*/ +await gapi.client.tables.delete({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table. +*/ +await gapi.client.tables.get({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Creates a new, empty table in the dataset. +*/ +await gapi.client.tables.insert({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Lists all tables in the specified dataset. Requires the READER dataset role. +*/ +await gapi.client.tables.list({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics. +*/ +await gapi.client.tables.patch({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. +*/ +await gapi.client.tables.update({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.bigquery/tsconfig.json b/types/gapi.client.bigquery/tsconfig.json new file mode 100644 index 0000000000..23f55a96a4 --- /dev/null +++ b/types/gapi.client.bigquery/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.bigquery-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.bigquery/tslint.json b/types/gapi.client.bigquery/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.bigquery/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.bigquerydatatransfer/gapi.client.bigquerydatatransfer-tests.ts b/types/gapi.client.bigquerydatatransfer/gapi.client.bigquerydatatransfer-tests.ts new file mode 100644 index 0000000000..2b3fcba3be --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/gapi.client.bigquerydatatransfer-tests.ts @@ -0,0 +1,36 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('bigquerydatatransfer', 'v1', () => { + /** now we can use gapi.client.bigquerydatatransfer */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data in Google BigQuery */ + 'https://www.googleapis.com/auth/bigquery', + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.bigquerydatatransfer/index.d.ts b/types/gapi.client.bigquerydatatransfer/index.d.ts new file mode 100644 index 0000000000..0bc090fdf5 --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/index.d.ts @@ -0,0 +1,1579 @@ +// Type definitions for Google BigQuery Data Transfer API v1 1.0 +// Project: https://cloud.google.com/bigquery/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://bigquerydatatransfer.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load BigQuery Data Transfer API v1 */ + function load(name: "bigquerydatatransfer", version: "v1"): PromiseLike; + function load(name: "bigquerydatatransfer", version: "v1", callback: () => any): void; + + const projects: bigquerydatatransfer.ProjectsResource; + + namespace bigquerydatatransfer { + interface CheckValidCredsResponse { + /** If set to `true`, the credentials exist and are valid. */ + hasValidCreds?: boolean; + } + interface DataSource { + /** Indicates the type of authorization. */ + authorizationType?: string; + /** + * Data source client id which should be used to receive refresh token. + * When not supplied, no offline credentials are populated for data transfer. + */ + clientId?: string; + /** + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. + * For some data sources, data might not be complete until a few days later, + * so it's useful to refresh data automatically. + */ + dataRefreshType?: string; + /** Data source id. */ + dataSourceId?: string; + /** + * Default data refresh window on days. + * Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + */ + defaultDataRefreshWindowDays?: number; + /** + * Default data transfer schedule. + * Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + */ + defaultSchedule?: string; + /** User friendly data source description string. */ + description?: string; + /** User friendly data source name. */ + displayName?: string; + /** Url for the help document for this data source. */ + helpUrl?: string; + /** + * Disables backfilling and manual run scheduling + * for the data source. + */ + manualRunsDisabled?: boolean; + /** The minimum interval between two consecutive scheduled runs. */ + minimumScheduleInterval?: string; + /** Data source resource name. */ + name?: string; + /** Data source parameters. */ + parameters?: DataSourceParameter[]; + /** + * Api auth scopes for which refresh token needs to be obtained. Only valid + * when `client_id` is specified. Ignored otherwise. These are scopes needed + * by a data source to prepare data and ingest them into BigQuery, + * e.g., https://www.googleapis.com/auth/bigquery + */ + scopes?: string[]; + /** + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. + * When set to `true`, user can override default schedule. + */ + supportsCustomSchedule?: boolean; + /** + * Indicates whether the data source supports multiple transfers + * to different BigQuery targets. + */ + supportsMultipleTransfers?: boolean; + /** + * Transfer type. Currently supports only batch transfers, + * which are transfers that use the BigQuery batch APIs (load or + * query) to ingest the data. + */ + transferType?: string; + /** + * The number of seconds to wait for an update from the data source + * before BigQuery marks the transfer as failed. + */ + updateDeadlineSeconds?: number; + } + interface DataSourceParameter { + /** All possible values for the parameter. */ + allowedValues?: string[]; + /** Parameter description. */ + description?: string; + /** Parameter display name in the user interface. */ + displayName?: string; + /** When parameter is a record, describes child fields. */ + fields?: DataSourceParameter[]; + /** Cannot be changed after initial creation. */ + immutable?: boolean; + /** For integer and double values specifies maxminum allowed value. */ + maxValue?: number; + /** For integer and double values specifies minimum allowed value. */ + minValue?: number; + /** Parameter identifier. */ + paramId?: string; + /** + * If set to true, schema should be taken from the parent with the same + * parameter_id. Only applicable when parameter type is RECORD. + */ + recurse?: boolean; + /** Can parameter have multiple values. */ + repeated?: boolean; + /** Is parameter required. */ + required?: boolean; + /** Parameter type. */ + type?: string; + /** + * Description of the requirements for this field, in case the user input does + * not fulfill the regex pattern or min/max values. + */ + validationDescription?: string; + /** URL to a help document to further explain the naming requirements. */ + validationHelpUrl?: string; + /** Regular expression which can be used for parameter validation. */ + validationRegex?: string; + } + interface ListDataSourcesResponse { + /** List of supported data sources and their transfer settings. */ + dataSources?: DataSource[]; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListDataSourcesRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListTransferConfigsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferConfigsRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + /** Output only. The stored pipeline transfer configurations. */ + transferConfigs?: TransferConfig[]; + } + interface ListTransferLogsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `GetTransferRunLogRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + /** Output only. The stored pipeline transfer messages. */ + transferMessages?: TransferMessage[]; + } + interface ListTransferRunsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferRunsRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + /** Output only. The stored pipeline transfer runs. */ + transferRuns?: TransferRun[]; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface ScheduleTransferRunsRequest { + /** + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + */ + endTime?: string; + /** + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + */ + startTime?: string; + } + interface ScheduleTransferRunsResponse { + /** The transfer runs that were scheduled. */ + runs?: TransferRun[]; + } + interface TransferConfig { + /** + * The number of days to look back to automatically refresh the data. + * For example, if `data_refresh_window_days = 10`, then every day + * BigQuery reingests data for [today-10, today-1], rather than ingesting data + * for just [today-1]. + * Only valid if the data source supports the feature. Set the value to 0 + * to use the default value. + */ + dataRefreshWindowDays?: number; + /** Data source id. Cannot be changed once data transfer is created. */ + dataSourceId?: string; + /** Output only. Region in which BigQuery dataset is located. */ + datasetRegion?: string; + /** The BigQuery target dataset id. */ + destinationDatasetId?: string; + /** + * Is this config disabled. When set to true, no runs are scheduled + * for a given transfer. + */ + disabled?: boolean; + /** User specified display name for the data transfer. */ + displayName?: string; + /** + * The resource name of the transfer config. + * Transfer config names have the form + * `projects/{project_id}/transferConfigs/{config_id}`. + * Where `config_id` is usually a uuid, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + */ + name?: string; + /** Output only. Next time when data transfer will run. */ + nextRunTime?: string; + /** Data transfer specific parameters. */ + params?: Record; + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be + * used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: the granularity should be at least 8 hours, or less frequent. + */ + schedule?: string; + /** Output only. State of the most recently updated transfer run. */ + state?: string; + /** Output only. Data transfer modification time. Ignored by server on input. */ + updateTime?: string; + /** + * Output only. Unique ID of the user on whose behalf transfer is done. + * Applicable only to data sources that do not support service accounts. + * When set to 0, the data source service account credentials are used. + */ + userId?: string; + } + interface TransferMessage { + /** Message text. */ + messageText?: string; + /** Time when message was logged. */ + messageTime?: string; + /** Message severity. */ + severity?: string; + } + interface TransferRun { + /** Output only. Data source id. */ + dataSourceId?: string; + /** Output only. Region in which BigQuery dataset is located. */ + datasetRegion?: string; + /** The BigQuery target dataset id. */ + destinationDatasetId?: string; + /** + * Output only. Time when transfer run ended. + * Parameter ignored by server for input requests. + */ + endTime?: string; + /** + * The resource name of the transfer run. + * Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + */ + name?: string; + /** Data transfer specific parameters. */ + params?: Record; + /** + * For batch transfer runs, specifies the date and time that + * data should be ingested. + */ + runTime?: string; + /** + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. + * NOTE: the system might choose to delay the schedule depending on the + * current load, so `schedule_time` doesn't always matches this. + */ + schedule?: string; + /** Minimum time after which a transfer run can be started. */ + scheduleTime?: string; + /** + * Output only. Time when transfer run was started. + * Parameter ignored by server for input requests. + */ + startTime?: string; + /** Output only. Data transfer run state. Ignored for input requests. */ + state?: string; + /** Output only. Last time the data transfer run state was updated. */ + updateTime?: string; + /** + * Output only. Unique ID of the user on whose behalf transfer is done. + * Applicable only to data sources that do not support service accounts. + * When set to 0, the data source service account credentials are used. + */ + userId?: string; + } + interface DataSourcesResource { + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * Some data sources doesn't support service account, so we need to talk to + * them on behalf of the end user. This API just checks whether we have OAuth + * token for the particular user, which is a pre-requisite before user can + * create a transfer config. + */ + checkValidCreds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Retrieves a supported data source and returns its settings, + * which can be used for UI rendering. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists supported data sources and returns their settings, + * which can be used for UI rendering. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DataSourcesResource { + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * Some data sources doesn't support service account, so we need to talk to + * them on behalf of the end user. This API just checks whether we have OAuth + * token for the particular user, which is a pre-requisite before user can + * create a transfer config. + */ + checkValidCreds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Retrieves a supported data source and returns its settings, + * which can be used for UI rendering. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists supported data sources and returns their settings, + * which can be used for UI rendering. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TransferLogsResource { + /** Returns user facing log messages for the data transfer run. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + */ + messageTypes?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RunsResource { + /** Deletes the specified transfer run. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about the particular transfer run. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about running and completed jobs. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Indicates how run attempts are to be pulled. */ + runAttempt?: string; + /** When specified, only transfer runs with requested states are returned. */ + states?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + transferLogs: TransferLogsResource; + } + interface TransferConfigsResource { + /** Creates a new data transfer configuration. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The BigQuery project id where the transfer configuration should be created. + * Must be in the format /projects/{project_id}/locations/{location_id} + * or + * /projects/{project_id}/locations/- + * In case when '-' is specified as location_id, location is infered from + * the destination dataset region. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a data transfer configuration, + * including any associated transfer runs and logs. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about a data transfer config. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about all data transfers in the project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** When specified, only configurations of requested data sources are returned. */ + dataSourceIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources + * should be returned: `projects/{project_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * gaia id of the authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the transfer config. + * Transfer config names have the form + * `projects/{project_id}/transferConfigs/{config_id}`. + * Where `config_id` is usually a uuid, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Creates transfer runs for a time range [range_start_time, range_end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + */ + scheduleRuns(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + runs: RunsResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name for the location. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + dataSources: DataSourcesResource; + transferConfigs: TransferConfigsResource; + } + interface TransferLogsResource { + /** Returns user facing log messages for the data transfer run. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + */ + messageTypes?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RunsResource { + /** Deletes the specified transfer run. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about the particular transfer run. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about running and completed jobs. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Indicates how run attempts are to be pulled. */ + runAttempt?: string; + /** When specified, only transfer runs with requested states are returned. */ + states?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + transferLogs: TransferLogsResource; + } + interface TransferConfigsResource { + /** Creates a new data transfer configuration. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The BigQuery project id where the transfer configuration should be created. + * Must be in the format /projects/{project_id}/locations/{location_id} + * or + * /projects/{project_id}/locations/- + * In case when '-' is specified as location_id, location is infered from + * the destination dataset region. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a data transfer configuration, + * including any associated transfer runs and logs. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about a data transfer config. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about all data transfers in the project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** When specified, only configurations of requested data sources are returned. */ + dataSourceIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources + * should be returned: `projects/{project_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * gaia id of the authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the transfer config. + * Transfer config names have the form + * `projects/{project_id}/transferConfigs/{config_id}`. + * Where `config_id` is usually a uuid, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Creates transfer runs for a time range [range_start_time, range_end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + */ + scheduleRuns(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + runs: RunsResource; + } + interface ProjectsResource { + dataSources: DataSourcesResource; + locations: LocationsResource; + transferConfigs: TransferConfigsResource; + } + } +} diff --git a/types/gapi.client.bigquerydatatransfer/readme.md b/types/gapi.client.bigquerydatatransfer/readme.md new file mode 100644 index 0000000000..539a25cecc --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/readme.md @@ -0,0 +1,60 @@ +# TypeScript typings for BigQuery Data Transfer API v1 +Transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis. +For detailed description please check [documentation](https://cloud.google.com/bigquery/). + +## Installing + +Install typings for BigQuery Data Transfer API: +``` +npm install @types/gapi.client.bigquerydatatransfer@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('bigquerydatatransfer', 'v1', () => { + // now we can use gapi.client.bigquerydatatransfer + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data in Google BigQuery + 'https://www.googleapis.com/auth/bigquery', + + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use BigQuery Data Transfer API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.bigquerydatatransfer/tsconfig.json b/types/gapi.client.bigquerydatatransfer/tsconfig.json new file mode 100644 index 0000000000..312df37f3f --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.bigquerydatatransfer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.bigquerydatatransfer/tslint.json b/types/gapi.client.bigquerydatatransfer/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.blogger/gapi.client.blogger-tests.ts b/types/gapi.client.blogger/gapi.client.blogger-tests.ts new file mode 100644 index 0000000000..09f3da8912 --- /dev/null +++ b/types/gapi.client.blogger/gapi.client.blogger-tests.ts @@ -0,0 +1,277 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('blogger', 'v3', () => { + /** now we can use gapi.client.blogger */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Blogger account */ + 'https://www.googleapis.com/auth/blogger', + /** View your Blogger account */ + 'https://www.googleapis.com/auth/blogger.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets one blog and user info pair by blogId and userId. */ + await gapi.client.blogUserInfos.get({ + blogId: "blogId", + maxPosts: 2, + userId: "userId", + }); + /** Gets one blog by ID. */ + await gapi.client.blogs.get({ + blogId: "blogId", + maxPosts: 2, + view: "view", + }); + /** Retrieve a Blog by URL. */ + await gapi.client.blogs.getByUrl({ + url: "url", + view: "view", + }); + /** Retrieves a list of blogs, possibly filtered. */ + await gapi.client.blogs.listByUser({ + fetchUserInfo: true, + role: "role", + status: "status", + userId: "userId", + view: "view", + }); + /** Marks a comment as not spam. */ + await gapi.client.comments.approve({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Delete a comment by ID. */ + await gapi.client.comments.delete({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Gets one comment by ID. */ + await gapi.client.comments.get({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + view: "view", + }); + /** Retrieves the comments for a post, possibly filtered. */ + await gapi.client.comments.list({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + maxResults: 4, + pageToken: "pageToken", + postId: "postId", + startDate: "startDate", + status: "status", + view: "view", + }); + /** Retrieves the comments for a blog, across all posts, possibly filtered. */ + await gapi.client.comments.listByBlog({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + maxResults: 4, + pageToken: "pageToken", + startDate: "startDate", + status: "status", + }); + /** Marks a comment as spam. */ + await gapi.client.comments.markAsSpam({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Removes the content of a comment. */ + await gapi.client.comments.removeContent({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Retrieve pageview stats for a Blog. */ + await gapi.client.pageViews.get({ + blogId: "blogId", + range: "range", + }); + /** Delete a page by ID. */ + await gapi.client.pages.delete({ + blogId: "blogId", + pageId: "pageId", + }); + /** Gets one blog page by ID. */ + await gapi.client.pages.get({ + blogId: "blogId", + pageId: "pageId", + view: "view", + }); + /** Add a page. */ + await gapi.client.pages.insert({ + blogId: "blogId", + isDraft: true, + }); + /** Retrieves the pages for a blog, optionally including non-LIVE statuses. */ + await gapi.client.pages.list({ + blogId: "blogId", + fetchBodies: true, + maxResults: 3, + pageToken: "pageToken", + status: "status", + view: "view", + }); + /** Update a page. This method supports patch semantics. */ + await gapi.client.pages.patch({ + blogId: "blogId", + pageId: "pageId", + publish: true, + revert: true, + }); + /** Publishes a draft page. */ + await gapi.client.pages.publish({ + blogId: "blogId", + pageId: "pageId", + }); + /** Revert a published or scheduled page to draft state. */ + await gapi.client.pages.revert({ + blogId: "blogId", + pageId: "pageId", + }); + /** Update a page. */ + await gapi.client.pages.update({ + blogId: "blogId", + pageId: "pageId", + publish: true, + revert: true, + }); + /** + * Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, + * specific to the user. + */ + await gapi.client.postUserInfos.get({ + blogId: "blogId", + maxComments: 2, + postId: "postId", + userId: "userId", + }); + /** + * Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access + * rights, specific to the user. + */ + await gapi.client.postUserInfos.list({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + labels: "labels", + maxResults: 5, + orderBy: "orderBy", + pageToken: "pageToken", + startDate: "startDate", + status: "status", + userId: "userId", + view: "view", + }); + /** Delete a post by ID. */ + await gapi.client.posts.delete({ + blogId: "blogId", + postId: "postId", + }); + /** Get a post by ID. */ + await gapi.client.posts.get({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + maxComments: 4, + postId: "postId", + view: "view", + }); + /** Retrieve a Post by Path. */ + await gapi.client.posts.getByPath({ + blogId: "blogId", + maxComments: 2, + path: "path", + view: "view", + }); + /** Add a post. */ + await gapi.client.posts.insert({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + isDraft: true, + }); + /** Retrieves a list of posts, possibly filtered. */ + await gapi.client.posts.list({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + fetchImages: true, + labels: "labels", + maxResults: 6, + orderBy: "orderBy", + pageToken: "pageToken", + startDate: "startDate", + status: "status", + view: "view", + }); + /** Update a post. This method supports patch semantics. */ + await gapi.client.posts.patch({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + maxComments: 4, + postId: "postId", + publish: true, + revert: true, + }); + /** Publishes a draft post, optionally at the specific time of the given publishDate parameter. */ + await gapi.client.posts.publish({ + blogId: "blogId", + postId: "postId", + publishDate: "publishDate", + }); + /** Revert a published or scheduled post to draft state. */ + await gapi.client.posts.revert({ + blogId: "blogId", + postId: "postId", + }); + /** Search for a post. */ + await gapi.client.posts.search({ + blogId: "blogId", + fetchBodies: true, + orderBy: "orderBy", + q: "q", + }); + /** Update a post. */ + await gapi.client.posts.update({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + maxComments: 4, + postId: "postId", + publish: true, + revert: true, + }); + /** Gets one user by ID. */ + await gapi.client.users.get({ + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.blogger/index.d.ts b/types/gapi.client.blogger/index.d.ts new file mode 100644 index 0000000000..85240dfee5 --- /dev/null +++ b/types/gapi.client.blogger/index.d.ts @@ -0,0 +1,1346 @@ +// Type definitions for Google Blogger API v3 3.0 +// Project: https://developers.google.com/blogger/docs/3.0/getting_started +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/blogger/v3/rest + +/// + +declare namespace gapi.client { + /** Load Blogger API v3 */ + function load(name: "blogger", version: "v3"): PromiseLike; + function load(name: "blogger", version: "v3", callback: () => any): void; + + const blogUserInfos: blogger.BlogUserInfosResource; + + const blogs: blogger.BlogsResource; + + const comments: blogger.CommentsResource; + + const pageViews: blogger.PageViewsResource; + + const pages: blogger.PagesResource; + + const postUserInfos: blogger.PostUserInfosResource; + + const posts: blogger.PostsResource; + + const users: blogger.UsersResource; + + namespace blogger { + interface Blog { + /** The JSON custom meta-data for the Blog */ + customMetaData?: string; + /** The description of this blog. This is displayed underneath the title. */ + description?: string; + /** The identifier for this resource. */ + id?: string; + /** The kind of this entry. Always blogger#blog */ + kind?: string; + /** The locale this Blog is set to. */ + locale?: { + /** The country this blog's locale is set to. */ + country?: string; + /** The language this blog is authored in. */ + language?: string; + /** The language variant this blog is authored in. */ + variant?: string; + }; + /** The name of this blog. This is displayed as the title. */ + name?: string; + /** The container of pages in this blog. */ + pages?: { + /** The URL of the container for pages in this blog. */ + selfLink?: string; + /** The count of pages in this blog. */ + totalItems?: number; + }; + /** The container of posts in this blog. */ + posts?: { + /** The List of Posts for this Blog. */ + items?: Post[]; + /** The URL of the container for posts in this blog. */ + selfLink?: string; + /** The count of posts in this blog. */ + totalItems?: number; + }; + /** RFC 3339 date-time when this blog was published. */ + published?: string; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The status of the blog. */ + status?: string; + /** RFC 3339 date-time when this blog was last updated. */ + updated?: string; + /** The URL where this blog is published. */ + url?: string; + } + interface BlogList { + /** Admin level list of blog per-user information */ + blogUserInfos?: BlogUserInfo[]; + /** The list of Blogs this user has Authorship or Admin rights over. */ + items?: Blog[]; + /** The kind of this entity. Always blogger#blogList */ + kind?: string; + } + interface BlogPerUserInfo { + /** ID of the Blog resource */ + blogId?: string; + /** True if the user has Admin level access to the blog. */ + hasAdminAccess?: boolean; + /** The kind of this entity. Always blogger#blogPerUserInfo */ + kind?: string; + /** The Photo Album Key for the user when adding photos to the blog */ + photosAlbumKey?: string; + /** Access permissions that the user has for the blog (ADMIN, AUTHOR, or READER). */ + role?: string; + /** ID of the User */ + userId?: string; + } + interface BlogUserInfo { + /** The Blog resource. */ + blog?: Blog; + /** Information about a User for the Blog. */ + blog_user_info?: BlogPerUserInfo; + /** The kind of this entity. Always blogger#blogUserInfo */ + kind?: string; + } + interface Comment { + /** The author of this Comment. */ + author?: { + /** The display name. */ + displayName?: string; + /** The identifier of the Comment creator. */ + id?: string; + /** The comment creator's avatar. */ + image?: { + /** The comment creator's avatar URL. */ + url?: string; + }; + /** The URL of the Comment creator's Profile page. */ + url?: string; + }; + /** Data about the blog containing this comment. */ + blog?: { + /** The identifier of the blog containing this comment. */ + id?: string; + }; + /** The actual content of the comment. May include HTML markup. */ + content?: string; + /** The identifier for this resource. */ + id?: string; + /** Data about the comment this is in reply to. */ + inReplyTo?: { + /** The identified of the parent of this comment. */ + id?: string; + }; + /** The kind of this entry. Always blogger#comment */ + kind?: string; + /** Data about the post containing this comment. */ + post?: { + /** The identifier of the post containing this comment. */ + id?: string; + }; + /** RFC 3339 date-time when this comment was published. */ + published?: string; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The status of the comment (only populated for admin users) */ + status?: string; + /** RFC 3339 date-time when this comment was last updated. */ + updated?: string; + } + interface CommentList { + /** Etag of the response. */ + etag?: string; + /** The List of Comments for a Post. */ + items?: Comment[]; + /** The kind of this entry. Always blogger#commentList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + /** Pagination token to fetch the previous page, if one exists. */ + prevPageToken?: string; + } + interface Page { + /** The author of this Page. */ + author?: { + /** The display name. */ + displayName?: string; + /** The identifier of the Page creator. */ + id?: string; + /** The page author's avatar. */ + image?: { + /** The page author's avatar URL. */ + url?: string; + }; + /** The URL of the Page creator's Profile page. */ + url?: string; + }; + /** Data about the blog containing this Page. */ + blog?: { + /** The identifier of the blog containing this page. */ + id?: string; + }; + /** The body content of this Page, in HTML. */ + content?: string; + /** Etag of the resource. */ + etag?: string; + /** The identifier for this resource. */ + id?: string; + /** The kind of this entity. Always blogger#page */ + kind?: string; + /** RFC 3339 date-time when this Page was published. */ + published?: string; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The status of the page for admin resources (either LIVE or DRAFT). */ + status?: string; + /** The title of this entity. This is the name displayed in the Admin user interface. */ + title?: string; + /** RFC 3339 date-time when this Page was last updated. */ + updated?: string; + /** The URL that this Page is displayed at. */ + url?: string; + } + interface PageList { + /** Etag of the response. */ + etag?: string; + /** The list of Pages for a Blog. */ + items?: Page[]; + /** The kind of this entity. Always blogger#pageList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + } + interface Pageviews { + /** Blog Id */ + blogId?: string; + /** The container of posts in this blog. */ + counts?: Array<{ + /** Count of page views for the given time range */ + count?: string; + /** Time range the given count applies to */ + timeRange?: string; + }>; + /** The kind of this entry. Always blogger#page_views */ + kind?: string; + } + interface Post { + /** The author of this Post. */ + author?: { + /** The display name. */ + displayName?: string; + /** The identifier of the Post creator. */ + id?: string; + /** The Post author's avatar. */ + image?: { + /** The Post author's avatar URL. */ + url?: string; + }; + /** The URL of the Post creator's Profile page. */ + url?: string; + }; + /** Data about the blog containing this Post. */ + blog?: { + /** The identifier of the Blog that contains this Post. */ + id?: string; + }; + /** The content of the Post. May contain HTML markup. */ + content?: string; + /** The JSON meta-data for the Post. */ + customMetaData?: string; + /** Etag of the resource. */ + etag?: string; + /** The identifier of this Post. */ + id?: string; + /** Display image for the Post. */ + images?: Array<{ + url?: string; + }>; + /** The kind of this entity. Always blogger#post */ + kind?: string; + /** The list of labels this Post was tagged with. */ + labels?: string[]; + /** The location for geotagged posts. */ + location?: { + /** Location's latitude. */ + lat?: number; + /** Location's longitude. */ + lng?: number; + /** Location name. */ + name?: string; + /** Location's viewport span. Can be used when rendering a map preview. */ + span?: string; + }; + /** RFC 3339 date-time when this Post was published. */ + published?: string; + /** Comment control and display setting for readers of this post. */ + readerComments?: string; + /** The container of comments on this Post. */ + replies?: { + /** The List of Comments for this Post. */ + items?: Comment[]; + /** The URL of the comments on this post. */ + selfLink?: string; + /** The count of comments on this post. */ + totalItems?: string; + }; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** Status of the post. Only set for admin-level requests */ + status?: string; + /** The title of the Post. */ + title?: string; + /** The title link URL, similar to atom's related link. */ + titleLink?: string; + /** RFC 3339 date-time when this Post was last updated. */ + updated?: string; + /** The URL where this Post is displayed. */ + url?: string; + } + interface PostList { + /** Etag of the response. */ + etag?: string; + /** The list of Posts for this Blog. */ + items?: Post[]; + /** The kind of this entity. Always blogger#postList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + } + interface PostPerUserInfo { + /** ID of the Blog that the post resource belongs to. */ + blogId?: string; + /** True if the user has Author level access to the post. */ + hasEditAccess?: boolean; + /** The kind of this entity. Always blogger#postPerUserInfo */ + kind?: string; + /** ID of the Post resource. */ + postId?: string; + /** ID of the User. */ + userId?: string; + } + interface PostUserInfo { + /** The kind of this entity. Always blogger#postUserInfo */ + kind?: string; + /** The Post resource. */ + post?: Post; + /** Information about a User for the Post. */ + post_user_info?: PostPerUserInfo; + } + interface PostUserInfosList { + /** The list of Posts with User information for the post, for this Blog. */ + items?: PostUserInfo[]; + /** The kind of this entity. Always blogger#postList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + } + interface User { + /** Profile summary information. */ + about?: string; + /** The container of blogs for this user. */ + blogs?: { + /** The URL of the Blogs for this user. */ + selfLink?: string; + }; + /** The timestamp of when this profile was created, in seconds since epoch. */ + created?: string; + /** The display name. */ + displayName?: string; + /** The identifier for this User. */ + id?: string; + /** The kind of this entity. Always blogger#user */ + kind?: string; + /** This user's locale */ + locale?: { + /** The user's country setting. */ + country?: string; + /** The user's language setting. */ + language?: string; + /** The user's language variant setting. */ + variant?: string; + }; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The user's profile page. */ + url?: string; + } + interface BlogUserInfosResource { + /** Gets one blog and user info pair by blogId and userId. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog to get. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of posts to pull back with the blog. */ + maxPosts?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BlogsResource { + /** Gets one blog by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog to get. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of posts to pull back with the blog. */ + maxPosts?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the blog. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieve a Blog by URL. */ + getByUrl(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The URL of the blog to retrieve. */ + url: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the blog. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieves a list of blogs, possibly filtered. */ + listByUser(request: { + /** Data format for the response. */ + alt?: string; + /** Whether the response is a list of blogs with per-user information instead of just blogs. */ + fetchUserInfo?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, + * defaults to ADMIN and AUTHOR roles. + */ + role?: string; + /** Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs. */ + status?: string; + /** ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the blogs. Note that some fields require elevated access. */ + view?: string; + }): Request; + } + interface CommentsResource { + /** Marks a comment as not spam. */ + approve(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to mark as not spam. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete a comment by ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to delete. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one comment by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to containing the comment. */ + blogId: string; + /** The ID of the comment to get. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the post to fetch posts from. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the + * parent posts which is in a draft state, or comments that are pending moderation. + */ + view?: string; + }): Request; + /** Retrieves the comments for a post, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch comments from. */ + blogId: string; + /** Latest date of comment to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** Whether the body content of the comments is included. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to include in the result. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token if request is paged. */ + pageToken?: string; + /** ID of the post to fetch posts from. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest date of comment to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieves the comments for a blog, across all posts, possibly filtered. */ + listByBlog(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch comments from. */ + blogId: string; + /** Latest date of comment to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** Whether the body content of the comments is included. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to include in the result. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token if request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest date of comment to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Marks a comment as spam. */ + markAsSpam(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to mark as spam. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes the content of a comment. */ + removeContent(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to delete content from. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PageViewsResource { + /** Retrieve pageview stats for a Blog. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog to get. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + range?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PagesResource { + /** Delete a page by ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one blog page by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog containing the page. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page to get. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + view?: string; + }): Request; + /** Add a page. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to add the page to. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to create the page as a draft (default: false). */ + isDraft?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the pages for a blog, optionally including non-LIVE statuses. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch Pages from. */ + blogId: string; + /** Whether to retrieve the Page bodies. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of Pages to fetch. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token if the request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Update a page. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the page is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the page is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Publishes a draft page. */ + publish(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Revert a published or scheduled page to draft state. */ + revert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a page. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the page is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the page is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PostUserInfosResource { + /** + * Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, + * specific to the user. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to pull back on a post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the post to get. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access + * rights, specific to the user. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch posts from. */ + blogId: string; + /** Latest post date to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** Whether the body content of posts is included. Default is false. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Comma-separated list of labels to search for. */ + labels?: string; + /** Maximum number of posts to fetch. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort order applied to search results. Default is published. */ + orderBy?: string; + /** Continuation token if the request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest post date to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + status?: string; + /** ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + } + interface PostsResource { + /** Delete a post by ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get a post by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch the post from. */ + blogId: string; + /** + * Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize + * traffic. + */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to pull back on a post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the post */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieve a Post by Path. */ + getByPath(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch the post from. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to pull back on a post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Path of the Post to retrieve. */ + path: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Add a post. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to add the post to. */ + blogId: string; + /** Whether the body content of the post is included with the result (default: true). */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included in the returned result (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to create the post as a draft (default: false). */ + isDraft?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of posts, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch posts from. */ + blogId: string; + /** Latest post date to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** + * Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize + * traffic. + */ + fetchBodies?: boolean; + /** Whether image URL metadata for each post is included. */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Comma-separated list of labels to search for. */ + labels?: string; + /** Maximum number of posts to fetch. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort search results */ + orderBy?: string; + /** Continuation token if the request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest post date to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + /** Statuses to include in the results. */ + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require escalated access. */ + view?: string; + }): Request; + /** Update a post. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Whether the body content of the post is included with the result (default: true). */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included in the returned result (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to retrieve with the returned post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the post is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the post is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Publishes a draft post, optionally at the specific time of the given publishDate parameter. */ + publish(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously + * saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published. + */ + publishDate?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Revert a published or scheduled post to draft state. */ + revert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Search for a post. */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch the post from. */ + blogId: string; + /** + * Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize + * traffic. + */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort search results */ + orderBy?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query terms to search this blog for matching posts. */ + q: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a post. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Whether the body content of the post is included with the result (default: true). */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included in the returned result (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to retrieve with the returned post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the post is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the post is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UsersResource { + /** Gets one user by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user to get. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.blogger/readme.md b/types/gapi.client.blogger/readme.md new file mode 100644 index 0000000000..7356d1e034 --- /dev/null +++ b/types/gapi.client.blogger/readme.md @@ -0,0 +1,222 @@ +# TypeScript typings for Blogger API v3 +API for access to the data within Blogger. +For detailed description please check [documentation](https://developers.google.com/blogger/docs/3.0/getting_started). + +## Installing + +Install typings for Blogger API: +``` +npm install @types/gapi.client.blogger@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('blogger', 'v3', () => { + // now we can use gapi.client.blogger + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your Blogger account + 'https://www.googleapis.com/auth/blogger', + + // View your Blogger account + 'https://www.googleapis.com/auth/blogger.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Blogger API resources: + +```typescript + +/* +Gets one blog and user info pair by blogId and userId. +*/ +await gapi.client.blogUserInfos.get({ blogId: "blogId", userId: "userId", }); + +/* +Gets one blog by ID. +*/ +await gapi.client.blogs.get({ blogId: "blogId", }); + +/* +Retrieve a Blog by URL. +*/ +await gapi.client.blogs.getByUrl({ url: "url", }); + +/* +Retrieves a list of blogs, possibly filtered. +*/ +await gapi.client.blogs.listByUser({ userId: "userId", }); + +/* +Marks a comment as not spam. +*/ +await gapi.client.comments.approve({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Delete a comment by ID. +*/ +await gapi.client.comments.delete({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Gets one comment by ID. +*/ +await gapi.client.comments.get({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Retrieves the comments for a post, possibly filtered. +*/ +await gapi.client.comments.list({ blogId: "blogId", postId: "postId", }); + +/* +Retrieves the comments for a blog, across all posts, possibly filtered. +*/ +await gapi.client.comments.listByBlog({ blogId: "blogId", }); + +/* +Marks a comment as spam. +*/ +await gapi.client.comments.markAsSpam({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Removes the content of a comment. +*/ +await gapi.client.comments.removeContent({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Retrieve pageview stats for a Blog. +*/ +await gapi.client.pageViews.get({ blogId: "blogId", }); + +/* +Delete a page by ID. +*/ +await gapi.client.pages.delete({ blogId: "blogId", pageId: "pageId", }); + +/* +Gets one blog page by ID. +*/ +await gapi.client.pages.get({ blogId: "blogId", pageId: "pageId", }); + +/* +Add a page. +*/ +await gapi.client.pages.insert({ blogId: "blogId", }); + +/* +Retrieves the pages for a blog, optionally including non-LIVE statuses. +*/ +await gapi.client.pages.list({ blogId: "blogId", }); + +/* +Update a page. This method supports patch semantics. +*/ +await gapi.client.pages.patch({ blogId: "blogId", pageId: "pageId", }); + +/* +Publishes a draft page. +*/ +await gapi.client.pages.publish({ blogId: "blogId", pageId: "pageId", }); + +/* +Revert a published or scheduled page to draft state. +*/ +await gapi.client.pages.revert({ blogId: "blogId", pageId: "pageId", }); + +/* +Update a page. +*/ +await gapi.client.pages.update({ blogId: "blogId", pageId: "pageId", }); + +/* +Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, specific to the user. +*/ +await gapi.client.postUserInfos.get({ blogId: "blogId", postId: "postId", userId: "userId", }); + +/* +Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user. +*/ +await gapi.client.postUserInfos.list({ blogId: "blogId", userId: "userId", }); + +/* +Delete a post by ID. +*/ +await gapi.client.posts.delete({ blogId: "blogId", postId: "postId", }); + +/* +Get a post by ID. +*/ +await gapi.client.posts.get({ blogId: "blogId", postId: "postId", }); + +/* +Retrieve a Post by Path. +*/ +await gapi.client.posts.getByPath({ blogId: "blogId", path: "path", }); + +/* +Add a post. +*/ +await gapi.client.posts.insert({ blogId: "blogId", }); + +/* +Retrieves a list of posts, possibly filtered. +*/ +await gapi.client.posts.list({ blogId: "blogId", }); + +/* +Update a post. This method supports patch semantics. +*/ +await gapi.client.posts.patch({ blogId: "blogId", postId: "postId", }); + +/* +Publishes a draft post, optionally at the specific time of the given publishDate parameter. +*/ +await gapi.client.posts.publish({ blogId: "blogId", postId: "postId", }); + +/* +Revert a published or scheduled post to draft state. +*/ +await gapi.client.posts.revert({ blogId: "blogId", postId: "postId", }); + +/* +Search for a post. +*/ +await gapi.client.posts.search({ blogId: "blogId", q: "q", }); + +/* +Update a post. +*/ +await gapi.client.posts.update({ blogId: "blogId", postId: "postId", }); + +/* +Gets one user by ID. +*/ +await gapi.client.users.get({ userId: "userId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.blogger/tsconfig.json b/types/gapi.client.blogger/tsconfig.json new file mode 100644 index 0000000000..1b5be0ad2b --- /dev/null +++ b/types/gapi.client.blogger/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.blogger-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.blogger/tslint.json b/types/gapi.client.blogger/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.blogger/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.books/gapi.client.books-tests.ts b/types/gapi.client.books/gapi.client.books-tests.ts new file mode 100644 index 0000000000..c7f57f61d7 --- /dev/null +++ b/types/gapi.client.books/gapi.client.books-tests.ts @@ -0,0 +1,193 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('books', 'v1', () => { + /** now we can use gapi.client.books */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your books */ + 'https://www.googleapis.com/auth/books', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves metadata for a specific bookshelf for the specified user. */ + await gapi.client.bookshelves.get({ + shelf: "shelf", + source: "source", + userId: "userId", + }); + /** Retrieves a list of public bookshelves for the specified user. */ + await gapi.client.bookshelves.list({ + source: "source", + userId: "userId", + }); + await gapi.client.cloudloading.addBook({ + drive_document_id: "drive_document_id", + mime_type: "mime_type", + name: "name", + upload_client_token: "upload_client_token", + }); + /** Remove the book and its contents */ + await gapi.client.cloudloading.deleteBook({ + volumeId: "volumeId", + }); + await gapi.client.cloudloading.updateBook({ + }); + /** Returns a list of offline dictionary metadata available */ + await gapi.client.dictionary.listOfflineMetadata({ + cpksver: "cpksver", + }); + /** Gets the layer summary for a volume. */ + await gapi.client.layers.get({ + contentVersion: "contentVersion", + source: "source", + summaryId: "summaryId", + volumeId: "volumeId", + }); + /** List the layer summaries for a volume. */ + await gapi.client.layers.list({ + contentVersion: "contentVersion", + maxResults: 2, + pageToken: "pageToken", + source: "source", + volumeId: "volumeId", + }); + /** Gets the current settings for the user. */ + await gapi.client.myconfig.getUserSettings({ + }); + /** Release downloaded content access restriction. */ + await gapi.client.myconfig.releaseDownloadAccess({ + cpksver: "cpksver", + locale: "locale", + source: "source", + volumeIds: "volumeIds", + }); + /** Request concurrent and download access restrictions. */ + await gapi.client.myconfig.requestAccess({ + cpksver: "cpksver", + licenseTypes: "licenseTypes", + locale: "locale", + nonce: "nonce", + source: "source", + volumeId: "volumeId", + }); + /** Request downloaded content access for specified volumes on the My eBooks shelf. */ + await gapi.client.myconfig.syncVolumeLicenses({ + cpksver: "cpksver", + features: "features", + includeNonComicsSeries: true, + locale: "locale", + nonce: "nonce", + showPreorders: true, + source: "source", + volumeIds: "volumeIds", + }); + /** + * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects + * will retain the existing value. + */ + await gapi.client.myconfig.updateUserSettings({ + }); + /** Returns notification details for a given notification id. */ + await gapi.client.notification.get({ + locale: "locale", + notification_id: "notification_id", + source: "source", + }); + /** List categories for onboarding experience. */ + await gapi.client.onboarding.listCategories({ + locale: "locale", + }); + /** List available volumes under categories for onboarding experience. */ + await gapi.client.onboarding.listCategoryVolumes({ + categoryId: "categoryId", + locale: "locale", + maxAllowedMaturityRating: "maxAllowedMaturityRating", + pageSize: 4, + pageToken: "pageToken", + }); + /** Returns a stream of personalized book clusters */ + await gapi.client.personalizedstream.get({ + locale: "locale", + maxAllowedMaturityRating: "maxAllowedMaturityRating", + source: "source", + }); + await gapi.client.promooffer.accept({ + androidId: "androidId", + device: "device", + manufacturer: "manufacturer", + model: "model", + offerId: "offerId", + product: "product", + serial: "serial", + volumeId: "volumeId", + }); + await gapi.client.promooffer.dismiss({ + androidId: "androidId", + device: "device", + manufacturer: "manufacturer", + model: "model", + offerId: "offerId", + product: "product", + serial: "serial", + }); + /** Returns a list of promo offers available to the user */ + await gapi.client.promooffer.get({ + androidId: "androidId", + device: "device", + manufacturer: "manufacturer", + model: "model", + product: "product", + serial: "serial", + }); + /** Returns Series metadata for the given series ids. */ + await gapi.client.series.get({ + series_id: "series_id", + }); + /** Gets volume information for a single volume. */ + await gapi.client.volumes.get({ + country: "country", + includeNonComicsSeries: true, + partner: "partner", + projection: "projection", + source: "source", + user_library_consistent_read: true, + volumeId: "volumeId", + }); + /** Performs a book search. */ + await gapi.client.volumes.list({ + download: "download", + filter: "filter", + langRestrict: "langRestrict", + libraryRestrict: "libraryRestrict", + maxAllowedMaturityRating: "maxAllowedMaturityRating", + maxResults: 6, + orderBy: "orderBy", + partner: "partner", + printType: "printType", + projection: "projection", + q: "q", + showPreorders: true, + source: "source", + startIndex: 14, + }); + } +}); diff --git a/types/gapi.client.books/index.d.ts b/types/gapi.client.books/index.d.ts new file mode 100644 index 0000000000..e0ca0a63af --- /dev/null +++ b/types/gapi.client.books/index.d.ts @@ -0,0 +1,2447 @@ +// Type definitions for Google Books API v1 1.0 +// Project: https://developers.google.com/books/docs/v1/getting_started +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/books/v1/rest + +/// + +declare namespace gapi.client { + /** Load Books API v1 */ + function load(name: "books", version: "v1"): PromiseLike; + function load(name: "books", version: "v1", callback: () => any): void; + + const bookshelves: books.BookshelvesResource; + + const cloudloading: books.CloudloadingResource; + + const dictionary: books.DictionaryResource; + + const layers: books.LayersResource; + + const myconfig: books.MyconfigResource; + + const mylibrary: books.MylibraryResource; + + const notification: books.NotificationResource; + + const onboarding: books.OnboardingResource; + + const personalizedstream: books.PersonalizedstreamResource; + + const promooffer: books.PromoofferResource; + + const series: books.SeriesResource; + + const volumes: books.VolumesResource; + + namespace books { + interface Annotation { + /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + afterSelectedText?: string; + /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + beforeSelectedText?: string; + /** Selection ranges sent from the client. */ + clientVersionRanges?: { + /** Range in CFI format for this annotation sent by client. */ + cfiRange?: BooksAnnotationsRange; + /** Content version the client sent in. */ + contentVersion?: string; + /** Range in GB image format for this annotation sent by client. */ + gbImageRange?: BooksAnnotationsRange; + /** Range in GB text format for this annotation sent by client. */ + gbTextRange?: BooksAnnotationsRange; + /** Range in image CFI format for this annotation sent by client. */ + imageCfiRange?: BooksAnnotationsRange; + }; + /** Timestamp for the created time of this annotation. */ + created?: string; + /** Selection ranges for the most recent content version. */ + currentVersionRanges?: { + /** Range in CFI format for this annotation for version above. */ + cfiRange?: BooksAnnotationsRange; + /** Content version applicable to ranges below. */ + contentVersion?: string; + /** Range in GB image format for this annotation for version above. */ + gbImageRange?: BooksAnnotationsRange; + /** Range in GB text format for this annotation for version above. */ + gbTextRange?: BooksAnnotationsRange; + /** Range in image CFI format for this annotation for version above. */ + imageCfiRange?: BooksAnnotationsRange; + }; + /** User-created data for this annotation. */ + data?: string; + /** Indicates that this annotation is deleted. */ + deleted?: boolean; + /** The highlight style for this annotation. */ + highlightStyle?: string; + /** Id of this annotation, in the form of a GUID. */ + id?: string; + /** Resource type. */ + kind?: string; + /** The layer this annotation is for. */ + layerId?: string; + layerSummary?: { + /** Maximum allowed characters on this layer, especially for the "copy" layer. */ + allowedCharacterCount?: number; + /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ + limitType?: string; + /** Remaining allowed characters on this layer, especially for the "copy" layer. */ + remainingCharacterCount?: number; + }; + /** Pages that this annotation spans. */ + pageIds?: string[]; + /** Excerpt from the volume. */ + selectedText?: string; + /** URL to this resource. */ + selfLink?: string; + /** Timestamp for the last time this annotation was modified. */ + updated?: string; + /** The volume that this annotation belongs to. */ + volumeId?: string; + } + interface Annotationdata { + /** The type of annotation this data is for. */ + annotationType?: string; + data?: any; + /** Base64 encoded data for this annotation data. */ + encoded_data?: string; + /** Unique id for this annotation data. */ + id?: string; + /** Resource Type */ + kind?: string; + /** The Layer id for this data. * */ + layerId?: string; + /** URL for this resource. * */ + selfLink?: string; + /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ + updated?: string; + /** The volume id for this data. * */ + volumeId?: string; + } + interface Annotations { + /** A list of annotations. */ + items?: Annotation[]; + /** Resource type. */ + kind?: string; + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string; + /** Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. */ + totalItems?: number; + } + interface AnnotationsSummary { + kind?: string; + layers?: Array<{ + allowedCharacterCount?: number; + layerId?: string; + limitType?: string; + remainingCharacterCount?: number; + updated?: string; + }>; + } + interface Annotationsdata { + /** A list of Annotation Data. */ + items?: Annotationdata[]; + /** Resource type */ + kind?: string; + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string; + /** The total number of volume annotations found. */ + totalItems?: number; + } + interface BooksAnnotationsRange { + /** The offset from the ending position. */ + endOffset?: string; + /** The ending position for the range. */ + endPosition?: string; + /** The offset from the starting position. */ + startOffset?: string; + /** The starting position for the range. */ + startPosition?: string; + } + interface BooksCloudloadingResource { + author?: string; + processingState?: string; + title?: string; + volumeId?: string; + } + interface BooksVolumesRecommendedRateResponse { + consistency_token?: string; + } + interface Bookshelf { + /** Whether this bookshelf is PUBLIC or PRIVATE. */ + access?: string; + /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ + created?: string; + /** Description of this bookshelf. */ + description?: string; + /** Id of this bookshelf, only unique by user. */ + id?: number; + /** Resource type for bookshelf metadata. */ + kind?: string; + /** URL to this resource. */ + selfLink?: string; + /** Title of this bookshelf. */ + title?: string; + /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ + updated?: string; + /** Number of volumes in this bookshelf. */ + volumeCount?: number; + /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ + volumesLastUpdated?: string; + } + interface Bookshelves { + /** A list of bookshelves. */ + items?: Bookshelf[]; + /** Resource type. */ + kind?: string; + } + interface Category { + /** A list of onboarding categories. */ + items?: Array<{ + badgeUrl?: string; + categoryId?: string; + name?: string; + }>; + /** Resource type. */ + kind?: string; + } + interface ConcurrentAccessRestriction { + /** Whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean; + /** Resource type. */ + kind?: string; + /** The maximum number of concurrent access licenses for this volume. */ + maxConcurrentDevices?: number; + /** Error/warning message. */ + message?: string; + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string; + /** Error/warning reason code. */ + reasonCode?: string; + /** Whether this volume has any concurrent access restrictions. */ + restricted?: boolean; + /** Response signature. */ + signature?: string; + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string; + /** Time in seconds for license auto-expiration. */ + timeWindowSeconds?: number; + /** Identifies the volume for which this entry applies. */ + volumeId?: string; + } + interface Dictlayerdata { + common?: { + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string; + }; + dict?: { + /** The source, url and attribution for this dictionary data. */ + source?: { + attribution?: string; + url?: string; + }; + words?: Array<{ + derivatives?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + examples?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + senses?: Array<{ + conjugations?: Array<{ + type?: string; + value?: string; + }>; + definitions?: Array<{ + definition?: string; + examples?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + }>; + partOfSpeech?: string; + pronunciation?: string; + pronunciationUrl?: string; + source?: { + attribution?: string; + url?: string; + }; + syllabification?: string; + synonyms?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + }>; + /** The words with different meanings but not related words, e.g. "go" (game) and "go" (verb). */ + source?: { + attribution?: string; + url?: string; + }; + }>; + }; + kind?: string; + } + interface Discoveryclusters { + clusters?: Array<{ + banner_with_content_container?: { + fillColorArgb?: string; + imageUrl?: string; + maskColorArgb?: string; + moreButtonText?: string; + moreButtonUrl?: string; + textColorArgb?: string; + }; + subTitle?: string; + title?: string; + totalVolumes?: number; + uid?: string; + volumes?: Volume[]; + }>; + /** Resorce type. */ + kind?: string; + totalClusters?: number; + } + interface DownloadAccessRestriction { + /** If restricted, whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean; + /** If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). */ + downloadsAcquired?: number; + /** If deviceAllowed, whether access was just acquired with this request. */ + justAcquired?: boolean; + /** Resource type. */ + kind?: string; + /** If restricted, the maximum number of content download licenses for this volume. */ + maxDownloadDevices?: number; + /** Error/warning message. */ + message?: string; + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string; + /** + * Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 + * WARNING_USED_LAST_ACCESS + */ + reasonCode?: string; + /** Whether this volume has any download access restrictions. */ + restricted?: boolean; + /** Response signature. */ + signature?: string; + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string; + /** Identifies the volume for which this entry applies. */ + volumeId?: string; + } + interface DownloadAccesses { + /** A list of download access responses. */ + downloadAccessList?: DownloadAccessRestriction[]; + /** Resource type. */ + kind?: string; + } + interface Geolayerdata { + common?: { + /** The language of the information url and description. */ + lang?: string; + /** The URL for the preview image information. */ + previewImageUrl?: string; + /** The description for this location. */ + snippet?: string; + /** The URL for information for this location. Ex: wikipedia link. */ + snippetUrl?: string; + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string; + }; + geo?: { + /** The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates. */ + boundary?: Array>; + /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ + cachePolicy?: string; + /** The country code of the location. */ + countryCode?: string; + /** The latitude of the location. */ + latitude?: number; + /** The longitude of the location. */ + longitude?: number; + /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ + mapType?: string; + /** The viewport for showing this location. This is a latitude, longitude rectangle. */ + viewport?: { + hi?: { + latitude?: number; + longitude?: number; + }; + lo?: { + latitude?: number; + longitude?: number; + }; + }; + /** + * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to + * individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels + */ + zoom?: number; + }; + kind?: string; + } + interface Layersummaries { + /** A list of layer summary items. */ + items?: Layersummary[]; + /** Resource type. */ + kind?: string; + /** The total number of layer summaries found. */ + totalItems?: number; + } + interface Layersummary { + /** The number of annotations for this layer. */ + annotationCount?: number; + /** The list of annotation types contained for this layer. */ + annotationTypes?: string[]; + /** Link to get data for this annotation. */ + annotationsDataLink?: string; + /** The link to get the annotations for this layer. */ + annotationsLink?: string; + /** The content version this resource is for. */ + contentVersion?: string; + /** The number of data items for this layer. */ + dataCount?: number; + /** Unique id of this layer summary. */ + id?: string; + /** Resource Type */ + kind?: string; + /** The layer id for this summary. */ + layerId?: string; + /** URL to this resource. */ + selfLink?: string; + /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ + updated?: string; + /** + * The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* + * responses. The actual annotation data is versioned separately. + */ + volumeAnnotationsVersion?: string; + /** The volume id this resource is for. */ + volumeId?: string; + } + interface Metadata { + /** A list of offline dictionary metadata. */ + items?: Array<{ + download_url?: string; + encrypted_key?: string; + language?: string; + size?: string; + version?: string; + }>; + /** Resource type. */ + kind?: string; + } + interface Notification { + body?: string; + /** The list of crm experiment ids. */ + crmExperimentIds?: string[]; + doc_id?: string; + doc_type?: string; + dont_show_notification?: boolean; + iconUrl?: string; + /** Resource type. */ + kind?: string; + notificationGroup?: string; + notification_type?: string; + pcampaign_id?: string; + reason?: string; + show_notification_settings_action?: boolean; + targetUrl?: string; + title?: string; + } + interface Offers { + /** A list of offers. */ + items?: Array<{ + artUrl?: string; + gservicesKey?: string; + id?: string; + items?: Array<{ + author?: string; + canonicalVolumeLink?: string; + coverUrl?: string; + description?: string; + title?: string; + volumeId?: string; + }>; + }>; + /** Resource type. */ + kind?: string; + } + interface ReadingPosition { + /** Position in an EPUB as a CFI. */ + epubCfiPosition?: string; + /** Position in a volume for image-based content. */ + gbImagePosition?: string; + /** Position in a volume for text-based content. */ + gbTextPosition?: string; + /** Resource type for a reading position. */ + kind?: string; + /** Position in a PDF file. */ + pdfPosition?: string; + /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ + updated?: string; + /** Volume id associated with this reading position. */ + volumeId?: string; + } + interface RequestAccess { + /** A concurrent access response. */ + concurrentAccess?: ConcurrentAccessRestriction; + /** A download access response. */ + downloadAccess?: DownloadAccessRestriction; + /** Resource type. */ + kind?: string; + } + interface Review { + /** Author of this review. */ + author?: { + /** Name of this person. */ + displayName?: string; + }; + /** Review text. */ + content?: string; + /** Date of this review. */ + date?: string; + /** URL for the full review text, for reviews gathered from the web. */ + fullTextUrl?: string; + /** Resource type for a review. */ + kind?: string; + /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ + rating?: string; + /** Information regarding the source of this review, when the review is not from a Google Books user. */ + source?: { + /** Name of the source. */ + description?: string; + /** Extra text about the source of the review. */ + extraDescription?: string; + /** URL of the source of the review. */ + url?: string; + }; + /** Title for this review. */ + title?: string; + /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ + type?: string; + /** Volume that this review is for. */ + volumeId?: string; + } + interface Series { + /** Resource type. */ + kind?: string; + series?: Array<{ + bannerImageUrl?: string; + imageUrl?: string; + seriesId?: string; + seriesType?: string; + title?: string; + }>; + } + interface Seriesmembership { + /** Resorce type. */ + kind?: string; + member?: Volume[]; + nextPageToken?: string; + } + interface Usersettings { + /** Resource type. */ + kind?: string; + /** User settings in sub-objects, each for different purposes. */ + notesExport?: { + folderName?: string; + isEnabled?: boolean; + }; + notification?: { + moreFromAuthors?: { + opted_state?: string; + }; + moreFromSeries?: { + opted_state?: string; + }; + rewardExpirations?: { + opted_state?: string; + }; + }; + } + interface Volume { + /** + * Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in + * one country but not in another, e.g.). + */ + accessInfo?: { + /** + * Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE + * or NONE. (In LITE projection.) + */ + accessViewStatus?: string; + /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ + country?: string; + /** Information about a volume's download license access restrictions. */ + downloadAccess?: DownloadAccessRestriction; + /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ + driveImportedContentLink?: string; + /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ + embeddable?: boolean; + /** Information about epub content. (In LITE projection.) */ + epub?: { + /** URL to retrieve ACS token for epub download. (In LITE projection.) */ + acsTokenLink?: string; + /** URL to download epub. (In LITE projection.) */ + downloadLink?: string; + /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean; + }; + /** + * Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the + * content, if the client supports it. + */ + explicitOfflineLicenseManagement?: boolean; + /** Information about pdf content. (In LITE projection.) */ + pdf?: { + /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ + acsTokenLink?: string; + /** URL to download pdf. (In LITE projection.) */ + downloadLink?: string; + /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean; + }; + /** Whether or not this book is public domain in the country listed above. */ + publicDomain?: boolean; + /** Whether quote sharing is allowed for this volume. */ + quoteSharingAllowed?: boolean; + /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ + textToSpeechPermission?: string; + /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ + viewOrderUrl?: string; + /** + * The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of + * PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as + * non-eBooks. Public domain books will always have a value of ALL_PAGES. + */ + viewability?: string; + /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ + webReaderLink?: string; + }; + /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ + etag?: string; + /** Unique identifier for a volume. (In LITE projection.) */ + id?: string; + /** Resource type for a volume. (In LITE projection.) */ + kind?: string; + /** What layers exist in this volume and high level information about them. */ + layerInfo?: { + /** A layer should appear here if and only if the layer exists for this book. */ + layers?: Array<{ + /** The layer id of this layer (e.g. "geo"). */ + layerId?: string; + /** + * The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* + * responses. The actual annotation data is versioned separately. + */ + volumeAnnotationsVersion?: string; + }>; + }; + /** Recommendation related information for this volume. */ + recommendedInfo?: { + /** A text explaining why this volume is recommended. */ + explanation?: string; + }; + /** + * Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request + * originates from (i.e. books may not be for sale in certain countries). + */ + saleInfo?: { + /** URL to purchase this volume on the Google Books site. (In LITE projection) */ + buyLink?: string; + /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ + country?: string; + /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ + isEbook?: boolean; + /** Suggested retail price. (In LITE projection.) */ + listPrice?: { + /** Amount in the currency listed below. (In LITE projection.) */ + amount?: number; + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string; + }; + /** Offers available for this volume (sales and rentals). */ + offers?: Array<{ + /** The finsky offer type (e.g., PURCHASE=0 RENTAL=3) */ + finskyOfferType?: number; + /** Indicates whether the offer is giftable. */ + giftable?: boolean; + /** Offer list (=undiscounted) price in Micros. */ + listPrice?: { + amountInMicros?: number; + currencyCode?: string; + }; + /** The rental duration (for rental offers only). */ + rentalDuration?: { + count?: number; + unit?: string; + }; + /** Offer retail (=discounted) price in Micros */ + retailPrice?: { + amountInMicros?: number; + currencyCode?: string; + }; + }>; + /** The date on which this book is available for sale. */ + onSaleDate?: string; + /** + * The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In + * LITE projection.) + */ + retailPrice?: { + /** Amount in the currency listed below. (In LITE projection.) */ + amount?: number; + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string; + }; + /** + * Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, + * FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. + */ + saleability?: string; + }; + /** Search result information related to this volume. */ + searchInfo?: { + /** A text snippet containing the search query. */ + textSnippet?: string; + }; + /** URL to this resource. (In LITE projection.) */ + selfLink?: string; + /** User specific information related to this volume. (e.g. page this user last read or whether they purchased this book) */ + userInfo?: { + /** + * Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family + * sharing, etc. + */ + acquiredTime?: string; + /** How this volume was acquired. */ + acquisitionType?: number; + /** Copy/Paste accounting information. */ + copy?: { + allowedCharacterCount?: number; + limitType?: string; + remainingCharacterCount?: number; + updated?: string; + }; + /** Whether this volume is purchased, sample, pd download etc. */ + entitlementType?: number; + /** Information on the ability to share with the family. */ + familySharing?: { + /** The role of the user in the family. */ + familyRole?: string; + /** + * Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value + * is true, the user can initiate a family sharing action. + */ + isSharingAllowed?: boolean; + /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ + isSharingDisabledByFop?: boolean; + }; + /** Whether or not the user shared this volume with the family. */ + isFamilySharedFromUser?: boolean; + /** Whether or not the user received this volume through family sharing. */ + isFamilySharedToUser?: boolean; + /** Deprecated: Replaced by familySharing. */ + isFamilySharingAllowed?: boolean; + /** Deprecated: Replaced by familySharing. */ + isFamilySharingDisabledByFop?: boolean; + /** Whether or not this volume is currently in "my books." */ + isInMyBooks?: boolean; + /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ + isPreordered?: boolean; + /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ + isPurchased?: boolean; + /** Whether or not this volume was user uploaded. */ + isUploaded?: boolean; + /** The user's current reading position in the volume, if one is available. (In LITE projection.) */ + readingPosition?: ReadingPosition; + /** Period during this book is/was a valid rental. */ + rentalPeriod?: { + endUtcSec?: string; + startUtcSec?: string; + }; + /** Whether this book is an active or an expired rental. */ + rentalState?: string; + /** This user's review of this volume, if one exists. */ + review?: Review; + /** + * Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC + * date-time format). + */ + updated?: string; + userUploadedVolumeInfo?: { + processingState?: string; + }; + }; + /** General volume information. */ + volumeInfo?: { + /** Whether anonymous logging should be allowed. */ + allowAnonLogging?: boolean; + /** The names of the authors and/or editors for this volume. (In LITE projection) */ + authors?: string[]; + /** The mean review rating for this volume. (min = 1.0, max = 5.0) */ + averageRating?: number; + /** Canonical URL for a volume. (In LITE projection.) */ + canonicalVolumeLink?: string; + /** A list of subject categories, such as "Fiction", "Suspense", etc. */ + categories?: string[]; + /** An identifier for the version of the volume content (text & images). (In LITE projection) */ + contentVersion?: string; + /** + * A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE + * projection.) + */ + description?: string; + /** Physical dimensions of this volume. */ + dimensions?: { + /** Height or length of this volume (in cm). */ + height?: string; + /** Thickness of this volume (in cm). */ + thickness?: string; + /** Width of this volume (in cm). */ + width?: string; + }; + /** A list of image links for all the sizes that are available. (In LITE projection.) */ + imageLinks?: { + /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ + extraLarge?: string; + /** Image link for large size (width of ~800 pixels). (In LITE projection) */ + large?: string; + /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ + medium?: string; + /** Image link for small size (width of ~300 pixels). (In LITE projection) */ + small?: string; + /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ + smallThumbnail?: string; + /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ + thumbnail?: string; + }; + /** Industry standard identifiers for this volume. */ + industryIdentifiers?: Array<{ + /** Industry specific volume identifier. */ + identifier?: string; + /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ + type?: string; + }>; + /** URL to view information about this volume on the Google Books site. (In LITE projection) */ + infoLink?: string; + /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ + language?: string; + /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ + mainCategory?: string; + maturityRating?: string; + /** Total number of pages as per publisher metadata. */ + pageCount?: number; + /** A top-level summary of the panelization info in this volume. */ + panelizationSummary?: { + containsEpubBubbles?: boolean; + containsImageBubbles?: boolean; + epubBubbleVersion?: string; + imageBubbleVersion?: string; + }; + /** URL to preview this volume on the Google Books site. */ + previewLink?: string; + /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ + printType?: string; + /** Total number of printed pages in generated pdf representation. */ + printedPageCount?: number; + /** Date of publication. (In LITE projection.) */ + publishedDate?: string; + /** Publisher of this volume. (In LITE projection.) */ + publisher?: string; + /** The number of review ratings for this volume. */ + ratingsCount?: number; + /** The reading modes available for this volume. */ + readingModes?: any; + /** Total number of sample pages as per publisher metadata. */ + samplePageCount?: number; + seriesInfo?: Volumeseriesinfo; + /** Volume subtitle. (In LITE projection.) */ + subtitle?: string; + /** Volume title. (In LITE projection.) */ + title?: string; + }; + } + interface Volume2 { + /** A list of volumes. */ + items?: Volume[]; + /** Resource type. */ + kind?: string; + nextPageToken?: string; + } + interface Volumeannotation { + /** The annotation data id for this volume annotation. */ + annotationDataId?: string; + /** Link to get data for this annotation. */ + annotationDataLink?: string; + /** The type of annotation this is. */ + annotationType?: string; + /** The content ranges to identify the selected text. */ + contentRanges?: { + /** Range in CFI format for this annotation for version above. */ + cfiRange?: BooksAnnotationsRange; + /** Content version applicable to ranges below. */ + contentVersion?: string; + /** Range in GB image format for this annotation for version above. */ + gbImageRange?: BooksAnnotationsRange; + /** Range in GB text format for this annotation for version above. */ + gbTextRange?: BooksAnnotationsRange; + }; + /** Data for this annotation. */ + data?: string; + /** Indicates that this annotation is deleted. */ + deleted?: boolean; + /** Unique id of this volume annotation. */ + id?: string; + /** Resource Type */ + kind?: string; + /** The Layer this annotation is for. */ + layerId?: string; + /** Pages the annotation spans. */ + pageIds?: string[]; + /** Excerpt from the volume. */ + selectedText?: string; + /** URL to this resource. */ + selfLink?: string; + /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ + updated?: string; + /** The Volume this annotation is for. */ + volumeId?: string; + } + interface Volumeannotations { + /** A list of volume annotations. */ + items?: Volumeannotation[]; + /** Resource type */ + kind?: string; + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string; + /** The total number of volume annotations found. */ + totalItems?: number; + /** + * The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the + * annotation data, just the information in this response (e.g. the location of annotations in the book). + */ + version?: string; + } + interface Volumes { + /** A list of volumes. */ + items?: Volume[]; + /** Resource type. */ + kind?: string; + /** Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. */ + totalItems?: number; + } + interface Volumeseriesinfo { + /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ + bookDisplayNumber?: string; + /** Resource type. */ + kind?: string; + /** Short book title in the context of the series. */ + shortSeriesBookTitle?: string; + volumeSeries?: Array<{ + /** List of issues. Applicable only for Collection Edition and Omnibus. */ + issue?: Array<{ + issueDisplayNumber?: string; + issueOrderNumber?: number; + }>; + /** The book order number in the series. */ + orderNumber?: number; + /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ + seriesBookType?: string; + /** The series id. */ + seriesId?: string; + }>; + } + interface VolumesResource { + /** Retrieves volumes in a specific bookshelf for the specified user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf to retrieve volumes. */ + shelf: string; + /** Set to true to show pre-ordered books. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first element to return (starts at 0) */ + startIndex?: number; + /** ID of user for whom to retrieve bookshelf volumes. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BookshelvesResource { + /** Retrieves metadata for a specific bookshelf for the specified user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf to retrieve. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** ID of user for whom to retrieve bookshelves. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of public bookshelves for the specified user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** ID of user for whom to retrieve bookshelves. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + volumes: VolumesResource; + } + interface CloudloadingResource { + addBook(request: { + /** Data format for the response. */ + alt?: string; + /** A drive document id. The upload_client_token must not be set. */ + drive_document_id?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The document MIME type. It can be set only if the drive_document_id is set. */ + mime_type?: string; + /** The document name. It can be set only if the drive_document_id is set. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + upload_client_token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Remove the book and its contents */ + deleteBook(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The id of the book to be removed. */ + volumeId: string; + }): Request; + updateBook(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DictionaryResource { + /** Returns a list of offline dictionary metadata available */ + listOfflineMetadata(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to request the data. */ + cpksver: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AnnotationDataResource { + /** Gets the annotation data. */ + get(request: { + /** For the dictionary layer. Whether or not to allow web definitions. */ + allowWebDefinitions?: boolean; + /** Data format for the response. */ + alt?: string; + /** The ID of the annotation data to retrieve. */ + annotationDataId: string; + /** The content version for the volume you are trying to retrieve. */ + contentVersion: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The requested pixel height for any images. If height is provided width must also be provided. */ + h?: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotations. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The requested scale for the image. */ + scale?: number; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve annotations for. */ + volumeId: string; + /** The requested pixel width for any images. If width is provided height must also be provided. */ + w?: number; + }): Request; + /** Gets the annotation data for a volume and layer. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. */ + annotationDataId?: string; + /** The content version for the requested volume. */ + contentVersion: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The requested pixel height for any images. If height is provided width must also be provided. */ + h?: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotation data. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The requested scale for the image. */ + scale?: number; + /** String to identify the originator of this request. */ + source?: string; + /** RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). */ + updatedMax?: string; + /** RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve annotation data for. */ + volumeId: string; + /** The requested pixel width for any images. If width is provided height must also be provided. */ + w?: number; + }): Request; + } + interface VolumeAnnotationsResource { + /** Gets the volume annotation. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the volume annotation to retrieve. */ + annotationId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotations. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve annotations for. */ + volumeId: string; + }): Request; + /** Gets the volume annotations for a volume and layer. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion: string; + /** The end offset to end retrieving data from. */ + endOffset?: string; + /** The end position to end retrieving data from. */ + endPosition?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotations. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. */ + showDeleted?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** The start offset to start retrieving data from. */ + startOffset?: string; + /** The start position to start retrieving data from. */ + startPosition?: string; + /** RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). */ + updatedMax?: string; + /** RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The version of the volume annotations that you are requesting. */ + volumeAnnotationsVersion?: string; + /** The volume to retrieve annotations for. */ + volumeId: string; + }): Request; + } + interface LayersResource { + /** Gets the layer summary for a volume. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** The ID for the layer to get the summary for. */ + summaryId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve layers for. */ + volumeId: string; + }): Request; + /** List the layer summaries for a volume. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve layers for. */ + volumeId: string; + }): Request; + annotationData: AnnotationDataResource; + volumeAnnotations: VolumeAnnotationsResource; + } + interface MyconfigResource { + /** Gets the current settings for the user. */ + getUserSettings(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Release downloaded content access restriction. */ + releaseDownloadAccess(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to release the restriction. */ + cpksver: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume(s) to release restrictions for. */ + volumeIds: string; + }): Request; + /** Request concurrent and download access restrictions. */ + requestAccess(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to request the restrictions. */ + cpksver: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The type of access license to request. If not specified, the default is BOTH. */ + licenseTypes?: string; + /** ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. */ + locale?: string; + /** The client nonce value. */ + nonce: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to request concurrent/download restrictions for. */ + volumeId: string; + }): Request; + /** Request downloaded content access for specified volumes on the My eBooks shelf. */ + syncVolumeLicenses(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to release the restriction. */ + cpksver: string; + /** List of features supported by the client, i.e., 'RENTALS' */ + features?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Set to true to include non-comics series. Defaults to false. */ + includeNonComicsSeries?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. */ + locale?: string; + /** The client nonce value. */ + nonce: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to show pre-ordered books. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume(s) to request download restrictions for. */ + volumeIds?: string; + }): Request; + /** + * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects + * will retain the existing value. + */ + updateUserSettings(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AnnotationsResource { + /** Deletes an annotation. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID for the annotation to delete. */ + annotationId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new annotation. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID for the annotation to insert. */ + annotationId?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Requests that only the summary of the specified layer be provided in the response. */ + showOnlySummaryInResponse?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of annotations, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The layer ID to limit annotation by. */ + layerId?: string; + /** The layer ID(s) to limit annotation by. */ + layerIds?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. */ + showDeleted?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). */ + updatedMax?: string; + /** RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to restrict annotations to. */ + volumeId?: string; + }): Request; + /** Gets the summary of specified layers. */ + summary(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Array of layer IDs to get the summary for. */ + layerIds: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Volume id to get the summary for. */ + volumeId: string; + }): Request; + /** Updates an existing annotation. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID for the annotation to update. */ + annotationId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VolumesResource { + /** Gets volume information for volumes on a bookshelf. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Restrict information returned to a set of selected fields. */ + projection?: string; + /** Full-text search query string in this bookshelf. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The bookshelf ID or name retrieve volumes for. */ + shelf: string; + /** Set to true to show pre-ordered books. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first element to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BookshelvesResource { + /** Adds a volume to a bookshelf. */ + addVolume(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The reason for which the book is added to the library. */ + reason?: string; + /** ID of bookshelf to which to add a volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume to add. */ + volumeId: string; + }): Request; + /** Clears all volumes from a bookshelf. */ + clearVolumes(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf from which to remove a volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves metadata for a specific bookshelf belonging to the authenticated user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf to retrieve. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of bookshelves belonging to the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves a volume within a bookshelf. */ + moveVolume(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf with the volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume to move. */ + volumeId: string; + /** Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) */ + volumePosition: number; + }): Request; + /** Removes a volume from a bookshelf. */ + removeVolume(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The reason for which the book is removed from the library. */ + reason?: string; + /** ID of bookshelf from which to remove a volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume to remove. */ + volumeId: string; + }): Request; + volumes: VolumesResource; + } + interface ReadingpositionsResource { + /** Retrieves my reading position information for a volume. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Volume content version for which this reading position is requested. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume for which to retrieve a reading position. */ + volumeId: string; + }): Request; + /** Sets my reading position information for a volume. */ + setPosition(request: { + /** Action that caused this reading position to be set. */ + action?: string; + /** Data format for the response. */ + alt?: string; + /** Volume content version for which this reading position applies. */ + contentVersion?: string; + /** Random persistent device cookie optional on set position. */ + deviceCookie?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Position string for the new volume reading position. */ + position: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** RFC 3339 UTC format timestamp associated with this reading position. */ + timestamp: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume for which to update the reading position. */ + volumeId: string; + }): Request; + } + interface MylibraryResource { + annotations: AnnotationsResource; + bookshelves: BookshelvesResource; + readingpositions: ReadingpositionsResource; + } + interface NotificationResource { + /** Returns notification details for a given notification id. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. */ + locale?: string; + /** String to identify the notification. */ + notification_id: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OnboardingResource { + /** List categories for onboarding experience. */ + listCategories(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List available volumes under categories for onboarding experience. */ + listCategoryVolumes(request: { + /** Data format for the response. */ + alt?: string; + /** List of category ids requested. */ + categoryId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. */ + locale?: string; + /** The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Number of maximum results per page to be included in the response. */ + pageSize?: number; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PersonalizedstreamResource { + /** Returns a stream of personalized book clusters */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PromoofferResource { + accept(request: { + /** Data format for the response. */ + alt?: string; + /** device android_id */ + androidId?: string; + /** device device */ + device?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** device manufacturer */ + manufacturer?: string; + /** device model */ + model?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + offerId?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** device product */ + product?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** device serial */ + serial?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Volume id to exercise the offer */ + volumeId?: string; + }): Request; + dismiss(request: { + /** Data format for the response. */ + alt?: string; + /** device android_id */ + androidId?: string; + /** device device */ + device?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** device manufacturer */ + manufacturer?: string; + /** device model */ + model?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Offer to dimiss */ + offerId?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** device product */ + product?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** device serial */ + serial?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a list of promo offers available to the user */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** device android_id */ + androidId?: string; + /** device device */ + device?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** device manufacturer */ + manufacturer?: string; + /** device model */ + model?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** device product */ + product?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** device serial */ + serial?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MembershipResource { + /** Returns Series membership data given the series id. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Number of maximum results per page to be included in the response. */ + page_size?: number; + /** The value of the nextToken from the previous page. */ + page_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String that identifies the series */ + series_id: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SeriesResource { + /** Returns Series metadata for the given series ids. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String that identifies the series */ + series_id: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + membership: MembershipResource; + } + interface AssociatedResource { + /** Return a list of associated books. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Association type. */ + association?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of the source volume. */ + volumeId: string; + }): Request; + } + interface MybooksResource { + /** Return a list of books in My Library. */ + list(request: { + /** How the book was acquired */ + acquireMethod?: string; + /** Data format for the response. */ + alt?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. */ + locale?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. */ + processingState?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first result to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RecommendedResource { + /** Return a list of recommended books for the current user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Rate a recommended book for the current user. */ + rate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Rating to be given to the volume. */ + rating: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of the source volume. */ + volumeId: string; + }): Request; + } + interface UseruploadedResource { + /** Return a list of books uploaded by the current user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The processing state of the user uploaded volumes to be returned. */ + processingState?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first result to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The ids of the volumes to be returned. If not specified all that match the processingState are returned. */ + volumeId?: string; + }): Request; + } + interface VolumesResource { + /** Gets volume information for a single volume. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Set to true to include non-comics series. Defaults to false. */ + includeNonComicsSeries?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Brand results for partner ID. */ + partner?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Restrict information returned to a set of selected fields. */ + projection?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + user_library_consistent_read?: boolean; + /** ID of volume to retrieve. */ + volumeId: string; + }): Request; + /** Performs a book search. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Restrict to volumes by download availability. */ + download?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filter search results. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Restrict results to books with this language code. */ + langRestrict?: string; + /** Restrict search to this user's library. */ + libraryRestrict?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort search results. */ + orderBy?: string; + /** Restrict and brand results for partner ID. */ + partner?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Restrict to books or magazines. */ + printType?: string; + /** Restrict information returned to a set of selected fields. */ + projection?: string; + /** Full-text search query string. */ + q: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to show books available for preorder. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first result to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + associated: AssociatedResource; + mybooks: MybooksResource; + recommended: RecommendedResource; + useruploaded: UseruploadedResource; + } + } +} diff --git a/types/gapi.client.books/readme.md b/types/gapi.client.books/readme.md new file mode 100644 index 0000000000..1e708d44d0 --- /dev/null +++ b/types/gapi.client.books/readme.md @@ -0,0 +1,169 @@ +# TypeScript typings for Books API v1 +Searches for books and manages your Google Books library. +For detailed description please check [documentation](https://developers.google.com/books/docs/v1/getting_started). + +## Installing + +Install typings for Books API: +``` +npm install @types/gapi.client.books@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('books', 'v1', () => { + // now we can use gapi.client.books + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your books + 'https://www.googleapis.com/auth/books', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Books API resources: + +```typescript + +/* +Retrieves metadata for a specific bookshelf for the specified user. +*/ +await gapi.client.bookshelves.get({ shelf: "shelf", userId: "userId", }); + +/* +Retrieves a list of public bookshelves for the specified user. +*/ +await gapi.client.bookshelves.list({ userId: "userId", }); + +/* + +*/ +await gapi.client.cloudloading.addBook({ }); + +/* +Remove the book and its contents +*/ +await gapi.client.cloudloading.deleteBook({ volumeId: "volumeId", }); + +/* + +*/ +await gapi.client.cloudloading.updateBook({ }); + +/* +Returns a list of offline dictionary metadata available +*/ +await gapi.client.dictionary.listOfflineMetadata({ cpksver: "cpksver", }); + +/* +Gets the layer summary for a volume. +*/ +await gapi.client.layers.get({ summaryId: "summaryId", volumeId: "volumeId", }); + +/* +List the layer summaries for a volume. +*/ +await gapi.client.layers.list({ volumeId: "volumeId", }); + +/* +Gets the current settings for the user. +*/ +await gapi.client.myconfig.getUserSettings({ }); + +/* +Release downloaded content access restriction. +*/ +await gapi.client.myconfig.releaseDownloadAccess({ cpksver: "cpksver", volumeIds: "volumeIds", }); + +/* +Request concurrent and download access restrictions. +*/ +await gapi.client.myconfig.requestAccess({ cpksver: "cpksver", nonce: "nonce", source: "source", volumeId: "volumeId", }); + +/* +Request downloaded content access for specified volumes on the My eBooks shelf. +*/ +await gapi.client.myconfig.syncVolumeLicenses({ cpksver: "cpksver", nonce: "nonce", source: "source", }); + +/* +Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. +*/ +await gapi.client.myconfig.updateUserSettings({ }); + +/* +Returns notification details for a given notification id. +*/ +await gapi.client.notification.get({ notification_id: "notification_id", }); + +/* +List categories for onboarding experience. +*/ +await gapi.client.onboarding.listCategories({ }); + +/* +List available volumes under categories for onboarding experience. +*/ +await gapi.client.onboarding.listCategoryVolumes({ }); + +/* +Returns a stream of personalized book clusters +*/ +await gapi.client.personalizedstream.get({ }); + +/* + +*/ +await gapi.client.promooffer.accept({ }); + +/* + +*/ +await gapi.client.promooffer.dismiss({ }); + +/* +Returns a list of promo offers available to the user +*/ +await gapi.client.promooffer.get({ }); + +/* +Returns Series metadata for the given series ids. +*/ +await gapi.client.series.get({ series_id: "series_id", }); + +/* +Gets volume information for a single volume. +*/ +await gapi.client.volumes.get({ volumeId: "volumeId", }); + +/* +Performs a book search. +*/ +await gapi.client.volumes.list({ q: "q", }); +``` \ No newline at end of file diff --git a/types/gapi.client.books/tsconfig.json b/types/gapi.client.books/tsconfig.json new file mode 100644 index 0000000000..d011bdcf5c --- /dev/null +++ b/types/gapi.client.books/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.books-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.books/tslint.json b/types/gapi.client.books/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.books/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.calendar/gapi.client.calendar-tests.ts b/types/gapi.client.calendar/gapi.client.calendar-tests.ts new file mode 100644 index 0000000000..807816b26f --- /dev/null +++ b/types/gapi.client.calendar/gapi.client.calendar-tests.ts @@ -0,0 +1,275 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('calendar', 'v3', () => { + /** now we can use gapi.client.calendar */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your calendars */ + 'https://www.googleapis.com/auth/calendar', + /** View your calendars */ + 'https://www.googleapis.com/auth/calendar.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes an access control rule. */ + await gapi.client.acl.delete({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Returns an access control rule. */ + await gapi.client.acl.get({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Creates an access control rule. */ + await gapi.client.acl.insert({ + calendarId: "calendarId", + }); + /** Returns the rules in the access control list for the calendar. */ + await gapi.client.acl.list({ + calendarId: "calendarId", + maxResults: 2, + pageToken: "pageToken", + showDeleted: true, + syncToken: "syncToken", + }); + /** Updates an access control rule. This method supports patch semantics. */ + await gapi.client.acl.patch({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Updates an access control rule. */ + await gapi.client.acl.update({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Watch for changes to ACL resources. */ + await gapi.client.acl.watch({ + calendarId: "calendarId", + maxResults: 2, + pageToken: "pageToken", + showDeleted: true, + syncToken: "syncToken", + }); + /** Deletes an entry on the user's calendar list. */ + await gapi.client.calendarList.delete({ + calendarId: "calendarId", + }); + /** Returns an entry on the user's calendar list. */ + await gapi.client.calendarList.get({ + calendarId: "calendarId", + }); + /** Adds an entry to the user's calendar list. */ + await gapi.client.calendarList.insert({ + colorRgbFormat: true, + }); + /** Returns entries on the user's calendar list. */ + await gapi.client.calendarList.list({ + maxResults: 1, + minAccessRole: "minAccessRole", + pageToken: "pageToken", + showDeleted: true, + showHidden: true, + syncToken: "syncToken", + }); + /** Updates an entry on the user's calendar list. This method supports patch semantics. */ + await gapi.client.calendarList.patch({ + calendarId: "calendarId", + colorRgbFormat: true, + }); + /** Updates an entry on the user's calendar list. */ + await gapi.client.calendarList.update({ + calendarId: "calendarId", + colorRgbFormat: true, + }); + /** Watch for changes to CalendarList resources. */ + await gapi.client.calendarList.watch({ + maxResults: 1, + minAccessRole: "minAccessRole", + pageToken: "pageToken", + showDeleted: true, + showHidden: true, + syncToken: "syncToken", + }); + /** Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. */ + await gapi.client.calendars.clear({ + calendarId: "calendarId", + }); + /** Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. */ + await gapi.client.calendars.delete({ + calendarId: "calendarId", + }); + /** Returns metadata for a calendar. */ + await gapi.client.calendars.get({ + calendarId: "calendarId", + }); + /** Creates a secondary calendar. */ + await gapi.client.calendars.insert({ + }); + /** Updates metadata for a calendar. This method supports patch semantics. */ + await gapi.client.calendars.patch({ + calendarId: "calendarId", + }); + /** Updates metadata for a calendar. */ + await gapi.client.calendars.update({ + calendarId: "calendarId", + }); + /** Stop watching resources through this channel */ + await gapi.client.channels.stop({ + }); + /** Returns the color definitions for calendars and events. */ + await gapi.client.colors.get({ + }); + /** Deletes an event. */ + await gapi.client.events.delete({ + calendarId: "calendarId", + eventId: "eventId", + sendNotifications: true, + }); + /** Returns an event. */ + await gapi.client.events.get({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + timeZone: "timeZone", + }); + /** Imports an event. This operation is used to add a private copy of an existing event to a calendar. */ + await gapi.client.events.import({ + calendarId: "calendarId", + supportsAttachments: true, + }); + /** Creates an event. */ + await gapi.client.events.insert({ + calendarId: "calendarId", + maxAttendees: 2, + sendNotifications: true, + supportsAttachments: true, + }); + /** Returns instances of the specified recurring event. */ + await gapi.client.events.instances({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + maxResults: 5, + originalStart: "originalStart", + pageToken: "pageToken", + showDeleted: true, + timeMax: "timeMax", + timeMin: "timeMin", + timeZone: "timeZone", + }); + /** Returns events on the specified calendar. */ + await gapi.client.events.list({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + iCalUID: "iCalUID", + maxAttendees: 4, + maxResults: 5, + orderBy: "orderBy", + pageToken: "pageToken", + privateExtendedProperty: "privateExtendedProperty", + q: "q", + sharedExtendedProperty: "sharedExtendedProperty", + showDeleted: true, + showHiddenInvitations: true, + singleEvents: true, + syncToken: "syncToken", + timeMax: "timeMax", + timeMin: "timeMin", + timeZone: "timeZone", + updatedMin: "updatedMin", + }); + /** Moves an event to another calendar, i.e. changes an event's organizer. */ + await gapi.client.events.move({ + calendarId: "calendarId", + destination: "destination", + eventId: "eventId", + sendNotifications: true, + }); + /** Updates an event. This method supports patch semantics. */ + await gapi.client.events.patch({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + sendNotifications: true, + supportsAttachments: true, + }); + /** Creates an event based on a simple text string. */ + await gapi.client.events.quickAdd({ + calendarId: "calendarId", + sendNotifications: true, + text: "text", + }); + /** Updates an event. */ + await gapi.client.events.update({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + sendNotifications: true, + supportsAttachments: true, + }); + /** Watch for changes to Events resources. */ + await gapi.client.events.watch({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + iCalUID: "iCalUID", + maxAttendees: 4, + maxResults: 5, + orderBy: "orderBy", + pageToken: "pageToken", + privateExtendedProperty: "privateExtendedProperty", + q: "q", + sharedExtendedProperty: "sharedExtendedProperty", + showDeleted: true, + showHiddenInvitations: true, + singleEvents: true, + syncToken: "syncToken", + timeMax: "timeMax", + timeMin: "timeMin", + timeZone: "timeZone", + updatedMin: "updatedMin", + }); + /** Returns free/busy information for a set of calendars. */ + await gapi.client.freebusy.query({ + }); + /** Returns a single user setting. */ + await gapi.client.settings.get({ + setting: "setting", + }); + /** Returns all user settings for the authenticated user. */ + await gapi.client.settings.list({ + maxResults: 1, + pageToken: "pageToken", + syncToken: "syncToken", + }); + /** Watch for changes to Settings resources. */ + await gapi.client.settings.watch({ + maxResults: 1, + pageToken: "pageToken", + syncToken: "syncToken", + }); + } +}); diff --git a/types/gapi.client.calendar/index.d.ts b/types/gapi.client.calendar/index.d.ts new file mode 100644 index 0000000000..72196ee150 --- /dev/null +++ b/types/gapi.client.calendar/index.d.ts @@ -0,0 +1,1946 @@ +// Type definitions for Google Calendar API v3 3.0 +// Project: https://developers.google.com/google-apps/calendar/firstapp +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest + +/// + +declare namespace gapi.client { + /** Load Calendar API v3 */ + function load(name: "calendar", version: "v3"): PromiseLike; + function load(name: "calendar", version: "v3", callback: () => any): void; + + const acl: calendar.AclResource; + + const calendarList: calendar.CalendarListResource; + + const calendars: calendar.CalendarsResource; + + const channels: calendar.ChannelsResource; + + const colors: calendar.ColorsResource; + + const events: calendar.EventsResource; + + const freebusy: calendar.FreebusyResource; + + const settings: calendar.SettingsResource; + + namespace calendar { + interface Acl { + /** ETag of the collection. */ + etag?: string; + /** List of rules on the access control list. */ + items?: AclRule[]; + /** Type of the collection ("calendar#acl"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + } + interface AclRule { + /** ETag of the resource. */ + etag?: string; + /** Identifier of the ACL rule. */ + id?: string; + /** Type of the resource ("calendar#aclRule"). */ + kind?: string; + /** + * The role assigned to the scope. Possible values are: + * - "none" - Provides no access. + * - "freeBusyReader" - Provides read access to free/busy information. + * - "reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + * - "writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + * + * - "owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and + * manipulate ACLs. + */ + role?: string; + /** The scope of the rule. */ + scope?: { + /** + * The type of the scope. Possible values are: + * - "default" - The public scope. This is the default value. + * - "user" - Limits the scope to a single user. + * - "group" - Limits the scope to a group. + * - "domain" - Limits the scope to a domain. Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not. + */ + type?: string; + /** The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type "default". */ + value?: string; + }; + } + interface Calendar { + /** Description of the calendar. Optional. */ + description?: string; + /** ETag of the resource. */ + etag?: string; + /** Identifier of the calendar. To retrieve IDs call the calendarList.list() method. */ + id?: string; + /** Type of the resource ("calendar#calendar"). */ + kind?: string; + /** Geographic location of the calendar as free-form text. Optional. */ + location?: string; + /** Title of the calendar. */ + summary?: string; + /** The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional. */ + timeZone?: string; + } + interface CalendarList { + /** ETag of the collection. */ + etag?: string; + /** Calendars that are present on the user's calendar list. */ + items?: CalendarListEntry[]; + /** Type of the collection ("calendar#calendarList"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + } + interface CalendarListEntry { + /** + * The effective access role that the authenticated user has on the calendar. Read-only. Possible values are: + * - "freeBusyReader" - Provides read access to free/busy information. + * - "reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + * - "writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + * + * - "owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and + * manipulate ACLs. + */ + accessRole?: string; + /** + * The main color of the calendar in the hexadecimal format "#0088aa". This property supersedes the index-based colorId property. To set or change this + * property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional. + */ + backgroundColor?: string; + /** + * The color of the calendar. This is an ID referring to an entry in the calendar section of the colors definition (see the colors endpoint). This + * property is superseded by the backgroundColor and foregroundColor properties and can be ignored when using these properties. Optional. + */ + colorId?: string; + /** The default reminders that the authenticated user has for this calendar. */ + defaultReminders?: EventReminder[]; + /** Whether this calendar list entry has been deleted from the calendar list. Read-only. Optional. The default is False. */ + deleted?: boolean; + /** Description of the calendar. Optional. Read-only. */ + description?: string; + /** ETag of the resource. */ + etag?: string; + /** + * The foreground color of the calendar in the hexadecimal format "#ffffff". This property supersedes the index-based colorId property. To set or change + * this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional. + */ + foregroundColor?: string; + /** Whether the calendar has been hidden from the list. Optional. The default is False. */ + hidden?: boolean; + /** Identifier of the calendar. */ + id?: string; + /** Type of the resource ("calendar#calendarListEntry"). */ + kind?: string; + /** Geographic location of the calendar as free-form text. Optional. Read-only. */ + location?: string; + /** The notifications that the authenticated user is receiving for this calendar. */ + notificationSettings?: { + /** The list of notifications set for this calendar. */ + notifications?: CalendarNotification[]; + }; + /** Whether the calendar is the primary calendar of the authenticated user. Read-only. Optional. The default is False. */ + primary?: boolean; + /** Whether the calendar content shows up in the calendar UI. Optional. The default is False. */ + selected?: boolean; + /** Title of the calendar. Read-only. */ + summary?: string; + /** The summary that the authenticated user has set for this calendar. Optional. */ + summaryOverride?: string; + /** The time zone of the calendar. Optional. Read-only. */ + timeZone?: string; + } + interface CalendarNotification { + /** + * The method used to deliver the notification. Possible values are: + * - "email" - Reminders are sent via email. + * - "sms" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. SMS reminders are only available for G Suite + * customers. + */ + method?: string; + /** + * The type of notification. Possible values are: + * - "eventCreation" - Notification sent when a new event is put on the calendar. + * - "eventChange" - Notification sent when an event is changed. + * - "eventCancellation" - Notification sent when an event is cancelled. + * - "eventResponse" - Notification sent when an event is changed. + * - "agenda" - An agenda with the events of the day (sent out in the morning). + */ + type?: string; + } + interface Channel { + /** The address where notifications are delivered for this channel. */ + address?: string; + /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ + expiration?: string; + /** A UUID or similar unique string that identifies this channel. */ + id?: string; + /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */ + kind?: string; + /** Additional parameters controlling delivery channel behavior. Optional. */ + params?: Record; + /** A Boolean value to indicate whether payload is wanted. Optional. */ + payload?: boolean; + /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ + resourceId?: string; + /** A version-specific identifier for the watched resource. */ + resourceUri?: string; + /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ + token?: string; + /** The type of delivery mechanism used for this channel. */ + type?: string; + } + interface ColorDefinition { + /** The background color associated with this color definition. */ + background?: string; + /** The foreground color that can be used to write on top of a background with 'background' color. */ + foreground?: string; + } + interface Colors { + /** + * A global palette of calendar colors, mapping from the color ID to its definition. A calendarListEntry resource refers to one of these color IDs in its + * color field. Read-only. + */ + calendar?: Record; + /** + * A global palette of event colors, mapping from the color ID to its definition. An event resource may refer to one of these color IDs in its color + * field. Read-only. + */ + event?: Record; + /** Type of the resource ("calendar#colors"). */ + kind?: string; + /** Last modification time of the color palette (as a RFC3339 timestamp). Read-only. */ + updated?: string; + } + interface Error { + /** Domain, or broad category, of the error. */ + domain?: string; + /** + * Specific reason for the error. Some of the possible values are: + * - "groupTooBig" - The group of users requested is too large for a single query. + * - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query. + * - "notFound" - The requested resource was not found. + * - "internalError" - The API service has encountered an internal error. Additional error types may be added in the future, so clients should gracefully + * handle additional error statuses not included in this list. + */ + reason?: string; + } + interface Event { + /** Whether anyone can invite themselves to the event (currently works for Google+ events only). Optional. The default is False. */ + anyoneCanAddSelf?: boolean; + /** + * File attachments for the event. Currently only Google Drive attachments are supported. + * In order to modify attachments the supportsAttachments request parameter should be set to true. + * There can be at most 25 attachments per event, + */ + attachments?: EventAttachment[]; + /** The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users. */ + attendees?: EventAttendee[]; + /** + * Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the + * maxAttendee query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False. + */ + attendeesOmitted?: boolean; + /** The color of the event. This is an ID referring to an entry in the event section of the colors definition (see the colors endpoint). Optional. */ + colorId?: string; + /** Creation time of the event (as a RFC3339 timestamp). Read-only. */ + created?: string; + /** The creator of the event. Read-only. */ + creator?: { + /** The creator's name, if available. */ + displayName?: string; + /** The creator's email address, if available. */ + email?: string; + /** The creator's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API */ + id?: string; + /** Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. */ + self?: boolean; + }; + /** Description of the event. Optional. */ + description?: string; + /** The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance. */ + end?: EventDateTime; + /** + * Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. The + * default is False. + */ + endTimeUnspecified?: boolean; + /** ETag of the resource. */ + etag?: string; + /** Extended properties of the event. */ + extendedProperties?: { + /** Properties that are private to the copy of the event that appears on this calendar. */ + private?: Record; + /** Properties that are shared between copies of the event on other attendees' calendars. */ + shared?: Record; + }; + /** A gadget that extends this event. */ + gadget?: { + /** + * The gadget's display mode. Optional. Possible values are: + * - "icon" - The gadget displays next to the event's title in the calendar view. + * - "chip" - The gadget displays when the event is clicked. + */ + display?: string; + /** The gadget's height in pixels. The height must be an integer greater than 0. Optional. */ + height?: number; + /** The gadget's icon URL. The URL scheme must be HTTPS. */ + iconLink?: string; + /** The gadget's URL. The URL scheme must be HTTPS. */ + link?: string; + /** Preferences. */ + preferences?: Record; + /** The gadget's title. */ + title?: string; + /** The gadget's type. */ + type?: string; + /** The gadget's width in pixels. The width must be an integer greater than 0. Optional. */ + width?: number; + }; + /** Whether attendees other than the organizer can invite others to the event. Optional. The default is True. */ + guestsCanInviteOthers?: boolean; + /** Whether attendees other than the organizer can modify the event. Optional. The default is False. */ + guestsCanModify?: boolean; + /** Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True. */ + guestsCanSeeOtherGuests?: boolean; + /** An absolute link to the Google+ hangout associated with this event. Read-only. */ + hangoutLink?: string; + /** An absolute link to this event in the Google Calendar Web UI. Read-only. */ + htmlLink?: string; + /** + * Event unique identifier as defined in RFC5545. It is used to uniquely identify events accross calendaring systems and must be supplied when importing + * events via the import method. + * Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is + * that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs. + */ + iCalUID?: string; + /** + * Opaque identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules: + * - characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938 + * - the length of the ID must be between 5 and 1024 characters + * - the ID must be unique per calendar Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at + * event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122. + * If you do not specify an ID, it will be automatically generated by the server. + * Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is + * that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs. + */ + id?: string; + /** Type of the resource ("calendar#event"). */ + kind?: string; + /** Geographic location of the event as free-form text. Optional. */ + location?: string; + /** + * Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or + * "recurrence". The default is False. Read-Only. + */ + locked?: boolean; + /** + * The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to + * True. To change the organizer, use the move operation. Read-only, except when importing an event. + */ + organizer?: { + /** The organizer's name, if available. */ + displayName?: string; + /** The organizer's email address, if available. It must be a valid email address as per RFC5322. */ + email?: string; + /** The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API */ + id?: string; + /** Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. */ + self?: boolean; + }; + /** + * For an instance of a recurring event, this is the time at which this event would start according to the recurrence data in the recurring event + * identified by recurringEventId. Immutable. + */ + originalStartTime?: EventDateTime; + /** Whether this is a private event copy where changes are not shared with other copies on other calendars. Optional. Immutable. The default is False. */ + privateCopy?: boolean; + /** + * List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this + * field; event start and end times are specified in the start and end fields. This field is omitted for single events or instances of recurring events. + */ + recurrence?: string[]; + /** For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. */ + recurringEventId?: string; + /** Information about the event's reminders for the authenticated user. */ + reminders?: { + /** + * If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for + * this event. The maximum number of override reminders is 5. + */ + overrides?: EventReminder[]; + /** Whether the default reminders of the calendar apply to the event. */ + useDefault?: boolean; + }; + /** Sequence number as per iCalendar. */ + sequence?: number; + /** + * Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. + * Can only be seen or modified by the creator of the event. + */ + source?: { + /** Title of the source; for example a title of a web page or an email subject. */ + title?: string; + /** URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS. */ + url?: string; + }; + /** The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance. */ + start?: EventDateTime; + /** + * Status of the event. Optional. Possible values are: + * - "confirmed" - The event is confirmed. This is the default status. + * - "tentative" - The event is tentatively confirmed. + * - "cancelled" - The event is cancelled. + */ + status?: string; + /** Title of the event. */ + summary?: string; + /** + * Whether the event blocks time on the calendar. Optional. Possible values are: + * - "opaque" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI. + * - "transparent" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI. + */ + transparency?: string; + /** Last modification time of the event (as a RFC3339 timestamp). Read-only. */ + updated?: string; + /** + * Visibility of the event. Optional. Possible values are: + * - "default" - Uses the default visibility for events on the calendar. This is the default value. + * - "public" - The event is public and event details are visible to all readers of the calendar. + * - "private" - The event is private and only event attendees may view event details. + * - "confidential" - The event is private. This value is provided for compatibility reasons. + */ + visibility?: string; + } + interface EventAttachment { + /** + * ID of the attached file. Read-only. + * For Google Drive files, this is the ID of the corresponding Files resource entry in the Drive API. + */ + fileId?: string; + /** + * URL link to the attachment. + * For adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API. + */ + fileUrl?: string; + /** URL link to the attachment's icon. Read-only. */ + iconLink?: string; + /** Internet media type (MIME type) of the attachment. */ + mimeType?: string; + /** Attachment title. */ + title?: string; + } + interface EventAttendee { + /** Number of additional guests. Optional. The default is 0. */ + additionalGuests?: number; + /** The attendee's response comment. Optional. */ + comment?: string; + /** The attendee's name, if available. Optional. */ + displayName?: string; + /** The attendee's email address, if available. This field must be present when adding an attendee. It must be a valid email address as per RFC5322. */ + email?: string; + /** The attendee's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API */ + id?: string; + /** Whether this is an optional attendee. Optional. The default is False. */ + optional?: boolean; + /** Whether the attendee is the organizer of the event. Read-only. The default is False. */ + organizer?: boolean; + /** Whether the attendee is a resource. Read-only. The default is False. */ + resource?: boolean; + /** + * The attendee's response status. Possible values are: + * - "needsAction" - The attendee has not responded to the invitation. + * - "declined" - The attendee has declined the invitation. + * - "tentative" - The attendee has tentatively accepted the invitation. + * - "accepted" - The attendee has accepted the invitation. + */ + responseStatus?: string; + /** Whether this entry represents the calendar on which this copy of the event appears. Read-only. The default is False. */ + self?: boolean; + } + interface EventDateTime { + /** The date, in the format "yyyy-mm-dd", if this is an all-day event. */ + date?: string; + /** + * The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in + * timeZone. + */ + dateTime?: string; + /** + * The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is + * required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for + * the event start/end. + */ + timeZone?: string; + } + interface EventReminder { + /** + * The method used by this reminder. Possible values are: + * - "email" - Reminders are sent via email. + * - "sms" - Reminders are sent via SMS. These are only available for G Suite customers. Requests to set SMS reminders for other account types are + * ignored. + * - "popup" - Reminders are sent via a UI popup. + */ + method?: string; + /** Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). */ + minutes?: number; + } + interface Events { + /** + * The user's access role for this calendar. Read-only. Possible values are: + * - "none" - The user has no access. + * - "freeBusyReader" - The user has read access to free/busy information. + * - "reader" - The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + * - "writer" - The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be + * visible. + * - "owner" - The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and + * manipulate ACLs. + */ + accessRole?: string; + /** + * The default reminders on the calendar for the authenticated user. These reminders apply to all events on this calendar that do not explicitly override + * them (i.e. do not have reminders.useDefault set to True). + */ + defaultReminders?: EventReminder[]; + /** Description of the calendar. Read-only. */ + description?: string; + /** ETag of the collection. */ + etag?: string; + /** List of events on the calendar. */ + items?: Event[]; + /** Type of the collection ("calendar#events"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + /** Title of the calendar. Read-only. */ + summary?: string; + /** The time zone of the calendar. Read-only. */ + timeZone?: string; + /** Last modification time of the calendar (as a RFC3339 timestamp). Read-only. */ + updated?: string; + } + interface FreeBusyCalendar { + /** List of time ranges during which this calendar should be regarded as busy. */ + busy?: TimePeriod[]; + /** Optional error(s) (if computation for the calendar failed). */ + errors?: Error[]; + } + interface FreeBusyGroup { + /** List of calendars' identifiers within a group. */ + calendars?: string[]; + /** Optional error(s) (if computation for the group failed). */ + errors?: Error[]; + } + interface FreeBusyRequest { + /** Maximal number of calendars for which FreeBusy information is to be provided. Optional. */ + calendarExpansionMax?: number; + /** + * Maximal number of calendar identifiers to be provided for a single group. Optional. An error will be returned for a group with more members than this + * value. + */ + groupExpansionMax?: number; + /** List of calendars and/or groups to query. */ + items?: FreeBusyRequestItem[]; + /** The end of the interval for the query. */ + timeMax?: string; + /** The start of the interval for the query. */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is UTC. */ + timeZone?: string; + } + interface FreeBusyRequestItem { + /** The identifier of a calendar or a group. */ + id?: string; + } + interface FreeBusyResponse { + /** List of free/busy information for calendars. */ + calendars?: Record; + /** Expansion of groups. */ + groups?: Record; + /** Type of the resource ("calendar#freeBusy"). */ + kind?: string; + /** The end of the interval. */ + timeMax?: string; + /** The start of the interval. */ + timeMin?: string; + } + interface Setting { + /** ETag of the resource. */ + etag?: string; + /** The id of the user setting. */ + id?: string; + /** Type of the resource ("calendar#setting"). */ + kind?: string; + /** Value of the user setting. The format of the value depends on the ID of the setting. It must always be a UTF-8 string of length up to 1024 characters. */ + value?: string; + } + interface Settings { + /** Etag of the collection. */ + etag?: string; + /** List of user settings. */ + items?: Setting[]; + /** Type of the collection ("calendar#settings"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + } + interface TimePeriod { + /** The (exclusive) end of the time period. */ + end?: string; + /** The (inclusive) start of the time period. */ + start?: string; + } + interface AclResource { + /** Deletes an access control rule. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns an access control rule. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an access control rule. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the rules in the access control list for the calendar. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken + * is provided. Optional. The default is False. + */ + showDeleted?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an access control rule. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an access control rule. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to ACL resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken + * is provided. Optional. The default is False. + */ + showDeleted?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CalendarListResource { + /** Deletes an entry on the user's calendar list. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns an entry on the user's calendar list. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds an entry to the user's calendar list. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId + * field will be set to the best matching option automatically. Optional. The default is False. + */ + colorRgbFormat?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns entries on the user's calendar list. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** The minimum access role for the user in the returned entries. Optional. The default is no restriction. */ + minAccessRole?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to include deleted calendar list entries in the result. Optional. The default is False. */ + showDeleted?: boolean; + /** Whether to show hidden entries. Optional. The default is False. */ + showHidden?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't + * be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted + * neither showHidden to False. + * To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an entry on the user's calendar list. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** + * Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId + * field will be set to the best matching option automatically. Optional. The default is False. + */ + colorRgbFormat?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an entry on the user's calendar list. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** + * Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId + * field will be set to the best matching option automatically. Optional. The default is False. + */ + colorRgbFormat?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to CalendarList resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** The minimum access role for the user in the returned entries. Optional. The default is no restriction. */ + minAccessRole?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to include deleted calendar list entries in the result. Optional. The default is False. */ + showDeleted?: boolean; + /** Whether to show hidden entries. Optional. The default is False. */ + showHidden?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't + * be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted + * neither showHidden to False. + * To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CalendarsResource { + /** Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. */ + clear(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns metadata for a calendar. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a secondary calendar. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates metadata for a calendar. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates metadata for a calendar. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChannelsResource { + /** Stop watching resources through this channel */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ColorsResource { + /** Returns the color definitions for calendars and events. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EventsResource { + /** Deletes an event. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the deletion of the event. Optional. The default is False. */ + sendNotifications?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns an event. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Imports an event. This operation is used to add a private copy of an existing event to a calendar. */ + import(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an event. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the creation of the new event. Optional. The default is False. */ + sendNotifications?: boolean; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns instances of the specified recurring event. */ + instances(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Recurring event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The original start time of the instance in the result. Optional. */ + originalStart?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events will still be included if + * singleEvents is False. Optional. The default is False. + */ + showDeleted?: boolean; + /** + * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with + * mandatory time zone offset. + */ + timeMax?: string; + /** + * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with + * mandatory time zone offset. + */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns events on the specified calendar. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Specifies event ID in the iCalendar format to be included in the response. Optional. */ + iCalUID?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** + * Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if + * there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is + * 250 events. The page size can never be larger than 2500 events. Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The order of the events returned in the result. Optional. The default is an unspecified, stable order. */ + orderBy?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + privateExtendedProperty?: string; + /** Free text search terms to find events that match these terms in any field, except for extended properties. Optional. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + sharedExtendedProperty?: string; + /** + * Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying + * recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single + * instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + */ + showDeleted?: boolean; + /** Whether to include hidden invitations in the result. Optional. The default is False. */ + showHiddenInvitations?: boolean; + /** + * Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying + * recurring events themselves. Optional. The default is False. + */ + singleEvents?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + * + * These are: + * - iCalUID + * - orderBy + * - privateExtendedProperty + * - q + * - sharedExtendedProperty + * - timeMin + * - timeMax + * - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** + * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, + * timeMax must be greater than timeMin. + */ + timeMax?: string; + /** + * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, + * timeMin must be smaller than timeMax. + */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** + * Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be + * included regardless of showDeleted. Optional. The default is not to filter by last modification time. + */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves an event to another calendar, i.e. changes an event's organizer. */ + move(request: { + /** Data format for the response. */ + alt?: string; + /** Calendar identifier of the source calendar where the event currently is on. */ + calendarId: string; + /** Calendar identifier of the target calendar where the event is to be moved to. */ + destination: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the change of the event's organizer. Optional. The default is False. */ + sendNotifications?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an event. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. */ + sendNotifications?: boolean; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an event based on a simple text string. */ + quickAdd(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the creation of the event. Optional. The default is False. */ + sendNotifications?: boolean; + /** The text describing the event to be created. */ + text: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an event. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. */ + sendNotifications?: boolean; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to Events resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Specifies event ID in the iCalendar format to be included in the response. Optional. */ + iCalUID?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** + * Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if + * there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is + * 250 events. The page size can never be larger than 2500 events. Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The order of the events returned in the result. Optional. The default is an unspecified, stable order. */ + orderBy?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + privateExtendedProperty?: string; + /** Free text search terms to find events that match these terms in any field, except for extended properties. Optional. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + sharedExtendedProperty?: string; + /** + * Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying + * recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single + * instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + */ + showDeleted?: boolean; + /** Whether to include hidden invitations in the result. Optional. The default is False. */ + showHiddenInvitations?: boolean; + /** + * Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying + * recurring events themselves. Optional. The default is False. + */ + singleEvents?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + * + * These are: + * - iCalUID + * - orderBy + * - privateExtendedProperty + * - q + * - sharedExtendedProperty + * - timeMin + * - timeMax + * - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** + * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, + * timeMax must be greater than timeMin. + */ + timeMax?: string; + /** + * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, + * timeMin must be smaller than timeMax. + */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** + * Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be + * included regardless of showDeleted. Optional. The default is not to filter by last modification time. + */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FreebusyResource { + /** Returns free/busy information for a set of calendars. */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SettingsResource { + /** Returns a single user setting. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The id of the user setting. */ + setting: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns all user settings for the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to Settings resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.calendar/readme.md b/types/gapi.client.calendar/readme.md new file mode 100644 index 0000000000..cc864bd556 --- /dev/null +++ b/types/gapi.client.calendar/readme.md @@ -0,0 +1,242 @@ +# TypeScript typings for Calendar API v3 +Manipulates events and other calendar data. +For detailed description please check [documentation](https://developers.google.com/google-apps/calendar/firstapp). + +## Installing + +Install typings for Calendar API: +``` +npm install @types/gapi.client.calendar@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('calendar', 'v3', () => { + // now we can use gapi.client.calendar + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your calendars + 'https://www.googleapis.com/auth/calendar', + + // View your calendars + 'https://www.googleapis.com/auth/calendar.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Calendar API resources: + +```typescript + +/* +Deletes an access control rule. +*/ +await gapi.client.acl.delete({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Returns an access control rule. +*/ +await gapi.client.acl.get({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Creates an access control rule. +*/ +await gapi.client.acl.insert({ calendarId: "calendarId", }); + +/* +Returns the rules in the access control list for the calendar. +*/ +await gapi.client.acl.list({ calendarId: "calendarId", }); + +/* +Updates an access control rule. This method supports patch semantics. +*/ +await gapi.client.acl.patch({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Updates an access control rule. +*/ +await gapi.client.acl.update({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Watch for changes to ACL resources. +*/ +await gapi.client.acl.watch({ calendarId: "calendarId", }); + +/* +Deletes an entry on the user's calendar list. +*/ +await gapi.client.calendarList.delete({ calendarId: "calendarId", }); + +/* +Returns an entry on the user's calendar list. +*/ +await gapi.client.calendarList.get({ calendarId: "calendarId", }); + +/* +Adds an entry to the user's calendar list. +*/ +await gapi.client.calendarList.insert({ }); + +/* +Returns entries on the user's calendar list. +*/ +await gapi.client.calendarList.list({ }); + +/* +Updates an entry on the user's calendar list. This method supports patch semantics. +*/ +await gapi.client.calendarList.patch({ calendarId: "calendarId", }); + +/* +Updates an entry on the user's calendar list. +*/ +await gapi.client.calendarList.update({ calendarId: "calendarId", }); + +/* +Watch for changes to CalendarList resources. +*/ +await gapi.client.calendarList.watch({ }); + +/* +Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. +*/ +await gapi.client.calendars.clear({ calendarId: "calendarId", }); + +/* +Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. +*/ +await gapi.client.calendars.delete({ calendarId: "calendarId", }); + +/* +Returns metadata for a calendar. +*/ +await gapi.client.calendars.get({ calendarId: "calendarId", }); + +/* +Creates a secondary calendar. +*/ +await gapi.client.calendars.insert({ }); + +/* +Updates metadata for a calendar. This method supports patch semantics. +*/ +await gapi.client.calendars.patch({ calendarId: "calendarId", }); + +/* +Updates metadata for a calendar. +*/ +await gapi.client.calendars.update({ calendarId: "calendarId", }); + +/* +Stop watching resources through this channel +*/ +await gapi.client.channels.stop({ }); + +/* +Returns the color definitions for calendars and events. +*/ +await gapi.client.colors.get({ }); + +/* +Deletes an event. +*/ +await gapi.client.events.delete({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Returns an event. +*/ +await gapi.client.events.get({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Imports an event. This operation is used to add a private copy of an existing event to a calendar. +*/ +await gapi.client.events.import({ calendarId: "calendarId", }); + +/* +Creates an event. +*/ +await gapi.client.events.insert({ calendarId: "calendarId", }); + +/* +Returns instances of the specified recurring event. +*/ +await gapi.client.events.instances({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Returns events on the specified calendar. +*/ +await gapi.client.events.list({ calendarId: "calendarId", }); + +/* +Moves an event to another calendar, i.e. changes an event's organizer. +*/ +await gapi.client.events.move({ calendarId: "calendarId", destination: "destination", eventId: "eventId", }); + +/* +Updates an event. This method supports patch semantics. +*/ +await gapi.client.events.patch({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Creates an event based on a simple text string. +*/ +await gapi.client.events.quickAdd({ calendarId: "calendarId", text: "text", }); + +/* +Updates an event. +*/ +await gapi.client.events.update({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Watch for changes to Events resources. +*/ +await gapi.client.events.watch({ calendarId: "calendarId", }); + +/* +Returns free/busy information for a set of calendars. +*/ +await gapi.client.freebusy.query({ }); + +/* +Returns a single user setting. +*/ +await gapi.client.settings.get({ setting: "setting", }); + +/* +Returns all user settings for the authenticated user. +*/ +await gapi.client.settings.list({ }); + +/* +Watch for changes to Settings resources. +*/ +await gapi.client.settings.watch({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.calendar/tsconfig.json b/types/gapi.client.calendar/tsconfig.json new file mode 100644 index 0000000000..5d44c3d92a --- /dev/null +++ b/types/gapi.client.calendar/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.calendar-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.calendar/tslint.json b/types/gapi.client.calendar/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.calendar/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.civicinfo/gapi.client.civicinfo-tests.ts b/types/gapi.client.civicinfo/gapi.client.civicinfo-tests.ts new file mode 100644 index 0000000000..7a6270dfa5 --- /dev/null +++ b/types/gapi.client.civicinfo/gapi.client.civicinfo-tests.ts @@ -0,0 +1,44 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('civicinfo', 'v2', () => { + /** now we can use gapi.client.civicinfo */ + + run(); + }); + + async function run() { + /** Searches for political divisions by their natural name or OCD ID. */ + await gapi.client.divisions.search({ + query: "query", + }); + /** List of available elections to query. */ + await gapi.client.elections.electionQuery({ + }); + /** Looks up information relevant to a voter based on the voter's registered address. */ + await gapi.client.elections.voterInfoQuery({ + address: "address", + electionId: "electionId", + officialOnly: true, + returnAllAvailableData: true, + }); + /** Looks up political geography and representative information for a single address. */ + await gapi.client.representatives.representativeInfoByAddress({ + address: "address", + includeOffices: true, + levels: "levels", + roles: "roles", + }); + /** Looks up representative information for a single geographic division. */ + await gapi.client.representatives.representativeInfoByDivision({ + levels: "levels", + ocdId: "ocdId", + recursive: true, + roles: "roles", + }); + } +}); diff --git a/types/gapi.client.civicinfo/index.d.ts b/types/gapi.client.civicinfo/index.d.ts new file mode 100644 index 0000000000..efa9098f8e --- /dev/null +++ b/types/gapi.client.civicinfo/index.d.ts @@ -0,0 +1,599 @@ +// Type definitions for Google Google Civic Information API v2 2.0 +// Project: https://developers.google.com/civic-information +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/civicinfo/v2/rest + +/// + +declare namespace gapi.client { + /** Load Google Civic Information API v2 */ + function load(name: "civicinfo", version: "v2"): PromiseLike; + function load(name: "civicinfo", version: "v2", callback: () => any): void; + + const divisions: civicinfo.DivisionsResource; + + const elections: civicinfo.ElectionsResource; + + const representatives: civicinfo.RepresentativesResource; + + namespace civicinfo { + interface AdministrationRegion { + /** The election administration body for this area. */ + electionAdministrationBody?: AdministrativeBody; + /** + * An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested + * from the Request more link on the Quotas page. + */ + id?: string; + /** The city or county that provides election information for this voter. This object can have the same elements as state. */ + local_jurisdiction?: AdministrationRegion; + /** The name of the jurisdiction. */ + name?: string; + /** A list of sources for this area. If multiple sources are listed the data has been aggregated from those sources. */ + sources?: Source[]; + } + interface AdministrativeBody { + /** A URL provided by this administrative body for information on absentee voting. */ + absenteeVotingInfoUrl?: string; + addressLines?: string[]; + /** A URL provided by this administrative body to give contest information to the voter. */ + ballotInfoUrl?: string; + /** The mailing address of this administrative body. */ + correspondenceAddress?: SimpleAddressType; + /** A URL provided by this administrative body for looking up general election information. */ + electionInfoUrl?: string; + /** The election officials for this election administrative body. */ + electionOfficials?: ElectionOfficial[]; + /** A URL provided by this administrative body for confirming that the voter is registered to vote. */ + electionRegistrationConfirmationUrl?: string; + /** A URL provided by this administrative body for looking up how to register to vote. */ + electionRegistrationUrl?: string; + /** A URL provided by this administrative body describing election rules to the voter. */ + electionRulesUrl?: string; + /** A description of the hours of operation for this administrative body. */ + hoursOfOperation?: string; + /** The name of this election administrative body. */ + name?: string; + /** The physical address of this administrative body. */ + physicalAddress?: SimpleAddressType; + /** A description of the services this administrative body may provide. */ + voter_services?: string[]; + /** A URL provided by this administrative body for looking up where to vote. */ + votingLocationFinderUrl?: string; + } + interface Candidate { + /** The URL for the candidate's campaign web site. */ + candidateUrl?: string; + /** A list of known (social) media channels for this candidate. */ + channels?: Channel[]; + /** The email address for the candidate's campaign. */ + email?: string; + /** + * The candidate's name. If this is a joint ticket it will indicate the name of the candidate at the top of a ticket followed by a / and that name of + * candidate at the bottom of the ticket. e.g. "Mitt Romney / Paul Ryan" + */ + name?: string; + /** The order the candidate appears on the ballot for this contest. */ + orderOnBallot?: string; + /** The full name of the party the candidate is a member of. */ + party?: string; + /** The voice phone number for the candidate's campaign office. */ + phone?: string; + /** A URL for a photo of the candidate. */ + photoUrl?: string; + } + interface Channel { + /** The unique public identifier for the candidate's channel. */ + id?: string; + /** + * The type of channel. The following is a list of types of channels, but is not exhaustive. More channel types may be added at a later time. One of: + * GooglePlus, YouTube, Facebook, Twitter + */ + type?: string; + } + interface Contest { + /** A number specifying the position of this contest on the voter's ballot. */ + ballotPlacement?: string; + /** The candidate choices for this contest. */ + candidates?: Candidate[]; + /** Information about the electoral district that this contest is in. */ + district?: ElectoralDistrict; + /** A description of any additional eligibility requirements for voting in this contest. */ + electorateSpecifications?: string; + /** + * An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested + * from the Request more link on the Quotas page. + */ + id?: string; + /** + * The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different + * levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" + * and "administrative-area-1". + */ + level?: string[]; + /** The number of candidates that will be elected to office in this contest. */ + numberElected?: string; + /** The number of candidates that a voter may vote for in this contest. */ + numberVotingFor?: string; + /** The name of the office for this contest. */ + office?: string; + /** If this is a partisan election, the name of the party it is for. */ + primaryParty?: string; + /** + * The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include "yes" or "no" for + * referenda. This field is only populated for contests of type 'Referendum'. + */ + referendumBallotResponses?: string[]; + /** + * Specifies a short summary of the referendum that is typically on the ballot below the title but above the text. This field is only populated for + * contests of type 'Referendum'. + */ + referendumBrief?: string; + /** + * A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type + * 'Referendum'. + */ + referendumConStatement?: string; + /** + * Specifies what effect abstaining (not voting) on the proposition will have (i.e. whether abstaining is considered a vote against it). This field is + * only populated for contests of type 'Referendum'. + */ + referendumEffectOfAbstain?: string; + /** The threshold of votes that the referendum needs in order to pass, e.g. "two-thirds". This field is only populated for contests of type 'Referendum'. */ + referendumPassageThreshold?: string; + /** A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'. */ + referendumProStatement?: string; + /** A brief description of the referendum. This field is only populated for contests of type 'Referendum'. */ + referendumSubtitle?: string; + /** The full text of the referendum. This field is only populated for contests of type 'Referendum'. */ + referendumText?: string; + /** The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'. */ + referendumTitle?: string; + /** A link to the referendum. This field is only populated for contests of type 'Referendum'. */ + referendumUrl?: string; + /** The roles which this office fulfills. */ + roles?: string[]; + /** A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources. */ + sources?: Source[]; + /** "Yes" or "No" depending on whether this a contest being held outside the normal election cycle. */ + special?: string; + /** + * The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'. For + * Retention contests this will typically be 'Retention'. + */ + type?: string; + } + interface ContextParams { + clientProfile?: string; + } + interface DivisionRepresentativeInfoRequest { + contextParams?: ContextParams; + } + interface DivisionSearchRequest { + contextParams?: ContextParams; + } + interface DivisionSearchResponse { + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#divisionSearchResponse". */ + kind?: string; + results?: DivisionSearchResult[]; + } + interface DivisionSearchResult { + /** + * Other Open Civic Data identifiers that refer to the same division -- for example, those that refer to other political divisions whose boundaries are + * defined to be coterminous with this one. For example, ocd-division/country:us/state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, + * since Wyoming has only one Congressional district. + */ + aliases?: string[]; + /** The name of the division. */ + name?: string; + /** The unique Open Civic Data identifier for this division. */ + ocdId?: string; + } + interface Election { + /** Day of the election in YYYY-MM-DD format. */ + electionDay?: string; + /** The unique ID of this election. */ + id?: string; + /** A displayable name for the election. */ + name?: string; + /** + * The political division of the election. Represented as an OCD Division ID. Voters within these political jurisdictions are covered by this election. + * This is typically a state such as ocd-division/country:us/state:ca or for the midterms or general election the entire US (i.e. + * ocd-division/country:us). + */ + ocdDivisionId?: string; + } + interface ElectionOfficial { + /** The email address of the election official. */ + emailAddress?: string; + /** The fax number of the election official. */ + faxNumber?: string; + /** The full name of the election official. */ + name?: string; + /** The office phone number of the election official. */ + officePhoneNumber?: string; + /** The title of the election official. */ + title?: string; + } + interface ElectionsQueryRequest { + contextParams?: ContextParams; + } + interface ElectionsQueryResponse { + /** A list of available elections */ + elections?: Election[]; + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#electionsQueryResponse". */ + kind?: string; + } + interface ElectoralDistrict { + /** An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id "34" and a scope of stateUpper. */ + id?: string; + kgForeignKey?: string; + /** The name of the district. */ + name?: string; + /** + * The geographic scope of this district. If unspecified the district's geography is not known. One of: national, statewide, congressional, stateUpper, + * stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special + */ + scope?: string; + } + interface GeographicDivision { + /** + * Any other valid OCD IDs that refer to the same division. + * + * Because OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. + * These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be + * returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list. + * + * For example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. + */ + alsoKnownAs?: string[]; + /** The name of the division. */ + name?: string; + /** + * List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in + * the request. + */ + officeIndices?: number[]; + } + interface Office { + /** The OCD ID of the division with which this office is associated. */ + divisionId?: string; + /** + * The levels of government of which this office is part. There may be more than one in cases where a jurisdiction effectively acts at two different + * levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" + * and "administrative-area-1". + */ + levels?: string[]; + /** The human-readable name of the office. */ + name?: string; + /** List of indices in the officials array of people who presently hold this office. */ + officialIndices?: number[]; + /** + * The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, + * but are meant to be rough categories that are useful for general selection from or sorting of a list of offices. + */ + roles?: string[]; + /** A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources. */ + sources?: Source[]; + } + interface Official { + /** Addresses at which to contact the official. */ + address?: SimpleAddressType[]; + /** A list of known (social) media channels for this official. */ + channels?: Channel[]; + /** The direct email addresses for the official. */ + emails?: string[]; + /** The official's name. */ + name?: string; + /** The full name of the party the official belongs to. */ + party?: string; + /** The official's public contact phone numbers. */ + phones?: string[]; + /** A URL for a photo of the official. */ + photoUrl?: string; + /** The official's public website URLs. */ + urls?: string[]; + } + interface PollingLocation { + /** The address of the location. */ + address?: SimpleAddressType; + /** The last date that this early vote site or drop off location may be used. This field is not populated for polling locations. */ + endDate?: string; + /** + * An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested + * from the Request more link on the Quotas page. + */ + id?: string; + /** The name of the early vote site or drop off location. This field is not populated for polling locations. */ + name?: string; + /** Notes about this location (e.g. accessibility ramp or entrance to use). */ + notes?: string; + /** A description of when this location is open. */ + pollingHours?: string; + /** A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources. */ + sources?: Source[]; + /** The first date that this early vote site or drop off location may be used. This field is not populated for polling locations. */ + startDate?: string; + /** The services provided by this early vote site or drop off location. This field is not populated for polling locations. */ + voterServices?: string; + } + interface PostalAddress { + addressLines?: string[]; + administrativeAreaName?: string; + countryName?: string; + countryNameCode?: string; + dependentLocalityName?: string; + dependentThoroughfareLeadingType?: string; + dependentThoroughfareName?: string; + dependentThoroughfarePostDirection?: string; + dependentThoroughfarePreDirection?: string; + dependentThoroughfareTrailingType?: string; + dependentThoroughfaresConnector?: string; + dependentThoroughfaresIndicator?: string; + dependentThoroughfaresType?: string; + firmName?: string; + isDisputed?: boolean; + languageCode?: string; + localityName?: string; + postBoxNumber?: string; + postalCodeNumber?: string; + postalCodeNumberExtension?: string; + premiseName?: string; + recipientName?: string; + sortingCode?: string; + subAdministrativeAreaName?: string; + subPremiseName?: string; + thoroughfareLeadingType?: string; + thoroughfareName?: string; + thoroughfareNumber?: string; + thoroughfarePostDirection?: string; + thoroughfarePreDirection?: string; + thoroughfareTrailingType?: string; + } + interface RepresentativeInfoData { + /** Political geographic divisions that contain the requested address. */ + divisions?: Record; + /** Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. */ + offices?: Office[]; + /** Officials holding the offices listed above. Will only be present if includeOffices was true in the request. */ + officials?: Official[]; + } + interface RepresentativeInfoRequest { + contextParams?: ContextParams; + } + interface RepresentativeInfoResponse { + /** Political geographic divisions that contain the requested address. */ + divisions?: Record; + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#representativeInfoResponse". */ + kind?: string; + /** The normalized version of the requested address */ + normalizedInput?: SimpleAddressType; + /** Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. */ + offices?: Office[]; + /** Officials holding the offices listed above. Will only be present if includeOffices was true in the request. */ + officials?: Official[]; + } + interface SimpleAddressType { + /** The city or town for the address. */ + city?: string; + /** The street name and number of this address. */ + line1?: string; + /** The second line the address, if needed. */ + line2?: string; + /** The third line of the address, if needed. */ + line3?: string; + /** The name of the location. */ + locationName?: string; + /** The US two letter state abbreviation of the address. */ + state?: string; + /** The US Postal Zip Code of the address. */ + zip?: string; + } + interface Source { + /** The name of the data source. */ + name?: string; + /** Whether this data comes from an official government source. */ + official?: boolean; + } + interface VoterInfoRequest { + contextParams?: ContextParams; + voterInfoSegmentResult?: VoterInfoSegmentResult; + } + interface VoterInfoResponse { + /** Contests that will appear on the voter's ballot. */ + contests?: Contest[]; + /** + * Locations where a voter is eligible to drop off a completed ballot. The voter must have received and completed a ballot prior to arriving at the + * location. The location may not have ballots available on the premises. These locations could be open on or before election day as indicated in the + * pollingHours field. + */ + dropOffLocations?: PollingLocation[]; + /** Locations where the voter is eligible to vote early, prior to election day. */ + earlyVoteSites?: PollingLocation[]; + /** The election that was queried. */ + election?: Election; + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#voterInfoResponse". */ + kind?: string; + /** Specifies whether voters in the precinct vote only by mailing their ballots (with the possible option of dropping off their ballots as well). */ + mailOnly?: boolean; + /** The normalized version of the requested address */ + normalizedInput?: SimpleAddressType; + /** + * If no election ID was specified in the query, and there was more than one election with data for the given voter, this will contain information about + * the other elections that could apply. + */ + otherElections?: Election[]; + /** Locations where the voter is eligible to vote on election day. */ + pollingLocations?: PollingLocation[]; + precinctId?: string; + /** Local Election Information for the state that the voter votes in. For the US, there will only be one element in this array. */ + state?: AdministrationRegion[]; + } + interface VoterInfoSegmentResult { + generatedMillis?: string; + postalAddress?: PostalAddress; + request?: VoterInfoRequest; + response?: VoterInfoResponse; + } + interface DivisionsResource { + /** Searches for political divisions by their natural name or OCD ID. */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required + * patterns. In addition to that, most query operators of the Apache Lucene library are supported. See + * http://lucene.apache.org/core/2_9_4/queryparsersyntax.html + */ + query?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ElectionsResource { + /** List of available elections to query. */ + electionQuery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Looks up information relevant to a voter based on the voter's registered address. */ + voterInfoQuery(request: { + /** The registered address of the voter to look up. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections */ + electionId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** If set to true, only data from official state sources will be returned. */ + officialOnly?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable + * to determine the election for electionId=0 queries. + */ + returnAllAvailableData?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RepresentativesResource { + /** Looks up political geography and representative information for a single address. */ + representativeInfoByAddress(request: { + /** The address to look up. May only be specified if the field ocdId is not given in the URL. */ + address?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to return information about offices and officials. If false, only the top-level district information will be returned. */ + includeOffices?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching + * office will not be returned. + */ + levels?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will + * not be returned. + */ + roles?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Looks up representative information for a single geographic division. */ + representativeInfoByDivision(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching + * office will not be returned. + */ + levels?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The Open Civic Data division identifier of the division to look up. */ + ocdId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * If true, information about all divisions contained in the division requested will be included as well. For example, if querying + * ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs. + */ + recursive?: boolean; + /** + * A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will + * not be returned. + */ + roles?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.civicinfo/readme.md b/types/gapi.client.civicinfo/readme.md new file mode 100644 index 0000000000..a423c2345f --- /dev/null +++ b/types/gapi.client.civicinfo/readme.md @@ -0,0 +1,60 @@ +# TypeScript typings for Google Civic Information API v2 +Provides polling places, early vote locations, contest data, election officials, and government representatives for U.S. residential addresses. +For detailed description please check [documentation](https://developers.google.com/civic-information). + +## Installing + +Install typings for Google Civic Information API: +``` +npm install @types/gapi.client.civicinfo@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('civicinfo', 'v2', () => { + // now we can use gapi.client.civicinfo + // ... +}); +``` + + + +After that you can use Google Civic Information API resources: + +```typescript + +/* +Searches for political divisions by their natural name or OCD ID. +*/ +await gapi.client.divisions.search({ }); + +/* +List of available elections to query. +*/ +await gapi.client.elections.electionQuery({ }); + +/* +Looks up information relevant to a voter based on the voter's registered address. +*/ +await gapi.client.elections.voterInfoQuery({ address: "address", }); + +/* +Looks up political geography and representative information for a single address. +*/ +await gapi.client.representatives.representativeInfoByAddress({ }); + +/* +Looks up representative information for a single geographic division. +*/ +await gapi.client.representatives.representativeInfoByDivision({ ocdId: "ocdId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.civicinfo/tsconfig.json b/types/gapi.client.civicinfo/tsconfig.json new file mode 100644 index 0000000000..6c3ced88c9 --- /dev/null +++ b/types/gapi.client.civicinfo/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.civicinfo-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.civicinfo/tslint.json b/types/gapi.client.civicinfo/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.civicinfo/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.classroom/gapi.client.classroom-tests.ts b/types/gapi.client.classroom/gapi.client.classroom-tests.ts new file mode 100644 index 0000000000..08cbd4f585 --- /dev/null +++ b/types/gapi.client.classroom/gapi.client.classroom-tests.ts @@ -0,0 +1,286 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('classroom', 'v1', () => { + /** now we can use gapi.client.classroom */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage announcements in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.announcements', + /** View announcements in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.announcements.readonly', + /** Manage your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.courses', + /** View your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.courses.readonly', + /** Manage your course work and view your grades in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.coursework.me', + /** View your course work and grades in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + /** Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer */ + 'https://www.googleapis.com/auth/classroom.coursework.students', + /** View course work and grades for students in the Google Classroom classes you teach or administer */ + 'https://www.googleapis.com/auth/classroom.coursework.students.readonly', + /** View your Google Classroom guardians */ + 'https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly', + /** View and manage guardians for students in your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.guardianlinks.students', + /** View guardians for students in your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly', + /** View the email addresses of people in your classes */ + 'https://www.googleapis.com/auth/classroom.profile.emails', + /** View the profile photos of people in your classes */ + 'https://www.googleapis.com/auth/classroom.profile.photos', + /** Manage your Google Classroom class rosters */ + 'https://www.googleapis.com/auth/classroom.rosters', + /** View your Google Classroom class rosters */ + 'https://www.googleapis.com/auth/classroom.rosters.readonly', + /** View your course work and grades in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly', + /** View course work and grades for students in the Google Classroom classes you teach or administer */ + 'https://www.googleapis.com/auth/classroom.student-submissions.students.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Creates a course. + * + * The user specified in `ownerId` is the owner of the created course + * and added as a teacher. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * courses or for access errors. + * * `NOT_FOUND` if the primary teacher is not a valid user. + * * `FAILED_PRECONDITION` if the course owner's account is disabled or for + * the following request errors: + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if an alias was specified in the `id` and + * already exists. + */ + await gapi.client.courses.create({ + }); + /** + * Deletes a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + await gapi.client.courses.delete({ + id: "id", + }); + /** + * Returns a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + await gapi.client.courses.get({ + id: "id", + }); + /** + * Returns a list of courses that the requesting user is permitted to view, + * restricted to those that match the request. Returned courses are ordered by + * creation time, with the most recently created coming first. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + * * `INVALID_ARGUMENT` if the query argument is malformed. + * * `NOT_FOUND` if any users specified in the query arguments do not exist. + */ + await gapi.client.courses.list({ + courseStates: "courseStates", + pageSize: 2, + pageToken: "pageToken", + studentId: "studentId", + teacherId: "teacherId", + }); + /** + * Updates one or more fields in a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + * if no update mask is supplied. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + await gapi.client.courses.patch({ + id: "id", + updateMask: "updateMask", + }); + /** + * Updates a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + await gapi.client.courses.update({ + id: "id", + }); + /** + * Accepts an invitation, removing it and adding the invited user to the + * teachers or students (as appropriate) of the specified course. Only the + * invited user may accept an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to accept the + * requested invitation or for access errors. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * CourseTeacherLimitReached + * * UserGroupsMembershipLimitReached + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + await gapi.client.invitations.accept({ + id: "id", + }); + /** + * Creates an invitation. Only one invitation for a user and course may exist + * at a time. Delete and re-create an invitation to make changes. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * invitations for this course or for access errors. + * * `NOT_FOUND` if the course or the user does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled or if + * the user already has this role or a role with greater permissions. + * * `ALREADY_EXISTS` if an invitation for the specified user and course + * already exists. + */ + await gapi.client.invitations.create({ + }); + /** + * Deletes an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + await gapi.client.invitations.delete({ + id: "id", + }); + /** + * Returns an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + await gapi.client.invitations.get({ + id: "id", + }); + /** + * Returns a list of invitations that the requesting user is permitted to + * view, restricted to those that match the list request. + * + * *Note:* At least one of `user_id` or `course_id` must be supplied. Both + * fields can be supplied. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + */ + await gapi.client.invitations.list({ + courseId: "courseId", + pageSize: 2, + pageToken: "pageToken", + userId: "userId", + }); + /** + * Creates a `Registration`, causing Classroom to start sending notifications + * from the provided `feed` to the provided `destination`. + * + * Returns the created `Registration`. Currently, this will be the same as + * the argument, but with server-assigned fields such as `expiry_time` and + * `id` filled in. + * + * Note that any value specified for the `expiry_time` or `id` fields will be + * ignored. + * + * While Classroom may validate the `destination` and return errors on a best + * effort basis, it is the caller's responsibility to ensure that it exists + * and that Classroom has permission to publish to it. + * + * This method may return the following error codes: + * + * * `PERMISSION_DENIED` if: + * * the authenticated user does not have permission to receive + * notifications from the requested field; or + * * the credential provided does not include the appropriate scope for the + * requested feed. + * * another access error is encountered. + * * `INVALID_ARGUMENT` if: + * * no `destination` is specified, or the specified `destination` is not + * valid; or + * * no `feed` is specified, or the specified `feed` is not valid. + * * `NOT_FOUND` if: + * * the specified `feed` cannot be located, or the requesting user does not + * have permission to determine whether or not it exists; or + * * the specified `destination` cannot be located, or Classroom has not + * been granted permission to publish to it. + */ + await gapi.client.registrations.create({ + }); + /** + * Deletes a `Registration`, causing Classroom to stop sending notifications + * for that `Registration`. + */ + await gapi.client.registrations.delete({ + registrationId: "registrationId", + }); + /** + * Returns a user profile. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * this user profile, if no profile exists with the requested ID, or for + * access errors. + */ + await gapi.client.userProfiles.get({ + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.classroom/index.d.ts b/types/gapi.client.classroom/index.d.ts new file mode 100644 index 0000000000..68e2679cad --- /dev/null +++ b/types/gapi.client.classroom/index.d.ts @@ -0,0 +1,4039 @@ +// Type definitions for Google Google Classroom API v1 1.0 +// Project: https://developers.google.com/classroom/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://classroom.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Classroom API v1 */ + function load(name: "classroom", version: "v1"): PromiseLike; + function load(name: "classroom", version: "v1", callback: () => any): void; + + const courses: classroom.CoursesResource; + + const invitations: classroom.InvitationsResource; + + const registrations: classroom.RegistrationsResource; + + const userProfiles: classroom.UserProfilesResource; + + namespace classroom { + interface Announcement { + /** + * Absolute link to this announcement in the Classroom web UI. + * This is only populated if `state` is `PUBLISHED`. + * + * Read-only. + */ + alternateLink?: string; + /** + * Assignee mode of the announcement. + * If unspecified, the default value is `ALL_STUDENTS`. + */ + assigneeMode?: string; + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Timestamp when this announcement was created. + * + * Read-only. + */ + creationTime?: string; + /** + * Identifier for the user that created the announcement. + * + * Read-only. + */ + creatorUserId?: string; + /** + * Classroom-assigned identifier of this announcement, unique per course. + * + * Read-only. + */ + id?: string; + /** + * Identifiers of students with access to the announcement. + * This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. + * If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this + * field will be able to see the announcement. + */ + individualStudentsOptions?: IndividualStudentsOptions; + /** + * Additional materials. + * + * Announcements must have no more than 20 material items. + */ + materials?: Material[]; + /** Optional timestamp when this announcement is scheduled to be published. */ + scheduledTime?: string; + /** + * Status of this announcement. + * If unspecified, the default state is `DRAFT`. + */ + state?: string; + /** + * Description of this announcement. + * The text must be a valid UTF-8 string containing no more + * than 30,000 characters. + */ + text?: string; + /** + * Timestamp of the most recent change to this announcement. + * + * Read-only. + */ + updateTime?: string; + } + interface Assignment { + /** + * Drive folder where attachments from student submissions are placed. + * This is only populated for course teachers and administrators. + */ + studentWorkFolder?: DriveFolder; + } + interface AssignmentSubmission { + /** + * Attachments added by the student. + * Drive files that correspond to materials with a share mode of + * STUDENT_COPY may not exist yet if the student has not accessed the + * assignment in Classroom. + * + * Some attachment metadata is only populated if the requesting user has + * permission to access it. Identifier and alternate_link fields are always + * available, but others (e.g. title) may not be. + */ + attachments?: Attachment[]; + } + interface Attachment { + /** Google Drive file attachment. */ + driveFile?: DriveFile; + /** Google Forms attachment. */ + form?: Form; + /** Link attachment. */ + link?: Link; + /** Youtube video attachment. */ + youTubeVideo?: YouTubeVideo; + } + interface CloudPubsubTopic { + /** + * The `name` field of a Cloud Pub/Sub + * [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). + */ + topicName?: string; + } + interface Course { + /** + * Absolute link to this course in the Classroom web UI. + * + * Read-only. + */ + alternateLink?: string; + /** + * The Calendar ID for a calendar that all course members can see, to which + * Classroom adds events for course work and announcements in the course. + * + * Read-only. + */ + calendarId?: string; + /** + * The email address of a Google group containing all members of the course. + * This group does not accept email and can only be used for permissions. + * + * Read-only. + */ + courseGroupEmail?: string; + /** + * Sets of materials that appear on the "about" page of this course. + * + * Read-only. + */ + courseMaterialSets?: CourseMaterialSet[]; + /** + * State of the course. + * If unspecified, the default state is `PROVISIONED`. + */ + courseState?: string; + /** + * Creation time of the course. + * Specifying this field in a course update mask results in an error. + * + * Read-only. + */ + creationTime?: string; + /** + * Optional description. + * For example, "We'll be learning about the structure of living + * creatures from a combination of textbooks, guest lectures, and lab work. + * Expect to be excited!" + * If set, this field must be a valid UTF-8 string and no longer than 30,000 + * characters. + */ + description?: string; + /** + * Optional heading for the description. + * For example, "Welcome to 10th Grade Biology." + * If set, this field must be a valid UTF-8 string and no longer than 3600 + * characters. + */ + descriptionHeading?: string; + /** + * Enrollment code to use when joining this course. + * Specifying this field in a course update mask results in an error. + * + * Read-only. + */ + enrollmentCode?: string; + /** + * Whether or not guardian notifications are enabled for this course. + * + * Read-only. + */ + guardiansEnabled?: boolean; + /** + * Identifier for this course assigned by Classroom. + * + * When + * creating a course, + * you may optionally set this identifier to an + * alias string in the + * request to create a corresponding alias. The `id` is still assigned by + * Classroom and cannot be updated after the course is created. + * + * Specifying this field in a course update mask results in an error. + */ + id?: string; + /** + * Name of the course. + * For example, "10th Grade Biology". + * The name is required. It must be between 1 and 750 characters and a valid + * UTF-8 string. + */ + name?: string; + /** + * The identifier of the owner of a course. + * + * When specified as a parameter of a + * create course request, this + * field is required. + * The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + * + * This must be set in a create request. Admins can also specify this field + * in a patch course request to + * transfer ownership. In other contexts, it is read-only. + */ + ownerId?: string; + /** + * Optional room location. + * For example, "301". + * If set, this field must be a valid UTF-8 string and no longer than 650 + * characters. + */ + room?: string; + /** + * Section of the course. + * For example, "Period 2". + * If set, this field must be a valid UTF-8 string and no longer than 2800 + * characters. + */ + section?: string; + /** + * Information about a Drive Folder that is shared with all teachers of the + * course. + * + * This field will only be set for teachers of the course and domain administrators. + * + * Read-only. + */ + teacherFolder?: DriveFolder; + /** + * The email address of a Google group containing all teachers of the course. + * This group does not accept email and can only be used for permissions. + * + * Read-only. + */ + teacherGroupEmail?: string; + /** + * Time of the most recent update to this course. + * Specifying this field in a course update mask results in an error. + * + * Read-only. + */ + updateTime?: string; + } + interface CourseAlias { + /** + * Alias string. The format of the string indicates the desired alias scoping. + * + * * `d:` indicates a domain-scoped alias. + * Example: `d:math_101` + * * `p:` indicates a project-scoped alias. + * Example: `p:abc123` + * + * This field has a maximum length of 256 characters. + */ + alias?: string; + } + interface CourseMaterial { + /** Google Drive file attachment. */ + driveFile?: DriveFile; + /** Google Forms attachment. */ + form?: Form; + /** Link atatchment. */ + link?: Link; + /** Youtube video attachment. */ + youTubeVideo?: YouTubeVideo; + } + interface CourseMaterialSet { + /** Materials attached to this set. */ + materials?: CourseMaterial[]; + /** Title for this set. */ + title?: string; + } + interface CourseRosterChangesInfo { + /** The `course_id` of the course to subscribe to roster changes for. */ + courseId?: string; + } + interface CourseWork { + /** + * Absolute link to this course work in the Classroom web UI. + * This is only populated if `state` is `PUBLISHED`. + * + * Read-only. + */ + alternateLink?: string; + /** + * Assignee mode of the coursework. + * If unspecified, the default value is `ALL_STUDENTS`. + */ + assigneeMode?: string; + /** + * Assignment details. + * This is populated only when `work_type` is `ASSIGNMENT`. + * + * Read-only. + */ + assignment?: Assignment; + /** + * Whether this course work item is associated with the Developer Console + * project making the request. + * + * See google.classroom.Work.CreateCourseWork for more + * details. + * + * Read-only. + */ + associatedWithDeveloper?: boolean; + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Timestamp when this course work was created. + * + * Read-only. + */ + creationTime?: string; + /** + * Identifier for the user that created the coursework. + * + * Read-only. + */ + creatorUserId?: string; + /** + * Optional description of this course work. + * If set, the description must be a valid UTF-8 string containing no more + * than 30,000 characters. + */ + description?: string; + /** + * Optional date, in UTC, that submissions for this this course work are due. + * This must be specified if `due_time` is specified. + */ + dueDate?: Date; + /** + * Optional time of day, in UTC, that submissions for this this course work + * are due. + * This must be specified if `due_date` is specified. + */ + dueTime?: TimeOfDay; + /** + * Classroom-assigned identifier of this course work, unique per course. + * + * Read-only. + */ + id?: string; + /** + * Identifiers of students with access to the coursework. + * This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. + * If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students + * specified in this field will be assigned the coursework. + */ + individualStudentsOptions?: IndividualStudentsOptions; + /** + * Additional materials. + * + * CourseWork must have no more than 20 material items. + */ + materials?: Material[]; + /** + * Maximum grade for this course work. + * If zero or unspecified, this assignment is considered ungraded. + * This must be a non-negative integer value. + */ + maxPoints?: number; + /** + * Multiple choice question details. + * For read operations, this field is populated only when `work_type` is + * `MULTIPLE_CHOICE_QUESTION`. + * For write operations, this field must be specified when creating course + * work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be + * set otherwise. + */ + multipleChoiceQuestion?: MultipleChoiceQuestion; + /** Optional timestamp when this course work is scheduled to be published. */ + scheduledTime?: string; + /** + * Status of this course work. + * If unspecified, the default state is `DRAFT`. + */ + state?: string; + /** + * Setting to determine when students are allowed to modify submissions. + * If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. + */ + submissionModificationMode?: string; + /** + * Title of this course work. + * The title must be a valid UTF-8 string containing between 1 and 3000 + * characters. + */ + title?: string; + /** + * Timestamp of the most recent change to this course work. + * + * Read-only. + */ + updateTime?: string; + /** + * Type of this course work. + * + * The type is set when the course work is created and cannot be changed. + */ + workType?: string; + } + interface Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day?: number; + /** Month of year. Must be from 1 to 12. */ + month?: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without + * a year. + */ + year?: number; + } + interface DriveFile { + /** + * URL that can be used to access the Drive item. + * + * Read-only. + */ + alternateLink?: string; + /** Drive API resource ID. */ + id?: string; + /** + * URL of a thumbnail image of the Drive item. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the Drive item. + * + * Read-only. + */ + title?: string; + } + interface DriveFolder { + /** + * URL that can be used to access the Drive folder. + * + * Read-only. + */ + alternateLink?: string; + /** Drive API resource ID. */ + id?: string; + /** + * Title of the Drive folder. + * + * Read-only. + */ + title?: string; + } + interface Feed { + /** + * Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. + * This field must be specified if `feed_type` is `COURSE_ROSTER_CHANGES`. + */ + courseRosterChangesInfo?: CourseRosterChangesInfo; + /** The type of feed. */ + feedType?: string; + } + interface Form { + /** URL of the form. */ + formUrl?: string; + /** + * URL of the form responses document. + * Only set if respsonses have been recorded and only when the + * requesting user is an editor of the form. + * + * Read-only. + */ + responseUrl?: string; + /** + * URL of a thumbnail image of the Form. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the Form. + * + * Read-only. + */ + title?: string; + } + interface GlobalPermission { + /** Permission value. */ + permission?: string; + } + interface GradeHistory { + /** The teacher who made the grade change. */ + actorUserId?: string; + /** The type of grade change at this time in the submission grade history. */ + gradeChangeType?: string; + /** When the grade of the submission was changed. */ + gradeTimestamp?: string; + /** + * The denominator of the grade at this time in the submission grade + * history. + */ + maxPoints?: number; + /** The numerator of the grade at this time in the submission grade history. */ + pointsEarned?: number; + } + interface Guardian { + /** Identifier for the guardian. */ + guardianId?: string; + /** User profile for the guardian. */ + guardianProfile?: UserProfile; + /** + * The email address to which the initial guardian invitation was sent. + * This field is only visible to domain administrators. + */ + invitedEmailAddress?: string; + /** Identifier for the student to whom the guardian relationship applies. */ + studentId?: string; + } + interface GuardianInvitation { + /** + * The time that this invitation was created. + * + * Read-only. + */ + creationTime?: string; + /** + * Unique identifier for this invitation. + * + * Read-only. + */ + invitationId?: string; + /** + * Email address that the invitation was sent to. + * This field is only visible to domain administrators. + */ + invitedEmailAddress?: string; + /** The state that this invitation is in. */ + state?: string; + /** ID of the student (in standard format) */ + studentId?: string; + } + interface IndividualStudentsOptions { + /** + * Identifiers for the students that have access to the + * coursework/announcement. + */ + studentIds?: string[]; + } + interface Invitation { + /** Identifier of the course to invite the user to. */ + courseId?: string; + /** + * Identifier assigned by Classroom. + * + * Read-only. + */ + id?: string; + /** + * Role to invite the user to have. + * Must not be `COURSE_ROLE_UNSPECIFIED`. + */ + role?: string; + /** + * Identifier of the invited user. + * + * When specified as a parameter of a request, this identifier can be set to + * one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + } + interface Link { + /** + * URL of a thumbnail image of the target URL. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the target of the URL. + * + * Read-only. + */ + title?: string; + /** + * URL to link to. + * This must be a valid UTF-8 string containing between 1 and 2024 characters. + */ + url?: string; + } + interface ListAnnouncementsResponse { + /** Announcement items that match the request. */ + announcements?: Announcement[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListCourseAliasesResponse { + /** The course aliases. */ + aliases?: CourseAlias[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListCourseWorkResponse { + /** Course work items that match the request. */ + courseWork?: CourseWork[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListCoursesResponse { + /** Courses that match the list request. */ + courses?: Course[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListGuardianInvitationsResponse { + /** Guardian invitations that matched the list request. */ + guardianInvitations?: GuardianInvitation[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListGuardiansResponse { + /** + * Guardians on this page of results that met the criteria specified in + * the request. + */ + guardians?: Guardian[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListInvitationsResponse { + /** Invitations that match the list request. */ + invitations?: Invitation[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListStudentSubmissionsResponse { + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + /** Student work that matches the request. */ + studentSubmissions?: StudentSubmission[]; + } + interface ListStudentsResponse { + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + /** Students who match the list request. */ + students?: Student[]; + } + interface ListTeachersResponse { + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + /** Teachers who match the list request. */ + teachers?: Teacher[]; + } + interface Material { + /** Google Drive file material. */ + driveFile?: SharedDriveFile; + /** Google Forms material. */ + form?: Form; + /** + * Link material. On creation, will be upgraded to a more appropriate type + * if possible, and this will be reflected in the response. + */ + link?: Link; + /** YouTube video material. */ + youtubeVideo?: YouTubeVideo; + } + interface ModifyAnnouncementAssigneesRequest { + /** + * Mode of the announcement describing whether it will be accessible by all + * students or specified individual students. + */ + assigneeMode?: string; + /** + * Set which students can view or cannot view the announcement. + * Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + */ + modifyIndividualStudentsOptions?: ModifyIndividualStudentsOptions; + } + interface ModifyAttachmentsRequest { + /** + * Attachments to add. + * A student submission may not have more than 20 attachments. + * + * Form attachments are not supported. + */ + addAttachments?: Attachment[]; + } + interface ModifyCourseWorkAssigneesRequest { + /** + * Mode of the coursework describing whether it will be assigned to all + * students or specified individual students. + */ + assigneeMode?: string; + /** + * Set which students are assigned or not assigned to the coursework. + * Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + */ + modifyIndividualStudentsOptions?: ModifyIndividualStudentsOptions; + } + interface ModifyIndividualStudentsOptions { + /** + * Ids of students to be added as having access to this + * coursework/announcement. + */ + addStudentIds?: string[]; + /** + * Ids of students to be removed from having access to this + * coursework/announcement. + */ + removeStudentIds?: string[]; + } + interface MultipleChoiceQuestion { + /** Possible choices. */ + choices?: string[]; + } + interface MultipleChoiceSubmission { + /** Student's select choice. */ + answer?: string; + } + interface Name { + /** + * The user's last name. + * + * Read-only. + */ + familyName?: string; + /** + * The user's full name formed by concatenating the first and last name + * values. + * + * Read-only. + */ + fullName?: string; + /** + * The user's first name. + * + * Read-only. + */ + givenName?: string; + } + interface Registration { + /** The Cloud Pub/Sub topic that notifications are to be sent to. */ + cloudPubsubTopic?: CloudPubsubTopic; + /** + * The time until which the `Registration` is effective. + * + * This is a read-only field assigned by the server. + */ + expiryTime?: string; + /** + * Specification for the class of notifications that Classroom should deliver + * to the `destination`. + */ + feed?: Feed; + /** + * A server-generated unique identifier for this `Registration`. + * + * Read-only. + */ + registrationId?: string; + } + interface SharedDriveFile { + /** Drive file details. */ + driveFile?: DriveFile; + /** Mechanism by which students access the Drive item. */ + shareMode?: string; + } + interface ShortAnswerSubmission { + /** Student response to a short-answer question. */ + answer?: string; + } + interface StateHistory { + /** The teacher or student who made the change */ + actorUserId?: string; + /** The workflow pipeline stage. */ + state?: string; + /** When the submission entered this state. */ + stateTimestamp?: string; + } + interface Student { + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Global user information for the student. + * + * Read-only. + */ + profile?: UserProfile; + /** + * Information about a Drive Folder for this student's work in this course. + * Only visible to the student and domain administrators. + * + * Read-only. + */ + studentWorkFolder?: DriveFolder; + /** + * Identifier of the user. + * + * When specified as a parameter of a request, this identifier can be one of + * the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + } + interface StudentSubmission { + /** + * Absolute link to the submission in the Classroom web UI. + * + * Read-only. + */ + alternateLink?: string; + /** + * Optional grade. If unset, no grade was set. + * This value must be non-negative. Decimal (i.e. non-integer) values are + * allowed, but will be rounded to two decimal places. + * + * This may be modified only by course teachers. + */ + assignedGrade?: number; + /** + * Submission content when course_work_type is ASSIGNMENT. + * + * Students can modify this content using + * google.classroom.Work.ModifyAttachments. + */ + assignmentSubmission?: AssignmentSubmission; + /** + * Whether this student submission is associated with the Developer Console + * project making the request. + * + * See google.classroom.Work.CreateCourseWork for more + * details. + * + * Read-only. + */ + associatedWithDeveloper?: boolean; + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Identifier for the course work this corresponds to. + * + * Read-only. + */ + courseWorkId?: string; + /** + * Type of course work this submission is for. + * + * Read-only. + */ + courseWorkType?: string; + /** + * Creation time of this submission. + * This may be unset if the student has not accessed this item. + * + * Read-only. + */ + creationTime?: string; + /** + * Optional pending grade. If unset, no grade was set. + * This value must be non-negative. Decimal (i.e. non-integer) values are + * allowed, but will be rounded to two decimal places. + * + * This is only visible to and modifiable by course teachers. + */ + draftGrade?: number; + /** + * Classroom-assigned Identifier for the student submission. + * This is unique among submissions for the relevant course work. + * + * Read-only. + */ + id?: string; + /** + * Whether this submission is late. + * + * Read-only. + */ + late?: boolean; + /** Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. */ + multipleChoiceSubmission?: MultipleChoiceSubmission; + /** Submission content when course_work_type is SHORT_ANSWER_QUESTION. */ + shortAnswerSubmission?: ShortAnswerSubmission; + /** + * State of this submission. + * + * Read-only. + */ + state?: string; + /** + * The history of the submission (includes state and grade histories). + * + * Read-only. + */ + submissionHistory?: SubmissionHistory[]; + /** + * Last update time of this submission. + * This may be unset if the student has not accessed this item. + * + * Read-only. + */ + updateTime?: string; + /** + * Identifier for the student that owns this submission. + * + * Read-only. + */ + userId?: string; + } + interface SubmissionHistory { + /** The grade history information of the submission, if present. */ + gradeHistory?: GradeHistory; + /** The state history information of the submission, if present. */ + stateHistory?: StateHistory; + } + interface Teacher { + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Global user information for the teacher. + * + * Read-only. + */ + profile?: UserProfile; + /** + * Identifier of the user. + * + * When specified as a parameter of a request, this identifier can be one of + * the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + } + interface TimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + */ + hours?: number; + /** Minutes of hour of day. Must be from 0 to 59. */ + minutes?: number; + /** Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. */ + nanos?: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds?: number; + } + interface UserProfile { + /** + * Email address of the user. + * + * Read-only. + */ + emailAddress?: string; + /** + * Identifier of the user. + * + * Read-only. + */ + id?: string; + /** + * Name of the user. + * + * Read-only. + */ + name?: Name; + /** + * Global permissions of the user. + * + * Read-only. + */ + permissions?: GlobalPermission[]; + /** + * URL of user's profile photo. + * + * Read-only. + */ + photoUrl?: string; + /** + * Represents whether a G Suite for Education user's domain administrator has + * explicitly verified them as being a teacher. If the user is not a member of + * a G Suite for Education domain, than this field will always be false. + * + * Read-only + */ + verifiedTeacher?: boolean; + } + interface YouTubeVideo { + /** + * URL that can be used to view the YouTube video. + * + * Read-only. + */ + alternateLink?: string; + /** YouTube API resource ID. */ + id?: string; + /** + * URL of a thumbnail image of the YouTube video. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the YouTube video. + * + * Read-only. + */ + title?: string; + } + interface AliasesResource { + /** + * Creates an alias for a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create the + * alias or for access errors. + * * `NOT_FOUND` if the course does not exist. + * * `ALREADY_EXISTS` if the alias already exists. + * * `FAILED_PRECONDITION` if the alias requested does not make sense for the + * requesting user or course (for example, if a user not in a domain + * attempts to access a domain-scoped alias). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course to alias. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an alias of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to remove the + * alias or for access errors. + * * `NOT_FOUND` if the alias does not exist. + * * `FAILED_PRECONDITION` if the alias requested does not make sense for the + * requesting user or course (for example, if a user not in a domain + * attempts to delete a domain-scoped alias). + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Alias to delete. + * This may not be the Classroom-assigned identifier. + */ + alias: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course whose alias should be deleted. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a list of aliases for a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * course or for access errors. + * * `NOT_FOUND` if the course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface AnnouncementsResource { + /** + * Creates an announcement. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course, create announcements in the requested course, share a + * Drive attachment, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + * * `FAILED_PRECONDITION` for the following request error: + * * AttachmentNotVisible + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an announcement. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding announcement item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding announcement, if the requesting user is not permitted + * to delete the requested course or for access errors. + * * `FAILED_PRECONDITION` if the requested announcement has already been + * deleted. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the announcement to delete. + * This identifier is a Classroom-assigned identifier. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns an announcement. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or announcement, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or announcement does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the announcement. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of announcements that the requester is permitted to view. + * + * Course students may only view `PUBLISHED` announcements. Course teachers + * and domain administrators may view all announcements. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * the requested course or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Restriction on the `state` of announcements returned. + * If this argument is left unspecified, the default value is `PUBLISHED`. + */ + announcementStates?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional sort ordering for results. A comma-separated list of fields with + * an optional sort direction keyword. Supported field is `updateTime`. + * Supported direction keywords are `asc` and `desc`. + * If not specified, `updateTime desc` is the default behavior. + * Examples: `updateTime asc`, `updateTime` + */ + orderBy?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies assignee mode and options of an announcement. + * + * Only a teacher of the course that contains the announcement may + * call this method. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or course work does not exist. + */ + modifyAssignees(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the announcement. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields of an announcement. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding announcement or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `FAILED_PRECONDITION` if the requested announcement has already been + * deleted. + * * `NOT_FOUND` if the requested course or announcement does not exist + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the announcement. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the announcement to update. + * This field is required to do an update. The update fails if invalid + * fields are specified. If a field supports empty values, it can be cleared + * by specifying it in the update mask and not in the Announcement object. If + * a field that does not support empty values is included in the update mask + * and not set in the Announcement object, an `INVALID_ARGUMENT` error will be + * returned. + * + * The following fields may be specified by teachers: + * + * * `text` + * * `state` + * * `scheduled_time` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface StudentSubmissionsResource { + /** + * Returns a student submission. + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course, course work, or student submission or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of student submissions that the requester is permitted to + * view, factoring in the OAuth scopes of the request. + * `-` may be specified as the `course_work_id` to include student + * submissions for multiple course work items. + * + * Course students may only view their own work. Course teachers + * and domain administrators may view all student submissions. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** + * Identifier of the student work to request. + * This may be set to the string literal `"-"` to request student work for + * all course work in the specified course. + */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Requested lateness value. If specified, returned student submissions are + * restricted by the requested value. + * If unspecified, submissions are returned regardless of `late` value. + */ + late?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Requested submission states. If specified, returned student submissions + * match one of the specified submission states. + */ + states?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Optional argument to restrict returned student work to those owned by the + * student with the specified identifier. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + }): Request; + /** + * Modifies attachments of student submission. + * + * Attachments may only be added to student submissions belonging to course + * work objects with a `workType` of `ASSIGNMENT`. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, if the user is not permitted to modify + * attachments on the requested student submission, or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + modifyAttachments(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields of a student submission. + * + * See google.classroom.v1.StudentSubmission for details + * of which fields may be updated and who may change them. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding course work, if the user is not permitted to make the + * requested modification to the student submission, or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the student submission to update. + * This field is required to do an update. The update fails if invalid + * fields are specified. + * + * The following fields may be specified by teachers: + * + * * `draft_grade` + * * `assigned_grade` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Reclaims a student submission on behalf of the student that owns it. + * + * Reclaiming a student submission transfers ownership of attached Drive + * files to the student and update the submission state. + * + * Only the student that owns the requested student submission may call this + * method, and only for a student submission that has been turned in. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, unsubmit the requested student submission, + * or for access errors. + * * `FAILED_PRECONDITION` if the student submission has not been turned in. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + reclaim(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a student submission. + * + * Returning a student submission transfers ownership of attached Drive + * files to the student and may also update the submission state. + * Unlike the Classroom application, returning a student submission does not + * set assignedGrade to the draftGrade value. + * + * Only a teacher of the course that contains the requested student submission + * may call this method. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, return the requested student submission, + * or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + return(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Turns in a student submission. + * + * Turning in a student submission transfers ownership of attached Drive + * files to the teacher and may also update the submission state. + * + * This may only be called by the student that owns the specified student + * submission. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, turn in the requested student submission, + * or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + turnIn(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface CourseWorkResource { + /** + * Creates course work. + * + * The resulting course work (and corresponding student submissions) are + * associated with the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * make the request. Classroom API requests to modify course work and student + * submissions must be made with an OAuth client ID from the associated + * Developer Console project. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course, create course work in the requested course, share a + * Drive attachment, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + * * `FAILED_PRECONDITION` for the following request error: + * * AttachmentNotVisible + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a course work. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding course work, if the requesting user is not permitted + * to delete the requested course or for access errors. + * * `FAILED_PRECONDITION` if the requested course work has already been + * deleted. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course work to delete. + * This identifier is a Classroom-assigned identifier. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns course work. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or course work does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the course work. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of course work that the requester is permitted to view. + * + * Course students may only view `PUBLISHED` course work. Course teachers + * and domain administrators may view all course work. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * the requested course or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** + * Restriction on the work status to return. Only courseWork that matches + * is returned. If unspecified, items with a work status of `PUBLISHED` + * is returned. + */ + courseWorkStates?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional sort ordering for results. A comma-separated list of fields with + * an optional sort direction keyword. Supported fields are `updateTime` + * and `dueDate`. Supported direction keywords are `asc` and `desc`. + * If not specified, `updateTime desc` is the default behavior. + * Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` + */ + orderBy?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies assignee mode and options of a coursework. + * + * Only a teacher of the course that contains the coursework may + * call this method. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or course work does not exist. + */ + modifyAssignees(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the coursework. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields of a course work. + * + * See google.classroom.v1.CourseWork for details + * of which fields may be updated and who may change them. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding course work, if the user is not permitted to make the + * requested modification to the student submission, or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `FAILED_PRECONDITION` if the requested course work has already been + * deleted. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the course work. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the course work to update. + * This field is required to do an update. The update fails if invalid + * fields are specified. If a field supports empty values, it can be cleared + * by specifying it in the update mask and not in the CourseWork object. If a + * field that does not support empty values is included in the update mask and + * not set in the CourseWork object, an `INVALID_ARGUMENT` error will be + * returned. + * + * The following fields may be specified by teachers: + * + * * `title` + * * `description` + * * `state` + * * `due_date` + * * `due_time` + * * `max_points` + * * `scheduled_time` + * * `submission_modification_mode` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + studentSubmissions: StudentSubmissionsResource; + } + interface StudentsResource { + /** + * Adds a user as a student of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * students in this course or for access errors. + * * `NOT_FOUND` if the requested course ID does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled, + * for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if the user is already a student or teacher in the + * course. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course to create the student in. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** + * Enrollment code of the course to create the student in. + * This code is required if userId + * corresponds to the requesting user; it may be omitted if the requesting + * user has administrative permissions to create students for any user. + */ + enrollmentCode?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a student of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete + * students of this course or for access errors. + * * `NOT_FOUND` if no student of this course has the requested ID or if the + * course does not exist. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the student to delete. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request<{}>; + /** + * Returns a student of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view + * students of this course or for access errors. + * * `NOT_FOUND` if no student of this course has the requested ID or if the + * course does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the student to return. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request; + /** + * Returns a list of students of this course that the requester + * is permitted to view. + * + * This method returns the following error codes: + * + * * `NOT_FOUND` if the course does not exist. + * * `PERMISSION_DENIED` for access errors. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero means no maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, indicating that + * the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TeachersResource { + /** + * Creates a teacher of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * teachers in this course or for access errors. + * * `NOT_FOUND` if the requested course ID does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled, + * for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * CourseTeacherLimitReached + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if the user is already a teacher or student in the + * course. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a teacher of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete + * teachers of this course or for access errors. + * * `NOT_FOUND` if no teacher of this course has the requested ID or if the + * course does not exist. + * * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher + * of this course. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the teacher to delete. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request<{}>; + /** + * Returns a teacher of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view + * teachers of this course or for access errors. + * * `NOT_FOUND` if no teacher of this course has the requested ID or if the + * course does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the teacher to return. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request; + /** + * Returns a list of teachers of this course that the requester + * is permitted to view. + * + * This method returns the following error codes: + * + * * `NOT_FOUND` if the course does not exist. + * * `PERMISSION_DENIED` for access errors. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero means no maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, indicating that + * the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CoursesResource { + /** + * Creates a course. + * + * The user specified in `ownerId` is the owner of the created course + * and added as a teacher. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * courses or for access errors. + * * `NOT_FOUND` if the primary teacher is not a valid user. + * * `FAILED_PRECONDITION` if the course owner's account is disabled or for + * the following request errors: + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if an alias was specified in the `id` and + * already exists. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to delete. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to return. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of courses that the requesting user is permitted to view, + * restricted to those that match the request. Returned courses are ordered by + * creation time, with the most recently created coming first. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + * * `INVALID_ARGUMENT` if the query argument is malformed. + * * `NOT_FOUND` if any users specified in the query arguments do not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Restricts returned courses to those in one of the specified states + * The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. + */ + courseStates?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Restricts returned courses to those having a student with the specified + * identifier. The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + studentId?: string; + /** + * Restricts returned courses to those having a teacher with the specified + * identifier. The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + teacherId?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields in a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + * if no update mask is supplied. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to update. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the course to update. + * This field is required to do an update. The update will fail if invalid + * fields are specified. The following fields are valid: + * + * * `name` + * * `section` + * * `descriptionHeading` + * * `description` + * * `room` + * * `courseState` + * * `ownerId` + * + * Note: patches to ownerId are treated as being effective immediately, but in + * practice it may take some time for the ownership transfer of all affected + * resources to complete. + * + * When set in a query parameter, this field should be specified as + * + * `updateMask=,,...` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to update. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + aliases: AliasesResource; + announcements: AnnouncementsResource; + courseWork: CourseWorkResource; + students: StudentsResource; + teachers: TeachersResource; + } + interface InvitationsResource { + /** + * Accepts an invitation, removing it and adding the invited user to the + * teachers or students (as appropriate) of the specified course. Only the + * invited user may accept an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to accept the + * requested invitation or for access errors. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * CourseTeacherLimitReached + * * UserGroupsMembershipLimitReached + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + accept(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the invitation to accept. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Creates an invitation. Only one invitation for a user and course may exist + * at a time. Delete and re-create an invitation to make changes. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * invitations for this course or for access errors. + * * `NOT_FOUND` if the course or the user does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled or if + * the user already has this role or a role with greater permissions. + * * `ALREADY_EXISTS` if an invitation for the specified user and course + * already exists. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the invitation to delete. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the invitation to return. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of invitations that the requesting user is permitted to + * view, restricted to those that match the list request. + * + * *Note:* At least one of `user_id` or `course_id` must be supplied. Both + * fields can be supplied. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Restricts returned invitations to those for a course with the specified + * identifier. + */ + courseId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero means no maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, indicating + * that the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Restricts returned invitations to those for a specific user. The identifier + * can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + }): Request; + } + interface RegistrationsResource { + /** + * Creates a `Registration`, causing Classroom to start sending notifications + * from the provided `feed` to the provided `destination`. + * + * Returns the created `Registration`. Currently, this will be the same as + * the argument, but with server-assigned fields such as `expiry_time` and + * `id` filled in. + * + * Note that any value specified for the `expiry_time` or `id` fields will be + * ignored. + * + * While Classroom may validate the `destination` and return errors on a best + * effort basis, it is the caller's responsibility to ensure that it exists + * and that Classroom has permission to publish to it. + * + * This method may return the following error codes: + * + * * `PERMISSION_DENIED` if: + * * the authenticated user does not have permission to receive + * notifications from the requested field; or + * * the credential provided does not include the appropriate scope for the + * requested feed. + * * another access error is encountered. + * * `INVALID_ARGUMENT` if: + * * no `destination` is specified, or the specified `destination` is not + * valid; or + * * no `feed` is specified, or the specified `feed` is not valid. + * * `NOT_FOUND` if: + * * the specified `feed` cannot be located, or the requesting user does not + * have permission to determine whether or not it exists; or + * * the specified `destination` cannot be located, or Classroom has not + * been granted permission to publish to it. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a `Registration`, causing Classroom to stop sending notifications + * for that `Registration`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The `registration_id` of the `Registration` to be deleted. */ + registrationId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface GuardianInvitationsResource { + /** + * Creates a guardian invitation, and sends an email to the guardian asking + * them to confirm that they are the student's guardian. + * + * Once the guardian accepts the invitation, their `state` will change to + * `COMPLETED` and they will start receiving guardian notifications. A + * `Guardian` resource will also be created to represent the active guardian. + * + * The request object must have the `student_id` and + * `invited_email_address` fields set. Failing to set these fields, or + * setting any other fields in the request, will result in an error. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the current user does not have permission to + * manage guardians, if the guardian in question has already rejected + * too many requests for that student, if guardians are not enabled for the + * domain in question, or for other access errors. + * * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian + * link limit. + * * `INVALID_ARGUMENT` if the guardian email address is not valid (for + * example, if it is too long), or if the format of the student ID provided + * cannot be recognized (it is not an email address, nor a `user_id` from + * this API). This error will also be returned if read-only fields are set, + * or if the `state` field is set to to a value other than `PENDING`. + * * `NOT_FOUND` if the student ID provided is a valid student ID, but + * Classroom has no record of that student. + * * `ALREADY_EXISTS` if there is already a pending guardian invitation for + * the student and `invited_email_address` provided, or if the provided + * `invited_email_address` matches the Google account of an existing + * `Guardian` for this user. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the student (in standard format) */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a specific guardian invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view + * guardian invitations for the student identified by the `student_id`, if + * guardians are not enabled for the domain in question, or for other + * access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). + * * `NOT_FOUND` if Classroom cannot find any record of the given student or + * `invitation_id`. May also be returned if the student exists, but the + * requesting user does not have access to see that student. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field of the `GuardianInvitation` being requested. */ + invitationId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The ID of the student whose guardian invitation is being requested. */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of guardian invitations that the requesting user is + * permitted to view, filtered by the parameters provided. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + * user is not permitted to view guardian invitations for that student, if + * `"-"` is specified as the `student_id` and the user is not a domain + * administrator, if guardians are not enabled for the domain in question, + * or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). May also be returned if an invalid + * `page_token` or `state` is provided. + * * `NOT_FOUND` if a `student_id` is specified, and its format can be + * recognized, but Classroom has no record of that student. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * If specified, only results with the specified `invited_email_address` + * will be returned. + */ + invitedEmailAddress?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If specified, only results with the specified `state` values will be + * returned. Otherwise, results with a `state` of `PENDING` will be returned. + */ + states?: string; + /** + * The ID of the student whose guardian invitations are to be returned. + * The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + * * the string literal `"-"`, indicating that results should be returned for + * all students that the requesting user is permitted to view guardian + * invitations. + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies a guardian invitation. + * + * Currently, the only valid modification is to change the `state` from + * `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the current user does not have permission to + * manage guardians, if guardians are not enabled for the domain in question + * or for other access errors. + * * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. + * * `INVALID_ARGUMENT` if the format of the student ID provided + * cannot be recognized (it is not an email address, nor a `user_id` from + * this API), or if the passed `GuardianInvitation` has a `state` other than + * `COMPLETE`, or if it modifies fields other than `state`. + * * `NOT_FOUND` if the student ID provided is a valid student ID, but + * Classroom has no record of that student, or if the `id` field does not + * refer to a guardian invitation known to Classroom. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field of the `GuardianInvitation` to be modified. */ + invitationId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The ID of the student whose guardian invitation is to be modified. */ + studentId: string; + /** + * Mask that identifies which fields on the course to update. + * This field is required to do an update. The update will fail if invalid + * fields are specified. The following fields are valid: + * + * * `state` + * + * When set in a query parameter, this field should be specified as + * + * `updateMask=,,...` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface GuardiansResource { + /** + * Deletes a guardian. + * + * The guardian will no longer receive guardian notifications and the guardian + * will no longer be accessible via the API. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if no user that matches the provided `student_id` + * is visible to the requesting user, if the requesting user is not + * permitted to manage guardians for the student identified by the + * `student_id`, if guardians are not enabled for the domain in question, + * or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API). + * * `NOT_FOUND` if the requesting user is permitted to modify guardians for + * the requested `student_id`, but no `Guardian` record exists for that + * student with the provided `guardian_id`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field from a `Guardian`. */ + guardianId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The student whose guardian is to be deleted. One of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a specific guardian. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if no user that matches the provided `student_id` + * is visible to the requesting user, if the requesting user is not + * permitted to view guardian information for the student identified by the + * `student_id`, if guardians are not enabled for the domain in question, + * or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). + * * `NOT_FOUND` if the requesting user is permitted to view guardians for + * the requested `student_id`, but no `Guardian` record exists for that + * student that matches the provided `guardian_id`. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field from a `Guardian`. */ + guardianId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The student whose guardian is being requested. One of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of guardians that the requesting user is permitted to + * view, restricted to those that match the request. + * + * To list guardians for any student that the requesting user may view + * guardians for, use the literal character `-` for the student ID. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + * user is not permitted to view guardian information for that student, if + * `"-"` is specified as the `student_id` and the user is not a domain + * administrator, if guardians are not enabled for the domain in question, + * if the `invited_email_address` filter is set by a user who is not a + * domain administrator, or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). May also be returned if an invalid + * `page_token` is provided. + * * `NOT_FOUND` if a `student_id` is specified, and its format can be + * recognized, but Classroom has no record of that student. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Filter results by the email address that the original invitation was sent + * to, resulting in this guardian link. + * This filter can only be used by domain administrators. + */ + invitedEmailAddress?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Filter results by the student who the guardian is linked to. + * The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + * * the string literal `"-"`, indicating that results should be returned for + * all students that the requesting user has access to view. + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface UserProfilesResource { + /** + * Returns a user profile. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * this user profile, if no profile exists with the requested ID, or for + * access errors. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the profile to return. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request; + guardianInvitations: GuardianInvitationsResource; + guardians: GuardiansResource; + } + } +} diff --git a/types/gapi.client.classroom/readme.md b/types/gapi.client.classroom/readme.md new file mode 100644 index 0000000000..329be31c73 --- /dev/null +++ b/types/gapi.client.classroom/readme.md @@ -0,0 +1,305 @@ +# TypeScript typings for Google Classroom API v1 +Manages classes, rosters, and invitations in Google Classroom. +For detailed description please check [documentation](https://developers.google.com/classroom/). + +## Installing + +Install typings for Google Classroom API: +``` +npm install @types/gapi.client.classroom@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('classroom', 'v1', () => { + // now we can use gapi.client.classroom + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage announcements in Google Classroom + 'https://www.googleapis.com/auth/classroom.announcements', + + // View announcements in Google Classroom + 'https://www.googleapis.com/auth/classroom.announcements.readonly', + + // Manage your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.courses', + + // View your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.courses.readonly', + + // Manage your course work and view your grades in Google Classroom + 'https://www.googleapis.com/auth/classroom.coursework.me', + + // View your course work and grades in Google Classroom + 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + + // Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer + 'https://www.googleapis.com/auth/classroom.coursework.students', + + // View course work and grades for students in the Google Classroom classes you teach or administer + 'https://www.googleapis.com/auth/classroom.coursework.students.readonly', + + // View your Google Classroom guardians + 'https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly', + + // View and manage guardians for students in your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.guardianlinks.students', + + // View guardians for students in your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly', + + // View the email addresses of people in your classes + 'https://www.googleapis.com/auth/classroom.profile.emails', + + // View the profile photos of people in your classes + 'https://www.googleapis.com/auth/classroom.profile.photos', + + // Manage your Google Classroom class rosters + 'https://www.googleapis.com/auth/classroom.rosters', + + // View your Google Classroom class rosters + 'https://www.googleapis.com/auth/classroom.rosters.readonly', + + // View your course work and grades in Google Classroom + 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly', + + // View course work and grades for students in the Google Classroom classes you teach or administer + 'https://www.googleapis.com/auth/classroom.student-submissions.students.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Classroom API resources: + +```typescript + +/* +Creates a course. + +The user specified in `ownerId` is the owner of the created course +and added as a teacher. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to create +courses or for access errors. +* `NOT_FOUND` if the primary teacher is not a valid user. +* `FAILED_PRECONDITION` if the course owner's account is disabled or for +the following request errors: + * UserGroupsMembershipLimitReached +* `ALREADY_EXISTS` if an alias was specified in the `id` and +already exists. +*/ +await gapi.client.courses.create({ }); + +/* +Deletes a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to delete the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +*/ +await gapi.client.courses.delete({ id: "id", }); + +/* +Returns a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to access the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +*/ +await gapi.client.courses.get({ id: "id", }); + +/* +Returns a list of courses that the requesting user is permitted to view, +restricted to those that match the request. Returned courses are ordered by +creation time, with the most recently created coming first. + +This method returns the following error codes: + +* `PERMISSION_DENIED` for access errors. +* `INVALID_ARGUMENT` if the query argument is malformed. +* `NOT_FOUND` if any users specified in the query arguments do not exist. +*/ +await gapi.client.courses.list({ }); + +/* +Updates one or more fields in a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to modify the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +* `INVALID_ARGUMENT` if invalid fields are specified in the update mask or +if no update mask is supplied. +* `FAILED_PRECONDITION` for the following request errors: + * CourseNotModifiable +*/ +await gapi.client.courses.patch({ id: "id", }); + +/* +Updates a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to modify the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +* `FAILED_PRECONDITION` for the following request errors: + * CourseNotModifiable +*/ +await gapi.client.courses.update({ id: "id", }); + +/* +Accepts an invitation, removing it and adding the invited user to the +teachers or students (as appropriate) of the specified course. Only the +invited user may accept an invitation. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to accept the +requested invitation or for access errors. +* `FAILED_PRECONDITION` for the following request errors: + * CourseMemberLimitReached + * CourseNotModifiable + * CourseTeacherLimitReached + * UserGroupsMembershipLimitReached +* `NOT_FOUND` if no invitation exists with the requested ID. +*/ +await gapi.client.invitations.accept({ id: "id", }); + +/* +Creates an invitation. Only one invitation for a user and course may exist +at a time. Delete and re-create an invitation to make changes. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to create +invitations for this course or for access errors. +* `NOT_FOUND` if the course or the user does not exist. +* `FAILED_PRECONDITION` if the requested user's account is disabled or if +the user already has this role or a role with greater permissions. +* `ALREADY_EXISTS` if an invitation for the specified user and course +already exists. +*/ +await gapi.client.invitations.create({ }); + +/* +Deletes an invitation. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to delete the +requested invitation or for access errors. +* `NOT_FOUND` if no invitation exists with the requested ID. +*/ +await gapi.client.invitations.delete({ id: "id", }); + +/* +Returns an invitation. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to view the +requested invitation or for access errors. +* `NOT_FOUND` if no invitation exists with the requested ID. +*/ +await gapi.client.invitations.get({ id: "id", }); + +/* +Returns a list of invitations that the requesting user is permitted to +view, restricted to those that match the list request. + +*Note:* At least one of `user_id` or `course_id` must be supplied. Both +fields can be supplied. + +This method returns the following error codes: + +* `PERMISSION_DENIED` for access errors. +*/ +await gapi.client.invitations.list({ }); + +/* +Creates a `Registration`, causing Classroom to start sending notifications +from the provided `feed` to the provided `destination`. + +Returns the created `Registration`. Currently, this will be the same as +the argument, but with server-assigned fields such as `expiry_time` and +`id` filled in. + +Note that any value specified for the `expiry_time` or `id` fields will be +ignored. + +While Classroom may validate the `destination` and return errors on a best +effort basis, it is the caller's responsibility to ensure that it exists +and that Classroom has permission to publish to it. + +This method may return the following error codes: + +* `PERMISSION_DENIED` if: + * the authenticated user does not have permission to receive + notifications from the requested field; or + * the credential provided does not include the appropriate scope for the + requested feed. + * another access error is encountered. +* `INVALID_ARGUMENT` if: + * no `destination` is specified, or the specified `destination` is not + valid; or + * no `feed` is specified, or the specified `feed` is not valid. +* `NOT_FOUND` if: + * the specified `feed` cannot be located, or the requesting user does not + have permission to determine whether or not it exists; or + * the specified `destination` cannot be located, or Classroom has not + been granted permission to publish to it. +*/ +await gapi.client.registrations.create({ }); + +/* +Deletes a `Registration`, causing Classroom to stop sending notifications +for that `Registration`. +*/ +await gapi.client.registrations.delete({ registrationId: "registrationId", }); + +/* +Returns a user profile. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to access +this user profile, if no profile exists with the requested ID, or for +access errors. +*/ +await gapi.client.userProfiles.get({ userId: "userId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.classroom/tsconfig.json b/types/gapi.client.classroom/tsconfig.json new file mode 100644 index 0000000000..4e1a97323a --- /dev/null +++ b/types/gapi.client.classroom/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.classroom-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.classroom/tslint.json b/types/gapi.client.classroom/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.classroom/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudbilling/gapi.client.cloudbilling-tests.ts b/types/gapi.client.cloudbilling/gapi.client.cloudbilling-tests.ts new file mode 100644 index 0000000000..2b846c0c89 --- /dev/null +++ b/types/gapi.client.cloudbilling/gapi.client.cloudbilling-tests.ts @@ -0,0 +1,98 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudbilling', 'v1', () => { + /** now we can use gapi.client.cloudbilling */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Gets information about a billing account. The current authenticated user + * must be an [owner of the billing + * account](https://support.google.com/cloud/answer/4430947). + */ + await gapi.client.billingAccounts.get({ + name: "name", + }); + /** + * Lists the billing accounts that the current authenticated user + * [owns](https://support.google.com/cloud/answer/4430947). + */ + await gapi.client.billingAccounts.list({ + pageSize: 1, + pageToken: "pageToken", + }); + /** + * Gets the billing information for a project. The current authenticated user + * must have [permission to view the + * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ). + */ + await gapi.client.projects.getBillingInfo({ + name: "name", + }); + /** + * Sets or updates the billing account associated with a project. You specify + * the new billing account by setting the `billing_account_name` in the + * `ProjectBillingInfo` resource to the resource name of a billing account. + * Associating a project with an open billing account enables billing on the + * project and allows charges for resource usage. If the project already had a + * billing account, this method changes the billing account used for resource + * usage charges. + * + * *Note:* Incurred charges that have not yet been reported in the transaction + * history of the Google Cloud Console may be billed to the new billing + * account, even if the charge occurred before the new billing account was + * assigned to the project. + * + * The current authenticated user must have ownership privileges for both the + * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ) and the [billing + * account](https://support.google.com/cloud/answer/4430947). + * + * You can disable billing on the project by setting the + * `billing_account_name` field to empty. This action disassociates the + * current billing account from the project. Any billable activity of your + * in-use services will stop, and your application could stop functioning as + * expected. Any unbilled charges to date will be billed to the previously + * associated account. The current authenticated user must be either an owner + * of the project or an owner of the billing account for the project. + * + * Note that associating a project with a *closed* billing account will have + * much the same effect as disabling billing on the project: any paid + * resources used by the project will be shut down. Thus, unless you wish to + * disable billing, you should always call this method with the name of an + * *open* billing account. + */ + await gapi.client.projects.updateBillingInfo({ + name: "name", + }); + /** Lists all public cloud services. */ + await gapi.client.services.list({ + pageSize: 1, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.cloudbilling/index.d.ts b/types/gapi.client.cloudbilling/index.d.ts new file mode 100644 index 0000000000..cd09fa5e15 --- /dev/null +++ b/types/gapi.client.cloudbilling/index.d.ts @@ -0,0 +1,640 @@ +// Type definitions for Google Google Cloud Billing API v1 1.0 +// Project: https://cloud.google.com/billing/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudbilling.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Billing API v1 */ + function load(name: "cloudbilling", version: "v1"): PromiseLike; + function load(name: "cloudbilling", version: "v1", callback: () => any): void; + + const billingAccounts: cloudbilling.BillingAccountsResource; + + const projects: cloudbilling.ProjectsResource; + + const services: cloudbilling.ServicesResource; + + namespace cloudbilling { + interface AggregationInfo { + /** + * The number of intervals to aggregate over. + * Example: If aggregation_level is "DAILY" and aggregation_count is 14, + * aggregation will be over 14 days. + */ + aggregationCount?: number; + aggregationInterval?: string; + aggregationLevel?: string; + } + interface BillingAccount { + /** + * The display name given to the billing account, such as `My Billing + * Account`. This name is displayed in the Google Cloud Console. + */ + displayName?: string; + /** + * The resource name of the billing account. The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF` would be the resource name for + * billing account `012345-567890-ABCDEF`. + */ + name?: string; + /** + * True if the billing account is open, and will therefore be charged for any + * usage on associated projects. False if the billing account is closed, and + * therefore projects associated with it will be unable to use paid services. + */ + open?: boolean; + } + interface Category { + /** + * The type of product the SKU refers to. + * Example: "Compute", "Storage", "Network", "ApplicationServices" etc. + */ + resourceFamily?: string; + /** + * A group classification for related SKUs. + * Example: "RAM", "GPU", "Prediction", "Ops", "GoogleEgress" etc. + */ + resourceGroup?: string; + /** The display name of the service this SKU belongs to. */ + serviceDisplayName?: string; + /** + * Represents how the SKU is consumed. + * Example: "OnDemand", "Preemptible", "Commit1Mo", "Commit1Yr" etc. + */ + usageType?: string; + } + interface ListBillingAccountsResponse { + /** A list of billing accounts. */ + billingAccounts?: BillingAccount[]; + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListBillingAccounts` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + } + interface ListProjectBillingInfoResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListProjectBillingInfo` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + /** + * A list of `ProjectBillingInfo` resources representing the projects + * associated with the billing account. + */ + projectBillingInfo?: ProjectBillingInfo[]; + } + interface ListServicesResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListServices` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + /** A list of services. */ + services?: Service[]; + } + interface ListSkusResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListSkus` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + /** The list of public SKUs of the given service. */ + skus?: Sku[]; + } + interface Money { + /** The 3-letter currency code defined in ISO 4217. */ + currencyCode?: string; + /** + * Number of nano (10^-9) units of the amount. + * The value must be between -999,999,999 and +999,999,999 inclusive. + * If `units` is positive, `nanos` must be positive or zero. + * If `units` is zero, `nanos` can be positive, zero, or negative. + * If `units` is negative, `nanos` must be negative or zero. + * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + */ + nanos?: number; + /** + * The whole units of the amount. + * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + */ + units?: string; + } + interface PricingExpression { + /** + * The base unit for the SKU which is the unit used in usage exports. + * Example: "By" + */ + baseUnit?: string; + /** + * Conversion factor for converting from price per usage_unit to price per + * base_unit, and start_usage_amount to start_usage_amount in base_unit. + * unit_price / base_unit_conversion_factor = price per base_unit. + * start_usage_amount * base_unit_conversion_factor = start_usage_amount in + * base_unit. + */ + baseUnitConversionFactor?: number; + /** + * The base unit in human readable form. + * Example: "byte". + */ + baseUnitDescription?: string; + /** + * The recommended quantity of units for displaying pricing info. When + * displaying pricing info it is recommended to display: + * (unit_price * display_quantity) per display_quantity usage_unit. + * This field does not affect the pricing formula and is for display purposes + * only. + * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and + * the display_quantity is "1000" then the recommended way of displaying the + * pricing info is "0.10 USD per 1000 GB" + */ + displayQuantity?: number; + /** + * The list of tiered rates for this pricing. The total cost is computed by + * applying each of the tiered rates on usage. This repeated list is sorted + * by ascending order of start_usage_amount. + */ + tieredRates?: TierRate[]; + /** + * The short hand for unit of usage this pricing is specified in. + * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". + */ + usageUnit?: string; + /** + * The unit of usage in human readable form. + * Example: "gibi byte". + */ + usageUnitDescription?: string; + } + interface PricingInfo { + /** + * Aggregation Info. This can be left unspecified if the pricing expression + * doesn't require aggregation. + */ + aggregationInfo?: AggregationInfo; + /** + * Conversion rate for currency conversion, from USD to the currency specified + * in the request. If the currency is not specified this defaults to 1.0. + * Example: USD * currency_conversion_rate = JPY + */ + currencyConversionRate?: number; + /** The timestamp from which this pricing was effective. */ + effectiveTime?: string; + /** Expresses the pricing formula. See `PricingExpression` for an example. */ + pricingExpression?: PricingExpression; + /** + * An optional human readable summary of the pricing information, has a + * maximum length of 256 characters. + */ + summary?: string; + } + interface ProjectBillingInfo { + /** + * The resource name of the billing account associated with the project, if + * any. For example, `billingAccounts/012345-567890-ABCDEF`. + */ + billingAccountName?: string; + /** + * True if the project is associated with an open billing account, to which + * usage on the project is charged. False if the project is associated with a + * closed billing account, or no billing account at all, and therefore cannot + * use paid services. This field is read-only. + */ + billingEnabled?: boolean; + /** + * The resource name for the `ProjectBillingInfo`; has the form + * `projects/{project_id}/billingInfo`. For example, the resource name for the + * billing information for project `tokyo-rain-123` would be + * `projects/tokyo-rain-123/billingInfo`. This field is read-only. + */ + name?: string; + /** + * The ID of the project that this `ProjectBillingInfo` represents, such as + * `tokyo-rain-123`. This is a convenience field so that you don't need to + * parse the `name` field to obtain a project ID. This field is read-only. + */ + projectId?: string; + } + interface Service { + /** A human readable display name for this service. */ + displayName?: string; + /** + * The resource name for the service. + * Example: "services/DA34-426B-A397" + */ + name?: string; + /** + * The identifier for the service. + * Example: "DA34-426B-A397" + */ + serviceId?: string; + } + interface Sku { + /** The category hierarchy of this SKU, purely for organizational purpose. */ + category?: Category; + /** + * A human readable description of the SKU, has a maximum length of 256 + * characters. + */ + description?: string; + /** + * The resource name for the SKU. + * Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE" + */ + name?: string; + /** A timeline of pricing info for this SKU in chronological order. */ + pricingInfo?: PricingInfo[]; + /** + * Identifies the service provider. + * This is 'Google' for first party services in Google Cloud Platform. + */ + serviceProviderName?: string; + /** + * List of service regions this SKU is offered at. + * Example: "asia-east1" + * Service regions can be found at https://cloud.google.com/about/locations/ + */ + serviceRegions?: string[]; + /** + * The identifier for the SKU. + * Example: "AA95-CD31-42FE" + */ + skuId?: string; + } + interface TierRate { + /** + * Usage is priced at this rate only after this amount. + * Example: start_usage_amount of 10 indicates that the usage will be priced + * at the unit_price after the first 10 usage_units. + */ + startUsageAmount?: number; + /** + * The price per unit of usage. + * Example: unit_price of amount $10 indicates that each unit will cost $10. + */ + unitPrice?: Money; + } + interface ProjectsResource { + /** + * Lists the projects associated with a billing account. The current + * authenticated user must be an [owner of the billing + * account](https://support.google.com/cloud/answer/4430947). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the billing account associated with the projects that + * you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The maximum page size is 100; this is also the + * default. + */ + pageSize?: number; + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous `ListProjectBillingInfo` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BillingAccountsResource { + /** + * Gets information about a billing account. The current authenticated user + * must be an [owner of the billing + * account](https://support.google.com/cloud/answer/4430947). + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the billing account to retrieve. For example, + * `billingAccounts/012345-567890-ABCDEF`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists the billing accounts that the current authenticated user + * [owns](https://support.google.com/cloud/answer/4430947). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The maximum page size is 100; this is also the + * default. + */ + pageSize?: number; + /** + * A token identifying a page of results to return. This should be a + * `next_page_token` value returned from a previous `ListBillingAccounts` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + projects: ProjectsResource; + } + interface ProjectsResource { + /** + * Gets the billing information for a project. The current authenticated user + * must have [permission to view the + * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ). + */ + getBillingInfo(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the project for which billing information is + * retrieved. For example, `projects/tokyo-rain-123`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets or updates the billing account associated with a project. You specify + * the new billing account by setting the `billing_account_name` in the + * `ProjectBillingInfo` resource to the resource name of a billing account. + * Associating a project with an open billing account enables billing on the + * project and allows charges for resource usage. If the project already had a + * billing account, this method changes the billing account used for resource + * usage charges. + * + * *Note:* Incurred charges that have not yet been reported in the transaction + * history of the Google Cloud Console may be billed to the new billing + * account, even if the charge occurred before the new billing account was + * assigned to the project. + * + * The current authenticated user must have ownership privileges for both the + * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ) and the [billing + * account](https://support.google.com/cloud/answer/4430947). + * + * You can disable billing on the project by setting the + * `billing_account_name` field to empty. This action disassociates the + * current billing account from the project. Any billable activity of your + * in-use services will stop, and your application could stop functioning as + * expected. Any unbilled charges to date will be billed to the previously + * associated account. The current authenticated user must be either an owner + * of the project or an owner of the billing account for the project. + * + * Note that associating a project with a *closed* billing account will have + * much the same effect as disabling billing on the project: any paid + * resources used by the project will be shut down. Thus, unless you wish to + * disable billing, you should always call this method with the name of an + * *open* billing account. + */ + updateBillingInfo(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the project associated with the billing information + * that you want to update. For example, `projects/tokyo-rain-123`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface SkusResource { + /** Lists all publicly available SKUs for a given cloud service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The ISO 4217 currency code for the pricing info in the response proto. + * Will use the conversion rate as of start_time. + * Optional. If not specified USD will be used. + */ + currencyCode?: string; + /** + * Optional exclusive end time of the time range for which the pricing + * versions will be returned. Timestamps in the future are not allowed. + * Maximum allowable time range is 1 month (31 days). Time range as a whole + * is optional. If not specified, the latest pricing will be returned (up to + * 12 hours old at most). + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Requested page size. Defaults to 5000. */ + pageSize?: number; + /** + * A token identifying a page of results to return. This should be a + * `next_page_token` value returned from a previous `ListSkus` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** + * The name of the service. + * Example: "services/DA34-426B-A397" + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Optional inclusive start time of the time range for which the pricing + * versions will be returned. Timestamps in the future are not allowed. + * Maximum allowable time range is 1 month (31 days). Time range as a whole + * is optional. If not specified, the latest pricing will be returned (up to + * 12 hours old at most). + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ServicesResource { + /** Lists all public cloud services. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Requested page size. Defaults to 5000. */ + pageSize?: number; + /** + * A token identifying a page of results to return. This should be a + * `next_page_token` value returned from a previous `ListServices` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + skus: SkusResource; + } + } +} diff --git a/types/gapi.client.cloudbilling/readme.md b/types/gapi.client.cloudbilling/readme.md new file mode 100644 index 0000000000..4c58940e5b --- /dev/null +++ b/types/gapi.client.cloudbilling/readme.md @@ -0,0 +1,116 @@ +# TypeScript typings for Google Cloud Billing API v1 +Allows developers to manage billing for their Google Cloud Platform projects + programmatically. +For detailed description please check [documentation](https://cloud.google.com/billing/). + +## Installing + +Install typings for Google Cloud Billing API: +``` +npm install @types/gapi.client.cloudbilling@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudbilling', 'v1', () => { + // now we can use gapi.client.cloudbilling + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Billing API resources: + +```typescript + +/* +Gets information about a billing account. The current authenticated user +must be an [owner of the billing +account](https://support.google.com/cloud/answer/4430947). +*/ +await gapi.client.billingAccounts.get({ name: "name", }); + +/* +Lists the billing accounts that the current authenticated user +[owns](https://support.google.com/cloud/answer/4430947). +*/ +await gapi.client.billingAccounts.list({ }); + +/* +Gets the billing information for a project. The current authenticated user +must have [permission to view the +project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo +). +*/ +await gapi.client.projects.getBillingInfo({ name: "name", }); + +/* +Sets or updates the billing account associated with a project. You specify +the new billing account by setting the `billing_account_name` in the +`ProjectBillingInfo` resource to the resource name of a billing account. +Associating a project with an open billing account enables billing on the +project and allows charges for resource usage. If the project already had a +billing account, this method changes the billing account used for resource +usage charges. + +*Note:* Incurred charges that have not yet been reported in the transaction +history of the Google Cloud Console may be billed to the new billing +account, even if the charge occurred before the new billing account was +assigned to the project. + +The current authenticated user must have ownership privileges for both the +[project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo +) and the [billing +account](https://support.google.com/cloud/answer/4430947). + +You can disable billing on the project by setting the +`billing_account_name` field to empty. This action disassociates the +current billing account from the project. Any billable activity of your +in-use services will stop, and your application could stop functioning as +expected. Any unbilled charges to date will be billed to the previously +associated account. The current authenticated user must be either an owner +of the project or an owner of the billing account for the project. + +Note that associating a project with a *closed* billing account will have +much the same effect as disabling billing on the project: any paid +resources used by the project will be shut down. Thus, unless you wish to +disable billing, you should always call this method with the name of an +*open* billing account. +*/ +await gapi.client.projects.updateBillingInfo({ name: "name", }); + +/* +Lists all public cloud services. +*/ +await gapi.client.services.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudbilling/tsconfig.json b/types/gapi.client.cloudbilling/tsconfig.json new file mode 100644 index 0000000000..66cfdbefe4 --- /dev/null +++ b/types/gapi.client.cloudbilling/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudbilling-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudbilling/tslint.json b/types/gapi.client.cloudbilling/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudbilling/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudbuild/gapi.client.cloudbuild-tests.ts b/types/gapi.client.cloudbuild/gapi.client.cloudbuild-tests.ts new file mode 100644 index 0000000000..a7b428a695 --- /dev/null +++ b/types/gapi.client.cloudbuild/gapi.client.cloudbuild-tests.ts @@ -0,0 +1,73 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudbuild', 'v1', () => { + /** now we can use gapi.client.cloudbuild */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an Operation.error value with a google.rpc.Status.code of 1, + * corresponding to `Code.CANCELLED`. + */ + await gapi.client.operations.cancel({ + name: "name", + }); + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + await gapi.client.operations.list({ + filter: "filter", + name: "name", + pageSize: 3, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.cloudbuild/index.d.ts b/types/gapi.client.cloudbuild/index.d.ts new file mode 100644 index 0000000000..ca50422cfb --- /dev/null +++ b/types/gapi.client.cloudbuild/index.d.ts @@ -0,0 +1,899 @@ +// Type definitions for Google Google Cloud Container Builder API v1 1.0 +// Project: https://cloud.google.com/container-builder/docs/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudbuild.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Container Builder API v1 */ + function load(name: "cloudbuild", version: "v1"): PromiseLike; + function load(name: "cloudbuild", version: "v1", callback: () => any): void; + + const operations: cloudbuild.OperationsResource; + + const projects: cloudbuild.ProjectsResource; + + namespace cloudbuild { + interface Build { + /** + * The ID of the BuildTrigger that triggered this build, if it was + * triggered automatically. + * @OutputOnly + */ + buildTriggerId?: string; + /** + * Time at which the request to create the build was received. + * @OutputOnly + */ + createTime?: string; + /** + * Time at which execution of the build was finished. + * + * The difference between finish_time and start_time is the duration of the + * build's execution. + * @OutputOnly + */ + finishTime?: string; + /** + * Unique identifier of the build. + * @OutputOnly + */ + id?: string; + /** + * A list of images to be pushed upon the successful completion of all build + * steps. + * + * The images will be pushed using the builder service account's credentials. + * + * The digests of the pushed images will be stored in the Build resource's + * results field. + * + * If any of the images fail to be pushed, the build is marked FAILURE. + */ + images?: string[]; + /** + * URL to logs for this build in Google Cloud Logging. + * @OutputOnly + */ + logUrl?: string; + /** + * Google Cloud Storage bucket where logs should be written (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. + */ + logsBucket?: string; + /** Special options for this build. */ + options?: BuildOptions; + /** + * ID of the project. + * @OutputOnly. + */ + projectId?: string; + /** + * Results of the build. + * @OutputOnly + */ + results?: Results; + /** Secrets to decrypt using Cloud KMS. */ + secrets?: Secret[]; + /** Describes where to find the source files to build. */ + source?: Source; + /** + * A permanent fixed identifier for source. + * @OutputOnly + */ + sourceProvenance?: SourceProvenance; + /** + * Time at which execution of the build was started. + * @OutputOnly + */ + startTime?: string; + /** + * Status of the build. + * @OutputOnly + */ + status?: string; + /** + * Customer-readable message about the current status. + * @OutputOnly + */ + statusDetail?: string; + /** Describes the operations to be performed on the workspace. */ + steps?: BuildStep[]; + /** Substitutions data for Build resource. */ + substitutions?: Record; + /** Tags for annotation of a Build. These are not docker tags. */ + tags?: string[]; + /** + * Amount of time that this build should be allowed to run, to second + * granularity. If this amount of time elapses, work on the build will cease + * and the build status will be TIMEOUT. + * + * Default time is ten minutes. + */ + timeout?: string; + } + interface BuildOperationMetadata { + /** The build that the operation is tracking. */ + build?: Build; + } + interface BuildOptions { + /** Requested verifiability options. */ + requestedVerifyOption?: string; + /** Requested hash for SourceProvenance. */ + sourceProvenanceHash?: string[]; + /** SubstitutionOption to allow unmatch substitutions. */ + substitutionOption?: string; + } + interface BuildStep { + /** + * A list of arguments that will be presented to the step when it is started. + * + * If the image used to run the step's container has an entrypoint, these args + * will be used as arguments to that entrypoint. If the image does not define + * an entrypoint, the first element in args will be used as the entrypoint, + * and the remainder will be used as arguments. + */ + args?: string[]; + /** + * Working directory (relative to project source root) to use when running + * this operation's container. + */ + dir?: string; + /** + * Optional entrypoint to be used instead of the build step image's default + * If unset, the image's default will be used. + */ + entrypoint?: string; + /** + * A list of environment variable definitions to be used when running a step. + * + * The elements are of the form "KEY=VALUE" for the environment variable "KEY" + * being given the value "VALUE". + */ + env?: string[]; + /** + * Optional unique identifier for this build step, used in wait_for to + * reference this build step as a dependency. + */ + id?: string; + /** + * The name of the container image that will run this particular build step. + * + * If the image is already available in the host's Docker daemon's cache, it + * will be run directly. If not, the host will attempt to pull the image + * first, using the builder service account's credentials if necessary. + * + * The Docker daemon's cache will already have the latest versions of all of + * the officially supported build steps + * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). + * The Docker daemon will also have cached many of the layers for some popular + * images, like "ubuntu", "debian", but they will be refreshed at the time you + * attempt to use them. + * + * If you built an image in a previous build step, it will be stored in the + * host's Docker daemon's cache and is available to use as the name for a + * later build step. + */ + name?: string; + /** + * A list of environment variables which are encrypted using a Cloud KMS + * crypto key. These values must be specified in the build's secrets. + */ + secretEnv?: string[]; + /** + * List of volumes to mount into the build step. + * + * Each volume will be created as an empty volume prior to execution of the + * build step. Upon completion of the build, volumes and their contents will + * be discarded. + * + * Using a named volume in only one step is not valid as it is indicative + * of a mis-configured build request. + */ + volumes?: Volume[]; + /** + * The ID(s) of the step(s) that this build step depends on. + * This build step will not start until all the build steps in wait_for + * have completed successfully. If wait_for is empty, this build step will + * start when all previous build steps in the Build.Steps list have completed + * successfully. + */ + waitFor?: string[]; + } + interface BuildTrigger { + /** Contents of the build template. */ + build?: Build; + /** + * Time when the trigger was created. + * + * @OutputOnly + */ + createTime?: string; + /** Human-readable description of this trigger. */ + description?: string; + /** If true, the trigger will never result in a build. */ + disabled?: boolean; + /** + * Path, from the source root, to a file whose contents is used for the + * template. + */ + filename?: string; + /** + * Unique identifier of the trigger. + * + * @OutputOnly + */ + id?: string; + /** Substitutions data for Build resource. */ + substitutions?: Record; + /** + * Template describing the types of source changes to trigger a build. + * + * Branch and tag names in trigger templates are interpreted as regular + * expressions. Any branch or tag change that matches that regular expression + * will trigger a build. + */ + triggerTemplate?: RepoSource; + } + interface BuiltImage { + /** Docker Registry 2.0 digest. */ + digest?: string; + /** + * Name used to push the container image to Google Container Registry, as + * presented to `docker push`. + */ + name?: string; + } + interface FileHashes { + /** Collection of file hashes. */ + fileHash?: Hash[]; + } + interface Hash { + /** The type of hash that was performed. */ + type?: string; + /** The hash value. */ + value?: string; + } + interface ListBuildTriggersResponse { + /** BuildTriggers for the project, sorted by create_time descending. */ + triggers?: BuildTrigger[]; + } + interface ListBuildsResponse { + /** Builds will be sorted by create_time, descending. */ + builds?: Build[]; + /** Token to receive the next page of results. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface RepoSource { + /** Name of the branch to build. */ + branchName?: string; + /** Explicit commit SHA to build. */ + commitSha?: string; + /** + * ID of the project that owns the repo. If omitted, the project ID requesting + * the build is assumed. + */ + projectId?: string; + /** Name of the repo. If omitted, the name "default" is assumed. */ + repoName?: string; + /** Name of the tag to build. */ + tagName?: string; + } + interface Results { + /** List of build step digests, in order corresponding to build step indices. */ + buildStepImages?: string[]; + /** Images that were built as a part of the build. */ + images?: BuiltImage[]; + } + interface Secret { + /** Cloud KMS key name to use to decrypt these envs. */ + kmsKeyName?: string; + /** + * Map of environment variable name to its encrypted value. + * + * Secret environment variables must be unique across all of a build's + * secrets, and must be used by at least one build step. Values can be at most + * 1 KB in size. There can be at most ten secret values across all of a + * build's secrets. + */ + secretEnv?: Record; + } + interface Source { + /** If provided, get source from this location in a Cloud Repo. */ + repoSource?: RepoSource; + /** If provided, get the source from this location in Google Cloud Storage. */ + storageSource?: StorageSource; + } + interface SourceProvenance { + /** + * Hash(es) of the build source, which can be used to verify that the original + * source integrity was maintained in the build. Note that FileHashes will + * only be populated if BuildOptions has requested a SourceProvenanceHash. + * + * The keys to this map are file paths used as build source and the values + * contain the hash values for those files. + * + * If the build source came in a single package such as a gzipped tarfile + * (.tar.gz), the FileHash will be for the single path to that file. + * @OutputOnly + */ + fileHashes?: Record; + /** + * A copy of the build's source.repo_source, if exists, with any + * revisions resolved. + */ + resolvedRepoSource?: RepoSource; + /** + * A copy of the build's source.storage_source, if exists, with any + * generations resolved. + */ + resolvedStorageSource?: StorageSource; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface StorageSource { + /** + * Google Cloud Storage bucket containing source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + */ + bucket?: string; + /** + * Google Cloud Storage generation for the object. If the generation is + * omitted, the latest generation will be used. + */ + generation?: string; + /** + * Google Cloud Storage object containing source. + * + * This object must be a gzipped archive file (.tar.gz) containing source to + * build. + */ + object?: string; + } + interface Volume { + /** + * Name of the volume to mount. + * + * Volume names must be unique per build step and must be valid names for + * Docker volumes. Each named volume must be used by at least two build steps. + */ + name?: string; + /** + * Path at which to mount the volume. + * + * Paths must be absolute and cannot conflict with other volume paths on the + * same build step or with certain reserved volume paths. + */ + path?: string; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an Operation.error value with a google.rpc.Status.code of 1, + * corresponding to `Code.CANCELLED`. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BuildsResource { + /** Cancels a requested build in progress. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the build. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Starts a build with the specified configuration. + * + * The long-running Operation returned by this method will include the ID of + * the build, which can be passed to GetBuild to determine its status (e.g., + * success or failure). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns information about a previously requested build. + * + * The Build that is returned includes its status (e.g., success or failure, + * or in-progress), and timing information. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the build. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists previously requested builds. + * + * Previously requested builds may still be in-progress, or may have finished + * successfully or unsuccessfully. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The raw filter text to constrain the results. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Number of results to return in the list. */ + pageSize?: number; + /** Token to provide to skip to a particular spot in the list. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TriggersResource { + /** + * Creates a new BuildTrigger. + * + * This API is experimental. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project for which to configure automatic builds. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an BuildTrigger by its project ID and trigger ID. + * + * This API is experimental. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project that owns the trigger. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the BuildTrigger to delete. */ + triggerId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets information about a BuildTrigger. + * + * This API is experimental. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project that owns the trigger. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the BuildTrigger to get. */ + triggerId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists existing BuildTrigger. + * + * This API is experimental. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project for which to list BuildTriggers. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates an BuildTrigger by its project ID and trigger ID. + * + * This API is experimental. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project that owns the trigger. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the BuildTrigger to update. */ + triggerId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + builds: BuildsResource; + triggers: TriggersResource; + } + } +} diff --git a/types/gapi.client.cloudbuild/readme.md b/types/gapi.client.cloudbuild/readme.md new file mode 100644 index 0000000000..a7371764be --- /dev/null +++ b/types/gapi.client.cloudbuild/readme.md @@ -0,0 +1,89 @@ +# TypeScript typings for Google Cloud Container Builder API v1 +Builds container images in the cloud. +For detailed description please check [documentation](https://cloud.google.com/container-builder/docs/). + +## Installing + +Install typings for Google Cloud Container Builder API: +``` +npm install @types/gapi.client.cloudbuild@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudbuild', 'v1', () => { + // now we can use gapi.client.cloudbuild + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Container Builder API resources: + +```typescript + +/* +Starts asynchronous cancellation on a long-running operation. The server +makes a best effort to cancel the operation, but success is not +guaranteed. If the server doesn't support this method, it returns +`google.rpc.Code.UNIMPLEMENTED`. Clients can use +Operations.GetOperation or +other methods to check whether the cancellation succeeded or whether the +operation completed despite cancellation. On successful cancellation, +the operation is not deleted; instead, it becomes an operation with +an Operation.error value with a google.rpc.Status.code of 1, +corresponding to `Code.CANCELLED`. +*/ +await gapi.client.operations.cancel({ name: "name", }); + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); + +/* +Lists operations that match the specified filter in the request. If the +server doesn't support this method, it returns `UNIMPLEMENTED`. + +NOTE: the `name` binding allows API services to override the binding +to use different resource name schemes, such as `users/*/operations`. To +override the binding, API services can add a binding such as +`"/v1/{name=users/*}/operations"` to their service configuration. +For backwards compatibility, the default name includes the operations +collection id, however overriding users must ensure the name binding +is the parent resource, without the operations collection id. +*/ +await gapi.client.operations.list({ name: "name", }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudbuild/tsconfig.json b/types/gapi.client.cloudbuild/tsconfig.json new file mode 100644 index 0000000000..22d8d6d390 --- /dev/null +++ b/types/gapi.client.cloudbuild/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudbuild-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudbuild/tslint.json b/types/gapi.client.cloudbuild/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudbuild/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.clouddebugger/gapi.client.clouddebugger-tests.ts b/types/gapi.client.clouddebugger/gapi.client.clouddebugger-tests.ts new file mode 100644 index 0000000000..983c975c44 --- /dev/null +++ b/types/gapi.client.clouddebugger/gapi.client.clouddebugger-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('clouddebugger', 'v2', () => { + /** now we can use gapi.client.clouddebugger */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** Manage cloud debugger */ + 'https://www.googleapis.com/auth/cloud_debugger', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.clouddebugger/index.d.ts b/types/gapi.client.clouddebugger/index.d.ts new file mode 100644 index 0000000000..0fdb5167ce --- /dev/null +++ b/types/gapi.client.clouddebugger/index.d.ts @@ -0,0 +1,817 @@ +// Type definitions for Google Stackdriver Debugger API v2 2.0 +// Project: http://cloud.google.com/debugger +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://clouddebugger.googleapis.com/$discovery/rest?version=v2 + +/// + +declare namespace gapi.client { + /** Load Stackdriver Debugger API v2 */ + function load(name: "clouddebugger", version: "v2"): PromiseLike; + function load(name: "clouddebugger", version: "v2", callback: () => any): void; + + const controller: clouddebugger.ControllerResource; + + namespace clouddebugger { + interface AliasContext { + /** The alias kind. */ + kind?: string; + /** The alias name. */ + name?: string; + } + interface Breakpoint { + /** + * Action that the agent should perform when the code at the + * breakpoint location is hit. + */ + action?: string; + /** + * Condition that triggers the breakpoint. + * The condition is a compound boolean expression composed using expressions + * in a programming language at the source location. + */ + condition?: string; + /** Time this breakpoint was created by the server in seconds resolution. */ + createTime?: string; + /** + * Values of evaluated expressions at breakpoint time. + * The evaluated expressions appear in exactly the same order they + * are listed in the `expressions` field. + * The `name` field holds the original expression text, the `value` or + * `members` field holds the result of the evaluated expression. + * If the expression cannot be evaluated, the `status` inside the `Variable` + * will indicate an error and contain the error text. + */ + evaluatedExpressions?: Variable[]; + /** + * List of read-only expressions to evaluate at the breakpoint location. + * The expressions are composed using expressions in the programming language + * at the source location. If the breakpoint action is `LOG`, the evaluated + * expressions are included in log statements. + */ + expressions?: string[]; + /** + * Time this breakpoint was finalized as seen by the server in seconds + * resolution. + */ + finalTime?: string; + /** Breakpoint identifier, unique in the scope of the debuggee. */ + id?: string; + /** + * When true, indicates that this is a final result and the + * breakpoint state will not change from here on. + */ + isFinalState?: boolean; + /** + * A set of custom breakpoint properties, populated by the agent, to be + * displayed to the user. + */ + labels?: Record; + /** Breakpoint source location. */ + location?: SourceLocation; + /** Indicates the severity of the log. Only relevant when action is `LOG`. */ + logLevel?: string; + /** + * Only relevant when action is `LOG`. Defines the message to log when + * the breakpoint hits. The message may include parameter placeholders `$0`, + * `$1`, etc. These placeholders are replaced with the evaluated value + * of the appropriate expression. Expressions not referenced in + * `log_message_format` are not logged. + * + * Example: `Message received, id = $0, count = $1` with + * `expressions` = `[ message.id, message.count ]`. + */ + logMessageFormat?: string; + /** The stack at breakpoint time. */ + stackFrames?: StackFrame[]; + /** + * Breakpoint status. + * + * The status includes an error flag and a human readable message. + * This field is usually unset. The message can be either + * informational or an error message. Regardless, clients should always + * display the text message back to the user. + * + * Error status indicates complete failure of the breakpoint. + * + * Example (non-final state): `Still loading symbols...` + * + * Examples (final state): + * + * * `Invalid line number` referring to location + * * `Field f not found in class C` referring to condition + */ + status?: StatusMessage; + /** E-mail address of the user that created this breakpoint */ + userEmail?: string; + /** + * The `variable_table` exists to aid with computation, memory and network + * traffic optimization. It enables storing a variable once and reference + * it from multiple variables, including variables stored in the + * `variable_table` itself. + * For example, the same `this` object, which may appear at many levels of + * the stack, can have all of its data stored once in this table. The + * stack frame variables then would hold only a reference to it. + * + * The variable `var_table_index` field is an index into this repeated field. + * The stored objects are nameless and get their name from the referencing + * variable. The effective variable is a merge of the referencing variable + * and the referenced variable. + */ + variableTable?: Variable[]; + } + interface CloudRepoSourceContext { + /** An alias, which may be a branch or tag. */ + aliasContext?: AliasContext; + /** The name of an alias (branch, tag, etc.). */ + aliasName?: string; + /** The ID of the repo. */ + repoId?: RepoId; + /** A revision ID. */ + revisionId?: string; + } + interface CloudWorkspaceId { + /** + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + */ + name?: string; + /** The ID of the repo containing the workspace. */ + repoId?: RepoId; + } + interface CloudWorkspaceSourceContext { + /** + * The ID of the snapshot. + * An empty snapshot_id refers to the most recent snapshot. + */ + snapshotId?: string; + /** The ID of the workspace. */ + workspaceId?: CloudWorkspaceId; + } + interface Debuggee { + /** + * Version ID of the agent. + * Schema: `domain/language-platform/vmajor.minor` (for example + * `google.com/java-gcp/v1.1`). + */ + agentVersion?: string; + /** + * Human readable description of the debuggee. + * Including a human-readable project name, environment name and version + * information is recommended. + */ + description?: string; + /** + * References to the locations and revisions of the source code used in the + * deployed application. + * + * NOTE: this field is experimental and can be ignored. + */ + extSourceContexts?: ExtendedSourceContext[]; + /** Unique identifier for the debuggee generated by the controller service. */ + id?: string; + /** + * If set to `true`, indicates that the agent should disable itself and + * detach from the debuggee. + */ + isDisabled?: boolean; + /** + * If set to `true`, indicates that Controller service does not detect any + * activity from the debuggee agents and the application is possibly stopped. + */ + isInactive?: boolean; + /** + * A set of custom debuggee properties, populated by the agent, to be + * displayed to the user. + */ + labels?: Record; + /** + * Project the debuggee is associated with. + * Use project number or id when registering a Google Cloud Platform project. + */ + project?: string; + /** + * References to the locations and revisions of the source code used in the + * deployed application. + */ + sourceContexts?: SourceContext[]; + /** + * Human readable message to be displayed to the user about this debuggee. + * Absence of this field indicates no status. The message can be either + * informational or an error status. + */ + status?: StatusMessage; + /** + * Uniquifier to further distiguish the application. + * It is possible that different applications might have identical values in + * the debuggee message, thus, incorrectly identified as a single application + * by the Controller service. This field adds salt to further distiguish the + * application. Agents should consider seeding this field with value that + * identifies the code, binary, configuration and environment. + */ + uniquifier?: string; + } + interface ExtendedSourceContext { + /** Any source context. */ + context?: SourceContext; + /** Labels with user defined metadata. */ + labels?: Record; + } + interface FormatMessage { + /** + * Format template for the message. The `format` uses placeholders `$0`, + * `$1`, etc. to reference parameters. `$$` can be used to denote the `$` + * character. + * + * Examples: + * + * * `Failed to load '$0' which helps debug $1 the first time it + * is loaded. Again, $0 is very important.` + * * `Please pay $$10 to use $0 instead of $1.` + */ + format?: string; + /** Optional parameters to be embedded into the message. */ + parameters?: string[]; + } + interface GerritSourceContext { + /** An alias, which may be a branch or tag. */ + aliasContext?: AliasContext; + /** The name of an alias (branch, tag, etc.). */ + aliasName?: string; + /** + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. + * The "repo name" is hostURI/project. + */ + gerritProject?: string; + /** The URI of a running Gerrit instance. */ + hostUri?: string; + /** A revision (commit) ID. */ + revisionId?: string; + } + interface GetBreakpointResponse { + /** + * Complete breakpoint state. + * The fields `id` and `location` are guaranteed to be set. + */ + breakpoint?: Breakpoint; + } + interface GitSourceContext { + /** + * Git commit hash. + * required. + */ + revisionId?: string; + /** Git repository URL. */ + url?: string; + } + interface ListActiveBreakpointsResponse { + /** + * List of all active breakpoints. + * The fields `id` and `location` are guaranteed to be set on each breakpoint. + */ + breakpoints?: Breakpoint[]; + /** + * A token that can be used in the next method call to block until + * the list of breakpoints changes. + */ + nextWaitToken?: string; + /** + * If set to `true`, indicates that there is no change to the + * list of active breakpoints and the server-selected timeout has expired. + * The `breakpoints` field would be empty and should be ignored. + */ + waitExpired?: boolean; + } + interface ListBreakpointsResponse { + /** + * List of breakpoints matching the request. + * The fields `id` and `location` are guaranteed to be set on each breakpoint. + * The fields: `stack_frames`, `evaluated_expressions` and `variable_table` + * are cleared on each breakpoint regardless of its status. + */ + breakpoints?: Breakpoint[]; + /** + * A wait token that can be used in the next call to `list` (REST) or + * `ListBreakpoints` (RPC) to block until the list of breakpoints has changes. + */ + nextWaitToken?: string; + } + interface ListDebuggeesResponse { + /** + * List of debuggees accessible to the calling user. + * The fields `debuggee.id` and `description` are guaranteed to be set. + * The `description` field is a human readable field provided by agents and + * can be displayed to users. + */ + debuggees?: Debuggee[]; + } + interface ProjectRepoId { + /** The ID of the project. */ + projectId?: string; + /** The name of the repo. Leave empty for the default repo. */ + repoName?: string; + } + interface RegisterDebuggeeRequest { + /** + * Debuggee information to register. + * The fields `project`, `uniquifier`, `description` and `agent_version` + * of the debuggee must be set. + */ + debuggee?: Debuggee; + } + interface RegisterDebuggeeResponse { + /** + * Debuggee resource. + * The field `id` is guranteed to be set (in addition to the echoed fields). + * If the field `is_disabled` is set to `true`, the agent should disable + * itself by removing all breakpoints and detaching from the application. + * It should however continue to poll `RegisterDebuggee` until reenabled. + */ + debuggee?: Debuggee; + } + interface RepoId { + /** A combination of a project ID and a repo name. */ + projectRepoId?: ProjectRepoId; + /** A server-assigned, globally unique identifier. */ + uid?: string; + } + interface SetBreakpointResponse { + /** + * Breakpoint resource. + * The field `id` is guaranteed to be set (in addition to the echoed fileds). + */ + breakpoint?: Breakpoint; + } + interface SourceContext { + /** A SourceContext referring to a revision in a cloud repo. */ + cloudRepo?: CloudRepoSourceContext; + /** A SourceContext referring to a snapshot in a cloud workspace. */ + cloudWorkspace?: CloudWorkspaceSourceContext; + /** A SourceContext referring to a Gerrit project. */ + gerrit?: GerritSourceContext; + /** A SourceContext referring to any third party Git repo (e.g. GitHub). */ + git?: GitSourceContext; + } + interface SourceLocation { + /** Line inside the file. The first line in the file has the value `1`. */ + line?: number; + /** Path to the source file within the source context of the target binary. */ + path?: string; + } + interface StackFrame { + /** + * Set of arguments passed to this function. + * Note that this might not be populated for all stack frames. + */ + arguments?: Variable[]; + /** Demangled function name at the call site. */ + function?: string; + /** + * Set of local variables at the stack frame location. + * Note that this might not be populated for all stack frames. + */ + locals?: Variable[]; + /** Source location of the call site. */ + location?: SourceLocation; + } + interface StatusMessage { + /** Status message text. */ + description?: FormatMessage; + /** Distinguishes errors from informational messages. */ + isError?: boolean; + /** Reference to which the message applies. */ + refersTo?: string; + } + interface UpdateActiveBreakpointRequest { + /** + * Updated breakpoint information. + * The field `id` must be set. + * The agent must echo all Breakpoint specification fields in the update. + */ + breakpoint?: Breakpoint; + } + interface Variable { + /** Members contained or pointed to by the variable. */ + members?: Variable[]; + /** Name of the variable, if any. */ + name?: string; + /** + * Status associated with the variable. This field will usually stay + * unset. A status of a single variable only applies to that variable or + * expression. The rest of breakpoint data still remains valid. Variables + * might be reported in error state even when breakpoint is not in final + * state. + * + * The message may refer to variable name with `refers_to` set to + * `VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`. + * In either case variable value and members will be unset. + * + * Example of error message applied to name: `Invalid expression syntax`. + * + * Example of information message applied to value: `Not captured`. + * + * Examples of error message applied to value: + * + * * `Malformed string`, + * * `Field f not found in class C` + * * `Null pointer dereference` + */ + status?: StatusMessage; + /** + * Variable type (e.g. `MyClass`). If the variable is split with + * `var_table_index`, `type` goes next to `value`. The interpretation of + * a type is agent specific. It is recommended to include the dynamic type + * rather than a static type of an object. + */ + type?: string; + /** Simple value of the variable. */ + value?: string; + /** + * Reference to a variable in the shared variable table. More than + * one variable can reference the same variable in the table. The + * `var_table_index` field is an index into `variable_table` in Breakpoint. + */ + varTableIndex?: number; + } + interface BreakpointsResource { + /** + * Returns the list of all active breakpoints for the debuggee. + * + * The breakpoint specification (`location`, `condition`, and `expressions` + * fields) is semantically immutable, although the field values may + * change. For example, an agent may update the location line number + * to reflect the actual line where the breakpoint was set, but this + * doesn't change the breakpoint semantics. + * + * This means that an agent does not need to check if a breakpoint has changed + * when it encounters the same breakpoint on a successive call. + * Moreover, an agent should remember the breakpoints that are completed + * until the controller removes them from the active list to avoid + * setting those breakpoints again. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Identifies the debuggee. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If set to `true` (recommended), returns `google.rpc.Code.OK` status and + * sets the `wait_expired` response field to `true` when the server-selected + * timeout has expired. + * + * If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status + * when the server-selected timeout has expired. + */ + successOnTimeout?: boolean; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * A token that, if specified, blocks the method call until the list + * of active breakpoints has changed, or a server-selected timeout has + * expired. The value should be set from the `next_wait_token` field in + * the last response. The initial value should be set to `"init"`. + */ + waitToken?: string; + }): Request; + /** + * Updates the breakpoint state or mutable fields. + * The entire Breakpoint message must be sent back to the controller service. + * + * Updates to active breakpoint fields are only allowed if the new value + * does not change the breakpoint specification. Updates to the `location`, + * `condition` and `expressions` fields should not alter the breakpoint + * semantics. These may only make changes such as canonicalizing a value + * or snapping the location to the correct line of code. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Identifies the debuggee being debugged. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Breakpoint identifier, unique in the scope of the debuggee. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface DebuggeesResource { + /** + * Registers the debuggee with the controller service. + * + * All agents attached to the same application must call this method with + * exactly the same request content to get back the same stable `debuggee_id`. + * Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` + * is returned from any controller method. + * + * This protocol allows the controller service to disable debuggees, recover + * from data loss, or change the `debuggee_id` format. Agents must handle + * `debuggee_id` value changing upon re-registration. + */ + register(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + breakpoints: BreakpointsResource; + } + interface ControllerResource { + debuggees: DebuggeesResource; + } + interface BreakpointsResource { + /** Deletes the breakpoint from the debuggee. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** ID of the breakpoint to delete. */ + breakpointId: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee whose breakpoint to delete. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets breakpoint information. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** ID of the breakpoint to get. */ + breakpointId: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee whose breakpoint to get. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all breakpoints for the debuggee. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Only breakpoints with the specified action will pass the filter. */ + "action.value"?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee whose breakpoints to list. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * When set to `true`, the response includes the list of breakpoints set by + * any user. Otherwise, it includes only breakpoints set by the caller. + */ + includeAllUsers?: boolean; + /** + * When set to `true`, the response includes active and inactive + * breakpoints. Otherwise, it includes only active breakpoints. + */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * This field is deprecated. The following fields are always stripped out of + * the result: `stack_frames`, `evaluated_expressions` and `variable_table`. + */ + stripResults?: boolean; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * A wait token that, if specified, blocks the call until the breakpoints + * list has changed, or a server selected timeout has expired. The value + * should be set from the last response. The error code + * `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which + * should be called again with the same `wait_token`. + */ + waitToken?: string; + }): Request; + /** Sets the breakpoint to the debuggee. */ + set(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee where the breakpoint is to be set. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DebuggeesResource { + /** Lists all the debuggees that the user has access to. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * When set to `true`, the result includes all debuggees. Otherwise, the + * result includes only debuggees that are active. + */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project number of a Google Cloud project whose debuggees to list. */ + project?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + breakpoints: BreakpointsResource; + } + interface DebuggerResource { + debuggees: DebuggeesResource; + } + } +} diff --git a/types/gapi.client.clouddebugger/readme.md b/types/gapi.client.clouddebugger/readme.md new file mode 100644 index 0000000000..1b61d87192 --- /dev/null +++ b/types/gapi.client.clouddebugger/readme.md @@ -0,0 +1,58 @@ +# TypeScript typings for Stackdriver Debugger API v2 +Examines the call stack and variables of a running application without stopping or slowing it down. + +For detailed description please check [documentation](http://cloud.google.com/debugger). + +## Installing + +Install typings for Stackdriver Debugger API: +``` +npm install @types/gapi.client.clouddebugger@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('clouddebugger', 'v2', () => { + // now we can use gapi.client.clouddebugger + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // Manage cloud debugger + 'https://www.googleapis.com/auth/cloud_debugger', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Stackdriver Debugger API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.clouddebugger/tsconfig.json b/types/gapi.client.clouddebugger/tsconfig.json new file mode 100644 index 0000000000..de9d4c94bc --- /dev/null +++ b/types/gapi.client.clouddebugger/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.clouddebugger-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.clouddebugger/tslint.json b/types/gapi.client.clouddebugger/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.clouddebugger/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.clouderrorreporting/gapi.client.clouderrorreporting-tests.ts b/types/gapi.client.clouderrorreporting/gapi.client.clouderrorreporting-tests.ts new file mode 100644 index 0000000000..7123a90021 --- /dev/null +++ b/types/gapi.client.clouderrorreporting/gapi.client.clouderrorreporting-tests.ts @@ -0,0 +1,36 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('clouderrorreporting', 'v1beta1', () => { + /** now we can use gapi.client.clouderrorreporting */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes all error events of a given project. */ + await gapi.client.projects.deleteEvents({ + projectName: "projectName", + }); + } +}); diff --git a/types/gapi.client.clouderrorreporting/index.d.ts b/types/gapi.client.clouderrorreporting/index.d.ts new file mode 100644 index 0000000000..a19854416f --- /dev/null +++ b/types/gapi.client.clouderrorreporting/index.d.ts @@ -0,0 +1,614 @@ +// Type definitions for Google Stackdriver Error Reporting API v1beta1 1.0 +// Project: https://cloud.google.com/error-reporting/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://clouderrorreporting.googleapis.com/$discovery/rest?version=v1beta1 + +/// + +declare namespace gapi.client { + /** Load Stackdriver Error Reporting API v1beta1 */ + function load(name: "clouderrorreporting", version: "v1beta1"): PromiseLike; + function load(name: "clouderrorreporting", version: "v1beta1", callback: () => any): void; + + const projects: clouderrorreporting.ProjectsResource; + + namespace clouderrorreporting { + interface ErrorContext { + /** + * The HTTP request which was processed when the error was + * triggered. + */ + httpRequest?: HttpRequestContext; + /** + * The location in the source code where the decision was made to + * report the error, usually the place where it was logged. + * For a logged exception this would be the source line where the + * exception is logged, usually close to the place where it was + * caught. + */ + reportLocation?: SourceLocation; + /** + * Source code that was used to build the executable which has + * caused the given error message. + */ + sourceReferences?: SourceReference[]; + /** + * The user who caused or was affected by the crash. + * This can be a user ID, an email address, or an arbitrary token that + * uniquely identifies the user. + * When sending an error report, leave this field empty if the user was not + * logged in. In this case the + * Error Reporting system will use other data, such as remote IP address, to + * distinguish affected users. See `affected_users_count` in + * `ErrorGroupStats`. + */ + user?: string; + } + interface ErrorEvent { + /** Data about the context in which the error occurred. */ + context?: ErrorContext; + /** + * Time when the event occurred as provided in the error report. + * If the report did not contain a timestamp, the time the error was received + * by the Error Reporting system is used. + */ + eventTime?: string; + /** The stack trace that was reported or logged by the service. */ + message?: string; + /** The `ServiceContext` for which this error was reported. */ + serviceContext?: ServiceContext; + } + interface ErrorGroup { + /** + * Group IDs are unique for a given project. If the same kind of error + * occurs in different service contexts, it will receive the same group ID. + */ + groupId?: string; + /** + * The group resource name. + * Example: projects/my-project-123/groups/my-groupid + */ + name?: string; + /** Associated tracking issues. */ + trackingIssues?: TrackingIssue[]; + } + interface ErrorGroupStats { + /** + * Service contexts with a non-zero error count for the given filter + * criteria. This list can be truncated if multiple services are affected. + * Refer to `num_affected_services` for the total count. + */ + affectedServices?: ServiceContext[]; + /** + * Approximate number of affected users in the given group that + * match the filter criteria. + * Users are distinguished by data in the `ErrorContext` of the + * individual error events, such as their login name or their remote + * IP address in case of HTTP requests. + * The number of affected users can be zero even if the number of + * errors is non-zero if no data was provided from which the + * affected user could be deduced. + * Users are counted based on data in the request + * context that was provided in the error report. If more users are + * implicitly affected, such as due to a crash of the whole service, + * this is not reflected here. + */ + affectedUsersCount?: string; + /** + * Approximate total number of events in the given group that match + * the filter criteria. + */ + count?: string; + /** + * Approximate first occurrence that was ever seen for this group + * and which matches the given filter criteria, ignoring the + * time_range that was specified in the request. + */ + firstSeenTime?: string; + /** Group data that is independent of the filter criteria. */ + group?: ErrorGroup; + /** + * Approximate last occurrence that was ever seen for this group and + * which matches the given filter criteria, ignoring the time_range + * that was specified in the request. + */ + lastSeenTime?: string; + /** + * The total number of services with a non-zero error count for the given + * filter criteria. + */ + numAffectedServices?: number; + /** + * An arbitrary event that is chosen as representative for the whole group. + * The representative event is intended to be used as a quick preview for + * the whole group. Events in the group are usually sufficiently similar + * to each other such that showing an arbitrary representative provides + * insight into the characteristics of the group as a whole. + */ + representative?: ErrorEvent; + /** + * Approximate number of occurrences over time. + * Timed counts returned by ListGroups are guaranteed to be: + * + * - Inside the requested time interval + * - Non-overlapping, and + * - Ordered by ascending time. + */ + timedCounts?: TimedCount[]; + } + interface HttpRequestContext { + /** The type of HTTP request, such as `GET`, `POST`, etc. */ + method?: string; + /** The referrer information that is provided with the request. */ + referrer?: string; + /** + * The IP address from which the request originated. + * This can be IPv4, IPv6, or a token which is derived from the + * IP address, depending on the data that has been provided + * in the error report. + */ + remoteIp?: string; + /** The HTTP response status code for the request. */ + responseStatusCode?: number; + /** The URL of the request. */ + url?: string; + /** The user agent information that is provided with the request. */ + userAgent?: string; + } + interface ListEventsResponse { + /** The error events which match the given request. */ + errorEvents?: ErrorEvent[]; + /** + * If non-empty, more results are available. + * Pass this token, along with the same query parameters as the first + * request, to view the next page of results. + */ + nextPageToken?: string; + /** The timestamp specifies the start time to which the request was restricted. */ + timeRangeBegin?: string; + } + interface ListGroupStatsResponse { + /** The error group stats which match the given request. */ + errorGroupStats?: ErrorGroupStats[]; + /** + * If non-empty, more results are available. + * Pass this token, along with the same query parameters as the first + * request, to view the next page of results. + */ + nextPageToken?: string; + /** + * The timestamp specifies the start time to which the request was restricted. + * The start time is set based on the requested time range. It may be adjusted + * to a later time if a project has exceeded the storage quota and older data + * has been deleted. + */ + timeRangeBegin?: string; + } + interface ReportedErrorEvent { + /** [Optional] A description of the context in which the error occurred. */ + context?: ErrorContext; + /** + * [Optional] Time when the event occurred. + * If not provided, the time when the event was received by the + * Error Reporting system will be used. + */ + eventTime?: string; + /** + * [Required] The error message. + * If no `context.reportLocation` is provided, the message must contain a + * header (typically consisting of the exception type name and an error + * message) and an exception stack trace in one of the supported programming + * languages and formats. + * Supported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go. + * Supported stack trace formats are: + * + * * **Java**: Must be the return value of + * [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29). + * * **Python**: Must be the return value of [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc). + * * **JavaScript**: Must be the value of [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) + * as returned by V8. + * * **Ruby**: Must contain frames returned by [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace). + * * **C#**: Must be the return value of [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx). + * * **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)` + * and contain the result of [`(string)$exception`](http://php.net/manual/en/exception.tostring.php). + * * **Go**: Must be the return value of [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack). + */ + message?: string; + /** [Required] The service context in which this error has occurred. */ + serviceContext?: ServiceContext; + } + interface ServiceContext { + /** + * Type of the MonitoredResource. List of possible values: + * https://cloud.google.com/monitoring/api/resources + * + * Value is set automatically for incoming errors and must not be set when + * reporting errors. + */ + resourceType?: string; + /** + * An identifier of the service, such as the name of the + * executable, job, or Google App Engine service name. This field is expected + * to have a low number of values that are relatively stable over time, as + * opposed to `version`, which can be changed whenever new code is deployed. + * + * Contains the service name for error reports extracted from Google + * App Engine logs or `default` if the App Engine default service is used. + */ + service?: string; + /** + * Represents the source code version that the developer provided, + * which could represent a version label or a Git SHA-1 hash, for example. + * For App Engine standard environment, the version is set to the version of + * the app. + */ + version?: string; + } + interface SourceLocation { + /** + * The source code filename, which can include a truncated relative + * path, or a full path from a production machine. + */ + filePath?: string; + /** + * Human-readable name of a function or method. + * The value can include optional context like the class or package name. + * For example, `my.package.MyClass.method` in case of Java. + */ + functionName?: string; + /** 1-based. 0 indicates that the line number is unknown. */ + lineNumber?: number; + } + interface SourceReference { + /** + * Optional. A URI string identifying the repository. + * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" + */ + repository?: string; + /** + * The canonical and persistent identifier of the deployed revision. + * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + */ + revisionId?: string; + } + interface TimedCount { + /** Approximate number of occurrences in the given time period. */ + count?: string; + /** End of the time period to which `count` refers (excluded). */ + endTime?: string; + /** Start of the time period to which `count` refers (included). */ + startTime?: string; + } + interface TrackingIssue { + /** + * A URL pointing to a related entry in an issue tracking system. + * Example: https://github.com/user/project/issues/4 + */ + url?: string; + } + interface EventsResource { + /** Lists the specified events. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] The group for which events shall be returned. */ + groupId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** [Optional] The maximum number of results to return per response. */ + pageSize?: number; + /** [Optional] A `next_page_token` provided by a previous response. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as `projects/` plus the + * [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). + * Example: `projects/my-project-123`. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + */ + "serviceFilter.resourceType"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + */ + "serviceFilter.service"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + */ + "serviceFilter.version"?: string; + /** Restricts the query to the specified time range. */ + "timeRange.period"?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Report an individual error event. + * + * This endpoint accepts either an OAuth token, + * or an + * API key + * for authentication. To use an API key, append it to the URL as the value of + * a `key` parameter. For example: + *
POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
+ */ + report(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as `projects/` plus the + * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). + * Example: `projects/my-project-123`. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface GroupStatsResource { + /** Lists the specified groups. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * [Optional] The alignment of the timed counts to be returned. + * Default is `ALIGNMENT_EQUAL_AT_END`. + */ + alignment?: string; + /** + * [Optional] Time where the timed counts shall be aligned if rounded + * alignment is chosen. Default is 00:00 UTC. + */ + alignmentTime?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Optional] List all ErrorGroupStats with these IDs. */ + groupId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * [Optional] The sort order in which the results are returned. + * Default is `COUNT_DESC`. + */ + order?: string; + /** + * [Optional] The maximum number of results to return per response. + * Default is 20. + */ + pageSize?: number; + /** + * [Optional] A `next_page_token` provided by a previous response. To view + * additional results, pass this token along with the identical query + * parameters as the first request. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as projects/ plus the + * Google Cloud + * Platform project ID. + * + * Example: projects/my-project-123. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + */ + "serviceFilter.resourceType"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + */ + "serviceFilter.service"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + */ + "serviceFilter.version"?: string; + /** Restricts the query to the specified time range. */ + "timeRange.period"?: string; + /** + * [Optional] The preferred duration for a single returned `TimedCount`. + * If not set, no timed counts are returned. + */ + timedCountDuration?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface GroupsResource { + /** Get the specified group. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * [Required] The group resource name. Written as + * projects/projectID/groups/group_name. + * Call + * + * groupStats.list to return a list of groups belonging to + * this project. + * + * Example: projects/my-project-123/groups/my-group + */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Replace the data for the specified group. + * Fails if the group does not exist. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The group resource name. + * Example: projects/my-project-123/groups/my-groupid + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** Deletes all error events of a given project. */ + deleteEvents(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as `projects/` plus the + * [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). + * Example: `projects/my-project-123`. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + events: EventsResource; + groupStats: GroupStatsResource; + groups: GroupsResource; + } + } +} diff --git a/types/gapi.client.clouderrorreporting/readme.md b/types/gapi.client.clouderrorreporting/readme.md new file mode 100644 index 0000000000..aacd09c395 --- /dev/null +++ b/types/gapi.client.clouderrorreporting/readme.md @@ -0,0 +1,60 @@ +# TypeScript typings for Stackdriver Error Reporting API v1beta1 +Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors. + +For detailed description please check [documentation](https://cloud.google.com/error-reporting/). + +## Installing + +Install typings for Stackdriver Error Reporting API: +``` +npm install @types/gapi.client.clouderrorreporting@v1beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('clouderrorreporting', 'v1beta1', () => { + // now we can use gapi.client.clouderrorreporting + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Stackdriver Error Reporting API resources: + +```typescript + +/* +Deletes all error events of a given project. +*/ +await gapi.client.projects.deleteEvents({ projectName: "projectName", }); +``` \ No newline at end of file diff --git a/types/gapi.client.clouderrorreporting/tsconfig.json b/types/gapi.client.clouderrorreporting/tsconfig.json new file mode 100644 index 0000000000..cc1296f8ee --- /dev/null +++ b/types/gapi.client.clouderrorreporting/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.clouderrorreporting-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.clouderrorreporting/tslint.json b/types/gapi.client.clouderrorreporting/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.clouderrorreporting/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudfunctions/gapi.client.cloudfunctions-tests.ts b/types/gapi.client.cloudfunctions/gapi.client.cloudfunctions-tests.ts new file mode 100644 index 0000000000..fe11f8e612 --- /dev/null +++ b/types/gapi.client.cloudfunctions/gapi.client.cloudfunctions-tests.ts @@ -0,0 +1,58 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudfunctions', 'v1', () => { + /** now we can use gapi.client.cloudfunctions */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + await gapi.client.operations.list({ + filter: "filter", + name: "name", + pageSize: 3, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.cloudfunctions/index.d.ts b/types/gapi.client.cloudfunctions/index.d.ts new file mode 100644 index 0000000000..f3cd5cc4a2 --- /dev/null +++ b/types/gapi.client.cloudfunctions/index.d.ts @@ -0,0 +1,249 @@ +// Type definitions for Google Google Cloud Functions API v1 1.0 +// Project: https://cloud.google.com/functions +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudfunctions.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Functions API v1 */ + function load(name: "cloudfunctions", version: "v1"): PromiseLike; + function load(name: "cloudfunctions", version: "v1", callback: () => any): void; + + const operations: cloudfunctions.OperationsResource; + + const projects: cloudfunctions.ProjectsResource; + + namespace cloudfunctions { + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface OperationMetadataV1Beta2 { + /** The original request that started the operation. */ + request?: Record; + /** + * Target of the operation - for example + * projects/project-1/locations/region-1/functions/function-1 + */ + target?: string; + /** Type of operation. */ + type?: string; + /** + * Version id of the function created or updated by an API call. + * This field is only pupulated for Create and Update operations. + */ + versionId?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface LocationsResource { + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudfunctions/readme.md b/types/gapi.client.cloudfunctions/readme.md new file mode 100644 index 0000000000..2d9c14ec33 --- /dev/null +++ b/types/gapi.client.cloudfunctions/readme.md @@ -0,0 +1,75 @@ +# TypeScript typings for Google Cloud Functions API v1 +API for managing lightweight user-provided functions executed in response to events. +For detailed description please check [documentation](https://cloud.google.com/functions). + +## Installing + +Install typings for Google Cloud Functions API: +``` +npm install @types/gapi.client.cloudfunctions@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudfunctions', 'v1', () => { + // now we can use gapi.client.cloudfunctions + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Functions API resources: + +```typescript + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); + +/* +Lists operations that match the specified filter in the request. If the +server doesn't support this method, it returns `UNIMPLEMENTED`. + +NOTE: the `name` binding allows API services to override the binding +to use different resource name schemes, such as `users/*/operations`. To +override the binding, API services can add a binding such as +`"/v1/{name=users/*}/operations"` to their service configuration. +For backwards compatibility, the default name includes the operations +collection id, however overriding users must ensure the name binding +is the parent resource, without the operations collection id. +*/ +await gapi.client.operations.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudfunctions/tsconfig.json b/types/gapi.client.cloudfunctions/tsconfig.json new file mode 100644 index 0000000000..720b272f2e --- /dev/null +++ b/types/gapi.client.cloudfunctions/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudfunctions-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudfunctions/tslint.json b/types/gapi.client.cloudfunctions/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudfunctions/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudiot/gapi.client.cloudiot-tests.ts b/types/gapi.client.cloudiot/gapi.client.cloudiot-tests.ts new file mode 100644 index 0000000000..f9e8f3f18b --- /dev/null +++ b/types/gapi.client.cloudiot/gapi.client.cloudiot-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudiot', 'v1', () => { + /** now we can use gapi.client.cloudiot */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** Register and manage devices in the Google Cloud IoT service */ + 'https://www.googleapis.com/auth/cloudiot', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudiot/index.d.ts b/types/gapi.client.cloudiot/index.d.ts new file mode 100644 index 0000000000..eeb0647503 --- /dev/null +++ b/types/gapi.client.cloudiot/index.d.ts @@ -0,0 +1,1161 @@ +// Type definitions for Google Google Cloud IoT API v1 1.0 +// Project: https://cloud.google.com/iot +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudiot.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud IoT API v1 */ + function load(name: "cloudiot", version: "v1"): PromiseLike; + function load(name: "cloudiot", version: "v1", callback: () => any): void; + + const projects: cloudiot.ProjectsResource; + + namespace cloudiot { + interface AuditConfig { + /** + * The configuration for logging of each type of permission. + * Next ID: 4 + */ + auditLogConfigs?: AuditLogConfig[]; + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of Binding.members. + */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface Binding { + /** + * The condition that is associated with this binding. + * NOTE: an unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * This field is GOOGLE_INTERNAL. + */ + condition?: Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface Device { + /** + * If a device is blocked, connections or requests from this device will fail. + * Can be used to temporarily prevent the device from connecting if, for + * example, the sensor is generating bad data and needs maintenance. + */ + blocked?: boolean; + /** + * The most recent device configuration, which is eventually sent from + * Cloud IoT Core to the device. If not present on creation, the + * configuration will be initialized with an empty payload and version value + * of `1`. To update this field after creation, use the + * `DeviceManager.ModifyCloudToDeviceConfig` method. + */ + config?: DeviceConfig; + /** + * The credentials used to authenticate this device. To allow credential + * rotation without interruption, multiple device credentials can be bound to + * this device. No more than 3 credentials can be bound to a single device at + * a time. When new credentials are added to a device, they are verified + * against the registry credentials. For details, see the description of the + * `DeviceRegistry.credentials` field. + */ + credentials?: DeviceCredential[]; + /** + * The user-defined device identifier. The device ID must be unique + * within a device registry. + */ + id?: string; + /** + * [Output only] The last time a cloud-to-device config version acknowledgment + * was received from the device. This field is only for configurations + * sent through MQTT. + */ + lastConfigAckTime?: string; + /** + * [Output only] The last time a cloud-to-device config version was sent to + * the device. + */ + lastConfigSendTime?: string; + /** + * [Output only] The error message of the most recent error, such as a failure + * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this + * field. If no errors have occurred, this field has an empty message + * and the status code 0 == OK. Otherwise, this field is expected to have a + * status code other than OK. + */ + lastErrorStatus?: Status; + /** + * [Output only] The time the most recent error occurred, such as a failure to + * publish to Cloud Pub/Sub. This field is the timestamp of + * 'last_error_status'. + */ + lastErrorTime?: string; + /** + * [Output only] The last time a telemetry event was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. + */ + lastEventTime?: string; + /** + * [Output only] The last time a heartbeat was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. This field is only for devices connecting through MQTT. + */ + lastHeartbeatTime?: string; + /** + * [Output only] The last time a state event was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. + */ + lastStateTime?: string; + /** + * The metadata key-value pairs assigned to the device. This metadata is not + * interpreted or indexed by Cloud IoT Core. It can be used to add contextual + * information for the device. + * + * Keys must conform to the regular expression [a-zA-Z0-9-_]+ and be less than + * 128 bytes in length. + * + * Values are free-form strings. Each value must be less than or equal to 32 + * KB in size. + * + * The total size of all keys and values must be less than 256 KB, and the + * maximum number of key-value pairs is 500. + */ + metadata?: Record; + /** + * The resource path name. For example, + * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + * When `name` is populated as a response from the service, it always ends + * in the device numeric ID. + */ + name?: string; + /** + * [Output only] A server-defined unique numeric ID for the device. This is a + * more compact way to identify devices, and it is globally unique. + */ + numId?: string; + /** + * [Output only] The state most recently received from the device. If no state + * has been reported, this field is not present. + */ + state?: DeviceState; + } + interface DeviceConfig { + /** The device configuration data. */ + binaryData?: string; + /** + * [Output only] The time at which this configuration version was updated in + * Cloud IoT Core. This timestamp is set by the server. + */ + cloudUpdateTime?: string; + /** + * [Output only] The time at which Cloud IoT Core received the + * acknowledgment from the device, indicating that the device has received + * this configuration version. If this field is not present, the device has + * not yet acknowledged that it received this version. Note that when + * the config was sent to the device, many config versions may have been + * available in Cloud IoT Core while the device was disconnected, and on + * connection, only the latest version is sent to the device. Some + * versions may never be sent to the device, and therefore are never + * acknowledged. This timestamp is set by Cloud IoT Core. + */ + deviceAckTime?: string; + /** + * [Output only] The version of this update. The version number is assigned by + * the server, and is always greater than 0 after device creation. The + * version must be 0 on the `CreateDevice` request if a `config` is + * specified; the response of `CreateDevice` will always have a value of 1. + */ + version?: string; + } + interface DeviceCredential { + /** + * [Optional] The time at which this credential becomes invalid. This + * credential will be ignored for new client authentication requests after + * this timestamp; however, it will not be automatically deleted. + */ + expirationTime?: string; + /** + * A public key used to verify the signature of JSON Web Tokens (JWTs). + * When adding a new device credential, either via device creation or via + * modifications, this public key credential may be required to be signed by + * one of the registry level certificates. More specifically, if the + * registry contains at least one certificate, any new device credential + * must be signed by one of the registry certificates. As a result, + * when the registry contains certificates, only X.509 certificates are + * accepted as device credentials. However, if the registry does + * not contain a certificate, self-signed certificates and public keys will + * be accepted. New device credentials must be different from every + * registry-level certificate. + */ + publicKey?: PublicKeyCredential; + } + interface DeviceRegistry { + /** + * The credentials used to verify the device credentials. No more than 10 + * credentials can be bound to a single registry at a time. The verification + * process occurs at the time of device creation or update. If this field is + * empty, no verification is performed. Otherwise, the credentials of a newly + * created device or added credentials of an updated device should be signed + * with one of these registry credentials. + * + * Note, however, that existing devices will never be affected by + * modifications to this list of credentials: after a device has been + * successfully created in a registry, it should be able to connect even if + * its registry credentials are revoked, deleted, or modified. + */ + credentials?: RegistryCredential[]; + /** + * The configuration for notification of telemetry events received from the + * device. All telemetry events that were successfully published by the + * device and acknowledged by Cloud IoT Core are guaranteed to be + * delivered to Cloud Pub/Sub. Only the first configuration is used. + */ + eventNotificationConfigs?: EventNotificationConfig[]; + /** The DeviceService (HTTP) configuration for this device registry. */ + httpConfig?: HttpConfig; + /** The identifier of this device registry. For example, `myRegistry`. */ + id?: string; + /** The MQTT configuration for this device registry. */ + mqttConfig?: MqttConfig; + /** + * The resource path name. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name?: string; + /** + * The configuration for notification of new states received from the device. + * State updates are guaranteed to be stored in the state history, but + * notifications to Cloud Pub/Sub are not guaranteed. For example, if + * permissions are misconfigured or the specified topic doesn't exist, no + * notification will be published but the state will still be stored in Cloud + * IoT Core. + */ + stateNotificationConfig?: StateNotificationConfig; + } + interface DeviceState { + /** The device state data. */ + binaryData?: string; + /** + * [Output only] The time at which this state version was updated in Cloud + * IoT Core. + */ + updateTime?: string; + } + interface EventNotificationConfig { + /** + * A Cloud Pub/Sub topic name. For example, + * `projects/myProject/topics/deviceEvents`. + */ + pubsubTopicName?: string; + } + interface Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description?: string; + /** + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + */ + expression?: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location?: string; + /** + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title?: string; + } + interface HttpConfig { + /** + * If enabled, allows devices to use DeviceService via the HTTP protocol. + * Otherwise, any requests to DeviceService will fail for this registry. + */ + httpEnabledState?: string; + } + interface ListDeviceConfigVersionsResponse { + /** + * The device configuration for the last few versions. Versions are listed + * in decreasing order, starting from the most recent one. + */ + deviceConfigs?: DeviceConfig[]; + } + interface ListDeviceRegistriesResponse { + /** The registries that matched the query. */ + deviceRegistries?: DeviceRegistry[]; + /** + * If not empty, indicates that there may be more registries that match the + * request; this value should be passed in a new + * `ListDeviceRegistriesRequest`. + */ + nextPageToken?: string; + } + interface ListDeviceStatesResponse { + /** + * The last few device states. States are listed in descending order of server + * update time, starting from the most recent one. + */ + deviceStates?: DeviceState[]; + } + interface ListDevicesResponse { + /** The devices that match the request. */ + devices?: Device[]; + /** + * If not empty, indicates that there may be more devices that match the + * request; this value should be passed in a new `ListDevicesRequest`. + */ + nextPageToken?: string; + } + interface ModifyCloudToDeviceConfigRequest { + /** The configuration data for the device. */ + binaryData?: string; + /** + * The version number to update. If this value is zero, it will not check the + * version number of the server and will always update the current version; + * otherwise, this update will fail if the version number found on the server + * does not match this version number. This is used to support multiple + * simultaneous updates without losing data. + */ + versionToUpdate?: string; + } + interface MqttConfig { + /** + * If enabled, allows connections using the MQTT protocol. Otherwise, MQTT + * connections to this registry will fail. + */ + mqttEnabledState?: string; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface PublicKeyCertificate { + /** The certificate data. */ + certificate?: string; + /** The certificate format. */ + format?: string; + /** [Output only] The certificate details. Used only for X.509 certificates. */ + x509Details?: X509CertificateDetails; + } + interface PublicKeyCredential { + /** The format of the key. */ + format?: string; + /** The key data. */ + key?: string; + } + interface RegistryCredential { + /** A public key certificate used to verify the device credentials. */ + publicKeyCertificate?: PublicKeyCertificate; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * paths: "bindings, etag" + * This field is only used by Cloud IAM. + */ + updateMask?: string; + } + interface StateNotificationConfig { + /** + * A Cloud Pub/Sub topic name. For example, + * `projects/myProject/topics/deviceEvents`. + */ + pubsubTopicName?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface X509CertificateDetails { + /** The time the certificate becomes invalid. */ + expiryTime?: string; + /** The entity that signed the certificate. */ + issuer?: string; + /** The type of public key in the certificate. */ + publicKeyType?: string; + /** The algorithm used to sign the certificate. */ + signatureAlgorithm?: string; + /** The time the certificate becomes valid. */ + startTime?: string; + /** The entity the certificate and public key belong to. */ + subject?: string; + } + interface ConfigVersionsResource { + /** + * Lists the last few versions of the device configuration in descending + * order (i.e.: newest first). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** + * The number of versions to list. Versions are listed in decreasing order of + * the version number. The maximum number of versions retained is 10. If this + * value is zero, it will return all the versions available. + */ + numVersions?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface StatesResource { + /** + * Lists the last few versions of the device state in descending order (i.e.: + * newest first). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** + * The number of states to list. States are listed in descending order of + * update time. The maximum number of states retained is 10. If this + * value is zero, it will return all the states available. + */ + numStates?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DevicesResource { + /** Creates a device in a device registry. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The name of the device registry where this device should be created. + * For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a device. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets details about a device. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** List devices in a device registry. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * A list of device string identifiers. If empty, it will ignore this field. + * For example, `['device0', 'device12']`. This field cannot hold more than + * 10,000 entries. + */ + deviceIds?: string; + /** + * A list of device numerical ids. If empty, it will ignore this field. This + * field cannot hold more than 10,000 entries. + */ + deviceNumIds?: string; + /** + * The fields of the `Device` resource to be returned in the response. The + * fields `id`, and `num_id` are always returned by default, along with any + * other fields specified. + */ + fieldMask?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of devices to return in the response. If this value + * is zero, the service will select a default size. A call may return fewer + * objects than requested, but if there is a non-empty `page_token`, it + * indicates that more entries are available. + */ + pageSize?: number; + /** + * The value returned by the last `ListDevicesResponse`; indicates + * that this is a continuation of a prior `ListDevices` call, and + * that the system should return the next page of data. + */ + pageToken?: string; + /** + * The device registry path. Required. For example, + * `projects/my-project/locations/us-central1/registries/my-registry`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies the configuration for the device, which is eventually sent from + * the Cloud IoT Core servers. Returns the modified configuration version and + * its metadata. + */ + modifyCloudToDeviceConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a device. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource path name. For example, + * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + * When `name` is populated as a response from the service, it always ends + * in the device numeric ID. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Only updates the `device` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * Mutable top-level fields: `credentials`, `enabled_state`, and `metadata` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + configVersions: ConfigVersionsResource; + states: StatesResource; + } + interface RegistriesResource { + /** Creates a device registry that contains devices. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The project and cloud region where this device registry must be created. + * For example, `projects/example-project/locations/us-central1`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a device registry configuration. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device registry. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a device registry configuration. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device registry. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists device registries. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of registries to return in the response. If this value + * is zero, the service will select a default size. A call may return fewer + * objects than requested, but if there is a non-empty `page_token`, it + * indicates that more entries are available. + */ + pageSize?: number; + /** + * The value returned by the last `ListDeviceRegistriesResponse`; indicates + * that this is a continuation of a prior `ListDeviceRegistries` call, and + * that the system should return the next page of data. + */ + pageToken?: string; + /** + * The project and cloud region path. For example, + * `projects/example-project/locations/us-central1`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a device registry configuration. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource path name. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Only updates the `device_registry` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * Mutable top-level fields: `event_notification_config`, `mqtt_config`, and + * `state_notification_config`. + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + devices: DevicesResource; + } + interface LocationsResource { + registries: RegistriesResource; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudiot/readme.md b/types/gapi.client.cloudiot/readme.md new file mode 100644 index 0000000000..290068ffb7 --- /dev/null +++ b/types/gapi.client.cloudiot/readme.md @@ -0,0 +1,58 @@ +# TypeScript typings for Google Cloud IoT API v1 +Registers and manages IoT (Internet of Things) devices that connect to the Google Cloud Platform. + +For detailed description please check [documentation](https://cloud.google.com/iot). + +## Installing + +Install typings for Google Cloud IoT API: +``` +npm install @types/gapi.client.cloudiot@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudiot', 'v1', () => { + // now we can use gapi.client.cloudiot + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // Register and manage devices in the Google Cloud IoT service + 'https://www.googleapis.com/auth/cloudiot', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud IoT API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudiot/tsconfig.json b/types/gapi.client.cloudiot/tsconfig.json new file mode 100644 index 0000000000..03ed93c76d --- /dev/null +++ b/types/gapi.client.cloudiot/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudiot-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudiot/tslint.json b/types/gapi.client.cloudiot/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudiot/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudkms/gapi.client.cloudkms-tests.ts b/types/gapi.client.cloudkms/gapi.client.cloudkms-tests.ts new file mode 100644 index 0000000000..07eeeeb5d7 --- /dev/null +++ b/types/gapi.client.cloudkms/gapi.client.cloudkms-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudkms', 'v1', () => { + /** now we can use gapi.client.cloudkms */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudkms/index.d.ts b/types/gapi.client.cloudkms/index.d.ts new file mode 100644 index 0000000000..82f44805fd --- /dev/null +++ b/types/gapi.client.cloudkms/index.d.ts @@ -0,0 +1,1285 @@ +// Type definitions for Google Google Cloud Key Management Service (KMS) API v1 1.0 +// Project: https://cloud.google.com/kms/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudkms.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Key Management Service (KMS) API v1 */ + function load(name: "cloudkms", version: "v1"): PromiseLike; + function load(name: "cloudkms", version: "v1", callback: () => any): void; + + const projects: cloudkms.ProjectsResource; + + namespace cloudkms { + interface AuditConfig { + /** + * The configuration for logging of each type of permission. + * Next ID: 4 + */ + auditLogConfigs?: AuditLogConfig[]; + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of Binding.members. + */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface Binding { + /** + * The condition that is associated with this binding. + * NOTE: an unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * This field is GOOGLE_INTERNAL. + */ + condition?: Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface CryptoKey { + /** Output only. The time at which this CryptoKey was created. */ + createTime?: string; + /** Labels with user defined metadata. */ + labels?: Record; + /** + * Output only. The resource name for this CryptoKey in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + */ + name?: string; + /** + * At next_rotation_time, the Key Management Service will automatically: + * + * 1. Create a new version of this CryptoKey. + * 2. Mark the new version as primary. + * + * Key rotations performed manually via + * CreateCryptoKeyVersion and + * UpdateCryptoKeyPrimaryVersion + * do not affect next_rotation_time. + */ + nextRotationTime?: string; + /** + * Output only. A copy of the "primary" CryptoKeyVersion that will be used + * by Encrypt when this CryptoKey is given + * in EncryptRequest.name. + * + * The CryptoKey's primary version can be updated via + * UpdateCryptoKeyPrimaryVersion. + */ + primary?: CryptoKeyVersion; + /** + * The immutable purpose of this CryptoKey. Currently, the only acceptable + * purpose is ENCRYPT_DECRYPT. + */ + purpose?: string; + /** + * next_rotation_time will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * + * If rotation_period is set, next_rotation_time must also be set. + */ + rotationPeriod?: string; + } + interface CryptoKeyVersion { + /** Output only. The time at which this CryptoKeyVersion was created. */ + createTime?: string; + /** + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if state is + * DESTROYED. + */ + destroyEventTime?: string; + /** + * Output only. The time this CryptoKeyVersion's key material is scheduled + * for destruction. Only present if state is + * DESTROY_SCHEDULED. + */ + destroyTime?: string; + /** + * Output only. The resource name for this CryptoKeyVersion in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + */ + name?: string; + /** The current state of the CryptoKeyVersion. */ + state?: string; + } + interface DecryptRequest { + /** + * Optional data that must match the data originally supplied in + * EncryptRequest.additional_authenticated_data. + */ + additionalAuthenticatedData?: string; + /** + * Required. The encrypted data originally returned in + * EncryptResponse.ciphertext. + */ + ciphertext?: string; + } + interface DecryptResponse { + /** The decrypted data originally supplied in EncryptRequest.plaintext. */ + plaintext?: string; + } + interface EncryptRequest { + /** + * Optional data that, if specified, must also be provided during decryption + * through DecryptRequest.additional_authenticated_data. Must be no + * larger than 64KiB. + */ + additionalAuthenticatedData?: string; + /** Required. The data to encrypt. Must be no larger than 64KiB. */ + plaintext?: string; + } + interface EncryptResponse { + /** The encrypted data. */ + ciphertext?: string; + /** The resource name of the CryptoKeyVersion used in encryption. */ + name?: string; + } + interface Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description?: string; + /** + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + */ + expression?: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location?: string; + /** + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title?: string; + } + interface KeyRing { + /** Output only. The time at which this KeyRing was created. */ + createTime?: string; + /** + * Output only. The resource name for the KeyRing in the format + * `projects/*/locations/*/keyRings/*`. + */ + name?: string; + } + interface ListCryptoKeyVersionsResponse { + /** The list of CryptoKeyVersions. */ + cryptoKeyVersions?: CryptoKeyVersion[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListCryptoKeyVersionsRequest.page_token to retrieve the next page of + * results. + */ + nextPageToken?: string; + /** + * The total number of CryptoKeyVersions that matched the + * query. + */ + totalSize?: number; + } + interface ListCryptoKeysResponse { + /** The list of CryptoKeys. */ + cryptoKeys?: CryptoKey[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListCryptoKeysRequest.page_token to retrieve the next page of results. + */ + nextPageToken?: string; + /** The total number of CryptoKeys that matched the query. */ + totalSize?: number; + } + interface ListKeyRingsResponse { + /** The list of KeyRings. */ + keyRings?: KeyRing[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListKeyRingsRequest.page_token to retrieve the next page of results. + */ + nextPageToken?: string; + /** The total number of KeyRings that matched the query. */ + totalSize?: number; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * paths: "bindings, etag" + * This field is only used by Cloud IAM. + */ + updateMask?: string; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface UpdateCryptoKeyPrimaryVersionRequest { + /** The id of the child CryptoKeyVersion to use as primary. */ + cryptoKeyVersionId?: string; + } + interface CryptoKeyVersionsResource { + /** + * Create a new CryptoKeyVersion in a CryptoKey. + * + * The server will assign the next sequential id. If unset, + * state will be set to + * ENABLED. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The name of the CryptoKey associated with + * the CryptoKeyVersions. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Schedule a CryptoKeyVersion for destruction. + * + * Upon calling this method, CryptoKeyVersion.state will be set to + * DESTROY_SCHEDULED + * and destroy_time will be set to a time 24 + * hours in the future, at which point the state + * will be changed to + * DESTROYED, and the key + * material will be irrevocably destroyed. + * + * Before the destroy_time is reached, + * RestoreCryptoKeyVersion may be called to reverse the process. + */ + destroy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the CryptoKeyVersion to destroy. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns metadata for a given CryptoKeyVersion. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the CryptoKeyVersion to get. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists CryptoKeyVersions. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional limit on the number of CryptoKeyVersions to + * include in the response. Further CryptoKeyVersions can + * subsequently be obtained by including the + * ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional pagination token, returned earlier via + * ListCryptoKeyVersionsResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the CryptoKey to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Update a CryptoKeyVersion's metadata. + * + * state may be changed between + * ENABLED and + * DISABLED using this + * method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to + * move between other states. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Output only. The resource name for this CryptoKeyVersion in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Restore a CryptoKeyVersion in the + * DESTROY_SCHEDULED, + * state. + * + * Upon restoration of the CryptoKeyVersion, state + * will be set to DISABLED, + * and destroy_time will be cleared. + */ + restore(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the CryptoKeyVersion to restore. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CryptoKeysResource { + /** + * Create a new CryptoKey within a KeyRing. + * + * CryptoKey.purpose is required. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + cryptoKeyId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The name of the KeyRing associated with the + * CryptoKeys. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Decrypts data that was protected by Encrypt. */ + decrypt(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. The resource name of the CryptoKey to use for decryption. + * The server will choose the appropriate version. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Encrypts data, so that it can only be recovered by a call to Decrypt. */ + encrypt(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. The resource name of the CryptoKey or CryptoKeyVersion + * to use for encryption. + * + * If a CryptoKey is specified, the server will use its + * primary version. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns metadata for a given CryptoKey, as well as its + * primary CryptoKeyVersion. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the CryptoKey to get. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists CryptoKeys. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional limit on the number of CryptoKeys to include in the + * response. Further CryptoKeys can subsequently be obtained by + * including the ListCryptoKeysResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional pagination token, returned earlier via + * ListCryptoKeysResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the KeyRing to list, in the format + * `projects/*/locations/*/keyRings/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Update a CryptoKey. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Output only. The resource name for this CryptoKey in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Update the version of a CryptoKey that will be used in Encrypt */ + updatePrimaryVersion(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the CryptoKey to update. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + cryptoKeyVersions: CryptoKeyVersionsResource; + } + interface KeyRingsResource { + /** Create a new KeyRing in a given Project and Location. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + keyRingId?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The resource name of the location associated with the + * KeyRings, in the format `projects/*/locations/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns metadata for a given KeyRing. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the KeyRing to get. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists KeyRings. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional limit on the number of KeyRings to include in the + * response. Further KeyRings can subsequently be obtained by + * including the ListKeyRingsResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional pagination token, returned earlier via + * ListKeyRingsResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the location associated with the + * KeyRings, in the format `projects/*/locations/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + cryptoKeys: CryptoKeysResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name for the location. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + keyRings: KeyRingsResource; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudkms/readme.md b/types/gapi.client.cloudkms/readme.md new file mode 100644 index 0000000000..23c623c02d --- /dev/null +++ b/types/gapi.client.cloudkms/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Google Cloud Key Management Service (KMS) API v1 +Manages encryption for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256 encryption keys. +For detailed description please check [documentation](https://cloud.google.com/kms/). + +## Installing + +Install typings for Google Cloud Key Management Service (KMS) API: +``` +npm install @types/gapi.client.cloudkms@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudkms', 'v1', () => { + // now we can use gapi.client.cloudkms + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Key Management Service (KMS) API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudkms/tsconfig.json b/types/gapi.client.cloudkms/tsconfig.json new file mode 100644 index 0000000000..ff982b97d1 --- /dev/null +++ b/types/gapi.client.cloudkms/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudkms-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudkms/tslint.json b/types/gapi.client.cloudkms/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudkms/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudmonitoring/gapi.client.cloudmonitoring-tests.ts b/types/gapi.client.cloudmonitoring/gapi.client.cloudmonitoring-tests.ts new file mode 100644 index 0000000000..c14ba534aa --- /dev/null +++ b/types/gapi.client.cloudmonitoring/gapi.client.cloudmonitoring-tests.ts @@ -0,0 +1,97 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudmonitoring', 'v2beta2', () => { + /** now we can use gapi.client.cloudmonitoring */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and write monitoring data for all of your Google and third-party Cloud and API projects */ + 'https://www.googleapis.com/auth/monitoring', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Create a new metric. */ + await gapi.client.metricDescriptors.create({ + project: "project", + }); + /** Delete an existing metric. */ + await gapi.client.metricDescriptors.delete({ + metric: "metric", + project: "project", + }); + /** + * List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be + * paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + await gapi.client.metricDescriptors.list({ + count: 1, + pageToken: "pageToken", + project: "project", + query: "query", + }); + /** + * List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + await gapi.client.timeseries.list({ + aggregator: "aggregator", + count: 2, + labels: "labels", + metric: "metric", + oldest: "oldest", + pageToken: "pageToken", + project: "project", + timespan: "timespan", + window: "window", + youngest: "youngest", + }); + /** + * Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not + * allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing + * youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially + * in the order of their end time. + */ + await gapi.client.timeseries.write({ + project: "project", + }); + /** + * List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + await gapi.client.timeseriesDescriptors.list({ + aggregator: "aggregator", + count: 2, + labels: "labels", + metric: "metric", + oldest: "oldest", + pageToken: "pageToken", + project: "project", + timespan: "timespan", + window: "window", + youngest: "youngest", + }); + } +}); diff --git a/types/gapi.client.cloudmonitoring/index.d.ts b/types/gapi.client.cloudmonitoring/index.d.ts new file mode 100644 index 0000000000..6febf1d4e8 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/index.d.ts @@ -0,0 +1,476 @@ +// Type definitions for Google Cloud Monitoring API v2beta2 2.0 +// Project: https://cloud.google.com/monitoring/v2beta2/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/cloudmonitoring/v2beta2/rest + +/// + +declare namespace gapi.client { + /** Load Cloud Monitoring API v2beta2 */ + function load(name: "cloudmonitoring", version: "v2beta2"): PromiseLike; + function load(name: "cloudmonitoring", version: "v2beta2", callback: () => any): void; + + const metricDescriptors: cloudmonitoring.MetricDescriptorsResource; + + const timeseries: cloudmonitoring.TimeseriesResource; + + const timeseriesDescriptors: cloudmonitoring.TimeseriesDescriptorsResource; + + namespace cloudmonitoring { + interface DeleteMetricDescriptorResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#deleteMetricDescriptorResponse". */ + kind?: string; + } + interface ListMetricDescriptorsRequest { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsRequest". */ + kind?: string; + } + interface ListMetricDescriptorsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsResponse". */ + kind?: string; + /** The returned metric descriptors. */ + metrics?: MetricDescriptor[]; + /** + * Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, pass this + * value to the pageToken query parameter. + */ + nextPageToken?: string; + } + interface ListTimeseriesDescriptorsRequest { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsRequest". */ + kind?: string; + } + interface ListTimeseriesDescriptorsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsResponse". */ + kind?: string; + /** + * Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this + * value to the pageToken query parameter. + */ + nextPageToken?: string; + /** The oldest timestamp of the interval of this query, as an RFC 3339 string. */ + oldest?: string; + /** The returned time series descriptors. */ + timeseries?: TimeseriesDescriptor[]; + /** The youngest timestamp of the interval of this query, as an RFC 3339 string. */ + youngest?: string; + } + interface ListTimeseriesRequest { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesRequest". */ + kind?: string; + } + interface ListTimeseriesResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesResponse". */ + kind?: string; + /** + * Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the + * pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series. + */ + nextPageToken?: string; + /** The oldest timestamp of the interval of this query as an RFC 3339 string. */ + oldest?: string; + /** The returned time series. */ + timeseries?: Timeseries[]; + /** The youngest timestamp of the interval of this query as an RFC 3339 string. */ + youngest?: string; + } + interface MetricDescriptor { + /** Description of this metric. */ + description?: string; + /** Labels defined for this metric. */ + labels?: MetricDescriptorLabelDescriptor[]; + /** The name of this metric. */ + name?: string; + /** The project ID to which the metric belongs. */ + project?: string; + /** Type description for this metric. */ + typeDescriptor?: MetricDescriptorTypeDescriptor; + } + interface MetricDescriptorLabelDescriptor { + /** Label description. */ + description?: string; + /** Label key. */ + key?: string; + } + interface MetricDescriptorTypeDescriptor { + /** The method of collecting data for the metric. See Metric types. */ + metricType?: string; + /** The data type of of individual points in the metric's time series. See Metric value types. */ + valueType?: string; + } + interface Point { + /** The value of this data point. Either "true" or "false". */ + boolValue?: boolean; + /** + * The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The + * values of these points can be used to create a histogram. + */ + distributionValue?: PointDistribution; + /** The value of this data point as a double-precision floating-point number. */ + doubleValue?: number; + /** + * The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this + * interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be + * non-empty. Both start and end are RFC 3339 strings. + */ + end?: string; + /** The value of this data point as a 64-bit integer. */ + int64Value?: string; + /** + * The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this + * interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be + * non-empty. Both start and end are RFC 3339 strings. + */ + start?: string; + /** The value of this data point in string format. */ + stringValue?: string; + } + interface PointDistribution { + /** The finite buckets. */ + buckets?: PointDistributionBucket[]; + /** The overflow bucket. */ + overflowBucket?: PointDistributionOverflowBucket; + /** The underflow bucket. */ + underflowBucket?: PointDistributionUnderflowBucket; + } + interface PointDistributionBucket { + /** The number of events whose values are in the interval defined by this bucket. */ + count?: string; + /** The lower bound of the value interval of this bucket (inclusive). */ + lowerBound?: number; + /** The upper bound of the value interval of this bucket (exclusive). */ + upperBound?: number; + } + interface PointDistributionOverflowBucket { + /** The number of events whose values are in the interval defined by this bucket. */ + count?: string; + /** The lower bound of the value interval of this bucket (inclusive). */ + lowerBound?: number; + } + interface PointDistributionUnderflowBucket { + /** The number of events whose values are in the interval defined by this bucket. */ + count?: string; + /** The upper bound of the value interval of this bucket (exclusive). */ + upperBound?: number; + } + interface Timeseries { + /** The data points of this time series. The points are listed in order of their end timestamp, from younger to older. */ + points?: Point[]; + /** The descriptor of this time series. */ + timeseriesDesc?: TimeseriesDescriptor; + } + interface TimeseriesDescriptor { + /** The label's name. */ + labels?: Record; + /** The name of the metric. */ + metric?: string; + /** The Developers Console project number to which this time series belongs. */ + project?: string; + } + interface TimeseriesDescriptorLabel { + /** The label's name. */ + key?: string; + /** The label's value. */ + value?: string; + } + interface TimeseriesPoint { + /** The data point in this time series snapshot. */ + point?: Point; + /** The descriptor of this time series. */ + timeseriesDesc?: TimeseriesDescriptor; + } + interface WriteTimeseriesRequest { + /** The label's name. */ + commonLabels?: Record; + /** + * Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete + * list of labels that required by the metric. + */ + timeseries?: TimeseriesPoint[]; + } + interface WriteTimeseriesResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#writeTimeseriesResponse". */ + kind?: string; + } + interface MetricDescriptorsResource { + /** Create a new metric. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete an existing metric. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the metric. */ + metric: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID to which the metric belongs. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be + * paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of + * results. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * The query used to search against existing metrics. Separate keywords with a space; the service joins all keywords with AND, meaning that all keywords + * must match for a metric to be returned. If this field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics + * are returned. + */ + query?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TimeseriesResource { + /** + * List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + list(request: { + /** + * The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics + * with a value type of INT64 or DOUBLE. + */ + aggregator?: string; + /** Data format for the response. */ + alt?: string; + /** Maximum number of data points per page, which is used for pagination of results. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A collection of labels for the matching time series, which are represented as: + * - key==value: key equals the value + * - key=~value: key regex matches the value + * - key!=value: key does not equal the value + * - key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could + * specify: + * label=cloud.googleapis.com%2Flocation=~us-central1.* + */ + labels?: string; + /** Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count. */ + metric: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time + * interval will be (youngest - 4 hours, youngest] + */ + oldest?: string; + /** + * The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of + * results. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest + * parameters should not be used together. Units: + * - s: second + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + * + * If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]. + */ + timespan?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for + * non-cumulative metric types. Units: + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + */ + window?: string; + /** End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp. */ + youngest: string; + }): Request; + /** + * Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not + * allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing + * youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially + * in the order of their end time. + */ + write(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TimeseriesDescriptorsResource { + /** + * List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + list(request: { + /** + * The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics + * with a value type of INT64 or DOUBLE. + */ + aggregator?: string; + /** Data format for the response. */ + alt?: string; + /** Maximum number of time series descriptors per page. Used for pagination. If not specified, count = 100. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A collection of labels for the matching time series, which are represented as: + * - key==value: key equals the value + * - key=~value: key regex matches the value + * - key!=value: key does not equal the value + * - key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could + * specify: + * label=cloud.googleapis.com%2Flocation=~us-central1.* + */ + labels?: string; + /** Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count. */ + metric: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time + * interval will be (youngest - 4 hours, youngest] + */ + oldest?: string; + /** + * The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of + * results. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest + * parameters should not be used together. Units: + * - s: second + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + * + * If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]. + */ + timespan?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for + * non-cumulative metric types. Units: + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + */ + window?: string; + /** End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp. */ + youngest: string; + }): Request; + } + } +} diff --git a/types/gapi.client.cloudmonitoring/readme.md b/types/gapi.client.cloudmonitoring/readme.md new file mode 100644 index 0000000000..44ce6fbfc0 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/readme.md @@ -0,0 +1,87 @@ +# TypeScript typings for Cloud Monitoring API v2beta2 +Accesses Google Cloud Monitoring data. +For detailed description please check [documentation](https://cloud.google.com/monitoring/v2beta2/). + +## Installing + +Install typings for Cloud Monitoring API: +``` +npm install @types/gapi.client.cloudmonitoring@v2beta2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudmonitoring', 'v2beta2', () => { + // now we can use gapi.client.cloudmonitoring + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and write monitoring data for all of your Google and third-party Cloud and API projects + 'https://www.googleapis.com/auth/monitoring', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Cloud Monitoring API resources: + +```typescript + +/* +Create a new metric. +*/ +await gapi.client.metricDescriptors.create({ project: "project", }); + +/* +Delete an existing metric. +*/ +await gapi.client.metricDescriptors.delete({ metric: "metric", project: "project", }); + +/* +List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. +*/ +await gapi.client.metricDescriptors.list({ project: "project", }); + +/* +List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. +*/ +await gapi.client.timeseries.list({ metric: "metric", project: "project", youngest: "youngest", }); + +/* +Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time. +*/ +await gapi.client.timeseries.write({ project: "project", }); + +/* +List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. +*/ +await gapi.client.timeseriesDescriptors.list({ metric: "metric", project: "project", youngest: "youngest", }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudmonitoring/tsconfig.json b/types/gapi.client.cloudmonitoring/tsconfig.json new file mode 100644 index 0000000000..e007418ca9 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudmonitoring-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudmonitoring/tslint.json b/types/gapi.client.cloudmonitoring/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudresourcemanager/gapi.client.cloudresourcemanager-tests.ts b/types/gapi.client.cloudresourcemanager/gapi.client.cloudresourcemanager-tests.ts new file mode 100644 index 0000000000..4bb0eafbfc --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/gapi.client.cloudresourcemanager-tests.ts @@ -0,0 +1,404 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudresourcemanager', 'v1', () => { + /** now we can use gapi.client.cloudresourcemanager */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Clears a `Policy` from a resource. */ + await gapi.client.folders.clearOrgPolicy({ + resource: "resource", + }); + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + await gapi.client.folders.getEffectiveOrgPolicy({ + resource: "resource", + }); + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + await gapi.client.folders.getOrgPolicy({ + resource: "resource", + }); + /** Lists `Constraints` that could be applied on the specified resource. */ + await gapi.client.folders.listAvailableOrgPolicyConstraints({ + resource: "resource", + }); + /** Lists all the `Policies` set for a particular resource. */ + await gapi.client.folders.listOrgPolicies({ + resource: "resource", + }); + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + await gapi.client.folders.setOrgPolicy({ + resource: "resource", + }); + /** + * Create a Lien which applies to the resource denoted by the `parent` field. + * + * Callers of this method will require permission on the `parent` resource. + * For example, applying to `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + * + * NOTE: Some resources may limit the number of Liens which may be applied. + */ + await gapi.client.liens.create({ + }); + /** + * Delete a Lien by `name`. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + */ + await gapi.client.liens.delete({ + name: "name", + }); + /** + * List all Liens applied to the `parent` resource. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.get`. + */ + await gapi.client.liens.list({ + pageSize: 1, + pageToken: "pageToken", + parent: "parent", + }); + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + /** Clears a `Policy` from a resource. */ + await gapi.client.organizations.clearOrgPolicy({ + resource: "resource", + }); + /** Fetches an Organization resource identified by the specified resource name. */ + await gapi.client.organizations.get({ + name: "name", + }); + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + await gapi.client.organizations.getEffectiveOrgPolicy({ + resource: "resource", + }); + /** + * Gets the access control policy for an Organization resource. May be empty + * if no such policy or resource exists. The `resource` field should be the + * organization's resource name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization + */ + await gapi.client.organizations.getIamPolicy({ + resource: "resource", + }); + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + await gapi.client.organizations.getOrgPolicy({ + resource: "resource", + }); + /** Lists `Constraints` that could be applied on the specified resource. */ + await gapi.client.organizations.listAvailableOrgPolicyConstraints({ + resource: "resource", + }); + /** Lists all the `Policies` set for a particular resource. */ + await gapi.client.organizations.listOrgPolicies({ + resource: "resource", + }); + /** + * Searches Organization resources that are visible to the user and satisfy + * the specified filter. This method returns Organizations in an unspecified + * order. New Organizations do not necessarily appear at the end of the + * results. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + */ + await gapi.client.organizations.search({ + }); + /** + * Sets the access control policy on an Organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization + */ + await gapi.client.organizations.setIamPolicy({ + resource: "resource", + }); + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + await gapi.client.organizations.setOrgPolicy({ + resource: "resource", + }); + /** + * Returns permissions that a caller has on the specified Organization. + * The `resource` field should be the organization's resource name, + * e.g. "organizations/123". + * + * There are no permissions required for making this API call. + */ + await gapi.client.organizations.testIamPermissions({ + resource: "resource", + }); + /** Clears a `Policy` from a resource. */ + await gapi.client.projects.clearOrgPolicy({ + resource: "resource", + }); + /** + * Request that a new Project be created. The result is an Operation which + * can be used to track the creation process. It is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * Our SLO permits Project creation to take up to 30 seconds at the 90th + * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile + * latency. 95th percentile latency is around 11 seconds. We recommend + * polling at the 5th second with an exponential backoff. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.create` on the specified parent for the new + * project. + */ + await gapi.client.projects.create({ + }); + /** + * Marks the Project identified by the specified + * `project_id` (for example, `my-project-123`) for deletion. + * This method will only affect the Project if the following criteria are met: + * + * + The Project does not have a billing account associated with it. + * + The Project has a lifecycle state of + * ACTIVE. + * + * This method changes the Project's lifecycle state from + * ACTIVE + * to DELETE_REQUESTED. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the Project with GetProject, + * and the Project remains visible to ListProjects. + * However, you cannot update the project. + * + * After the deletion completes, the Project is not retrievable by + * the GetProject and + * ListProjects methods. + * + * The caller must have modify permissions for this Project. + */ + await gapi.client.projects.delete({ + projectId: "projectId", + }); + /** + * Retrieves the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + await gapi.client.projects.get({ + projectId: "projectId", + }); + /** + * Gets a list of ancestors in the resource hierarchy for the Project + * identified by the specified `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + await gapi.client.projects.getAncestry({ + projectId: "projectId", + }); + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + await gapi.client.projects.getEffectiveOrgPolicy({ + resource: "resource", + }); + /** + * Returns the IAM access control policy for the specified Project. + * Permission is denied if the policy or the resource does not exist. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.getIamPolicy` on the project + */ + await gapi.client.projects.getIamPolicy({ + resource: "resource", + }); + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + await gapi.client.projects.getOrgPolicy({ + resource: "resource", + }); + /** + * Lists Projects that are visible to the user and satisfy the + * specified filter. This method returns Projects in an unspecified order. + * New Projects do not necessarily appear at the end of the list. + */ + await gapi.client.projects.list({ + filter: "filter", + pageSize: 2, + pageToken: "pageToken", + }); + /** Lists `Constraints` that could be applied on the specified resource. */ + await gapi.client.projects.listAvailableOrgPolicyConstraints({ + resource: "resource", + }); + /** Lists all the `Policies` set for a particular resource. */ + await gapi.client.projects.listOrgPolicies({ + resource: "resource", + }); + /** + * Sets the IAM access control policy for the specified Project. Replaces + * any existing policy. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted only to `user` and `serviceAccount`. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited via Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + Membership changes that leave the project without any owners that have + * accepted the Terms of Service (ToS) will be rejected. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. + * + * + Calling this method requires enabling the App Engine Admin API. + * + * Note: Removing service accounts from policies or changing their roles + * can render services completely inoperable. It is important to understand + * how the service account is being used before removing or updating its + * roles. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.setIamPolicy` on the project + */ + await gapi.client.projects.setIamPolicy({ + resource: "resource", + }); + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + await gapi.client.projects.setOrgPolicy({ + resource: "resource", + }); + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + */ + await gapi.client.projects.testIamPermissions({ + resource: "resource", + }); + /** + * Restores the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * You can only use this method for a Project that has a lifecycle state of + * DELETE_REQUESTED. + * After deletion starts, the Project cannot be restored. + * + * The caller must have modify permissions for this Project. + */ + await gapi.client.projects.undelete({ + projectId: "projectId", + }); + /** + * Updates the attributes of the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have modify permissions for this Project. + */ + await gapi.client.projects.update({ + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.cloudresourcemanager/index.d.ts b/types/gapi.client.cloudresourcemanager/index.d.ts new file mode 100644 index 0000000000..a2c8500ac6 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/index.d.ts @@ -0,0 +1,2234 @@ +// Type definitions for Google Google Cloud Resource Manager API v1 1.0 +// Project: https://cloud.google.com/resource-manager +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Resource Manager API v1 */ + function load(name: "cloudresourcemanager", version: "v1"): PromiseLike; + function load(name: "cloudresourcemanager", version: "v1", callback: () => any): void; + + const folders: cloudresourcemanager.FoldersResource; + + const liens: cloudresourcemanager.LiensResource; + + const operations: cloudresourcemanager.OperationsResource; + + const organizations: cloudresourcemanager.OrganizationsResource; + + const projects: cloudresourcemanager.ProjectsResource; + + namespace cloudresourcemanager { + interface Ancestor { + /** Resource id of the ancestor. */ + resourceId?: ResourceId; + } + interface AuditConfig { + /** + * The configuration for logging of each type of permission. + * Next ID: 4 + */ + auditLogConfigs?: AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of Binding.members. + */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface BooleanPolicy { + /** + * If `true`, then the `Policy` is enforced. If `false`, then any + * configuration is acceptable. + * + * Suppose you have a `Constraint` `constraints/compute.disableSerialPortAccess` + * with `constraint_default` set to `ALLOW`. A `Policy` for that + * `Constraint` exhibits the following behavior: + * - If the `Policy` at this resource has enforced set to `false`, serial + * port connection attempts will be allowed. + * - If the `Policy` at this resource has enforced set to `true`, serial + * port connection attempts will be refused. + * - If the `Policy` at this resource is `RestoreDefault`, serial port + * connection attempts will be allowed. + * - If no `Policy` is set at this resource or anywhere higher in the + * resource hierarchy, serial port connection attempts will be allowed. + * - If no `Policy` is set at this resource, but one exists higher in the + * resource hierarchy, the behavior is as if the`Policy` were set at + * this resource. + * + * The following examples demonstrate the different possible layerings: + * + * Example 1 (nearest `Constraint` wins): + * `organizations/foo` has a `Policy` with: + * {enforced: false} + * `projects/bar` has no `Policy` set. + * The constraint at `projects/bar` and `organizations/foo` will not be + * enforced. + * + * Example 2 (enforcement gets replaced): + * `organizations/foo` has a `Policy` with: + * {enforced: false} + * `projects/bar` has a `Policy` with: + * {enforced: true} + * The constraint at `organizations/foo` is not enforced. + * The constraint at `projects/bar` is enforced. + * + * Example 3 (RestoreDefault): + * `organizations/foo` has a `Policy` with: + * {enforced: true} + * `projects/bar` has a `Policy` with: + * {RestoreDefault: {}} + * The constraint at `organizations/foo` is enforced. + * The constraint at `projects/bar` is not enforced, because + * `constraint_default` for the `Constraint` is `ALLOW`. + */ + enforced?: boolean; + } + interface ClearOrgPolicyRequest { + /** Name of the `Constraint` of the `Policy` to clear. */ + constraint?: string; + /** + * The current version, for concurrency control. Not sending an `etag` + * will cause the `Policy` to be cleared blindly. + */ + etag?: string; + } + interface Constraint { + /** Defines this constraint as being a BooleanConstraint. */ + booleanConstraint?: any; + /** The evaluation behavior of this constraint in the absense of 'Policy'. */ + constraintDefault?: string; + /** + * Detailed description of what this `Constraint` controls as well as how and + * where it is enforced. + * + * Mutable. + */ + description?: string; + /** + * The human readable name. + * + * Mutable. + */ + displayName?: string; + /** Defines this constraint as being a ListConstraint. */ + listConstraint?: ListConstraint; + /** + * Immutable value, required to globally be unique. For example, + * `constraints/serviceuser.services` + */ + name?: string; + /** Version of the `Constraint`. Default version is 0; */ + version?: number; + } + interface FolderOperation { + /** + * The resource name of the folder or organization we are either creating + * the folder under or moving the folder to. + */ + destinationParent?: string; + /** The display name of the folder. */ + displayName?: string; + /** The type of this operation. */ + operationType?: string; + /** + * The resource name of the folder's parent. + * Only applicable when the operation_type is MOVE. + */ + sourceParent?: string; + } + interface FolderOperationError { + /** The type of operation error experienced. */ + errorMessageId?: string; + } + interface GetAncestryResponse { + /** + * Ancestors are ordered from bottom to top of the resource hierarchy. The + * first ancestor is the project itself, followed by the project's parent, + * etc. + */ + ancestor?: Ancestor[]; + } + interface GetEffectiveOrgPolicyRequest { + /** The name of the `Constraint` to compute the effective `Policy`. */ + constraint?: string; + } + interface GetOrgPolicyRequest { + /** Name of the `Constraint` to get the `Policy`. */ + constraint?: string; + } + interface Lien { + /** The creation time of this Lien. */ + createTime?: string; + /** + * A system-generated unique identifier for this Lien. + * + * Example: `liens/1234abcd` + */ + name?: string; + /** + * A stable, user-visible/meaningful string identifying the origin of the + * Lien, intended to be inspected programmatically. Maximum length of 200 + * characters. + * + * Example: 'compute.googleapis.com' + */ + origin?: string; + /** + * A reference to the resource this Lien is attached to. The server will + * validate the parent against those for which Liens are supported. + * + * Example: `projects/1234` + */ + parent?: string; + /** + * Concise user-visible strings indicating why an action cannot be performed + * on a resource. Maximum lenth of 200 characters. + * + * Example: 'Holds production API key' + */ + reason?: string; + /** + * The types of operations which should be blocked as a result of this Lien. + * Each value should correspond to an IAM permission. The server will + * validate the permissions against those for which Liens are supported. + * + * An empty list is meaningless and will be rejected. + * + * Example: ['resourcemanager.projects.delete'] + */ + restrictions?: string[]; + } + interface ListAvailableOrgPolicyConstraintsRequest { + /** + * Size of the pages to be returned. This is currently unsupported and will + * be ignored. The server may at any point start using this field to limit + * page size. + */ + pageSize?: number; + /** + * Page token used to retrieve the next page. This is currently unsupported + * and will be ignored. The server may at any point start using this field. + */ + pageToken?: string; + } + interface ListAvailableOrgPolicyConstraintsResponse { + /** The collection of constraints that are settable on the request resource. */ + constraints?: Constraint[]; + /** Page token used to retrieve the next page. This is currently not used. */ + nextPageToken?: string; + } + interface ListConstraint { + /** + * Optional. The Google Cloud Console will try to default to a configuration + * that matches the value specified in this `Constraint`. + */ + suggestedValue?: string; + } + interface ListLiensResponse { + /** A list of Liens. */ + liens?: Lien[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken?: string; + } + interface ListOrgPoliciesRequest { + /** + * Size of the pages to be returned. This is currently unsupported and will + * be ignored. The server may at any point start using this field to limit + * page size. + */ + pageSize?: number; + /** + * Page token used to retrieve the next page. This is currently unsupported + * and will be ignored. The server may at any point start using this field. + */ + pageToken?: string; + } + interface ListOrgPoliciesResponse { + /** + * Page token used to retrieve the next page. This is currently not used, but + * the server may at any point start supplying a valid token. + */ + nextPageToken?: string; + /** + * The `Policies` that are set on the resource. It will be empty if no + * `Policies` are set. + */ + policies?: OrgPolicy[]; + } + interface ListPolicy { + /** The policy all_values state. */ + allValues?: string; + /** + * List of values allowed at this resource. Can only be set if no values + * are set for `denied_values` and `all_values` is set to + * `ALL_VALUES_UNSPECIFIED`. + */ + allowedValues?: string[]; + /** + * List of values denied at this resource. Can only be set if no values are + * set for `allowed_values` and `all_values` is set to + * `ALL_VALUES_UNSPECIFIED`. + */ + deniedValues?: string[]; + /** + * Determines the inheritance behavior for this `Policy`. + * + * By default, a `ListPolicy` set at a resource supercedes any `Policy` set + * anywhere up the resource hierarchy. However, if `inherit_from_parent` is + * set to `true`, then the values from the effective `Policy` of the parent + * resource are inherited, meaning the values set in this `Policy` are + * added to the values inherited up the hierarchy. + * + * Setting `Policy` hierarchies that inherit both allowed values and denied + * values isn't recommended in most circumstances to keep the configuration + * simple and understandable. However, it is possible to set a `Policy` with + * `allowed_values` set that inherits a `Policy` with `denied_values` set. + * In this case, the values that are allowed must be in `allowed_values` and + * not present in `denied_values`. + * + * For example, suppose you have a `Constraint` + * `constraints/serviceuser.services`, which has a `constraint_type` of + * `list_constraint`, and with `constraint_default` set to `ALLOW`. + * Suppose that at the Organization level, a `Policy` is applied that + * restricts the allowed API activations to {`E1`, `E2`}. Then, if a + * `Policy` is applied to a project below the Organization that has + * `inherit_from_parent` set to `false` and field all_values set to DENY, + * then an attempt to activate any API will be denied. + * + * The following examples demonstrate different possible layerings: + * + * Example 1 (no inherited values): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} + * ``projects/bar`` has `inherit_from_parent` `false` and values: + * {allowed_values: "E3" allowed_values: "E4"} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The accepted values at `projects/bar` are `E3`, and `E4`. + * + * Example 2 (inherited values): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} + * `projects/bar` has a `Policy` with values: + * {value: “E3” value: ”E4” inherit_from_parent: true} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + * + * Example 3 (inheriting both allowed and denied values): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: "E1" allowed_values: "E2"} + * `projects/bar` has a `Policy` with: + * {denied_values: "E1"} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The value accepted at `projects/bar` is `E2`. + * + * Example 4 (RestoreDefault): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} + * `projects/bar` has a `Policy` with values: + * {RestoreDefault: {}} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The accepted values at `projects/bar` are either all or none depending on + * the value of `constraint_default` (if `ALLOW`, all; if + * `DENY`, none). + * + * Example 5 (no policy inherits parent policy): + * `organizations/foo` has no `Policy` set. + * `projects/bar` has no `Policy` set. + * The accepted values at both levels are either all or none depending on + * the value of `constraint_default` (if `ALLOW`, all; if + * `DENY`, none). + * + * Example 6 (ListConstraint allowing all): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values: ”E2”} + * `projects/bar` has a `Policy` with: + * {all: ALLOW} + * The accepted values at `organizations/foo` are `E1`, E2`. + * Any value is accepted at `projects/bar`. + * + * Example 7 (ListConstraint allowing none): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values: ”E2”} + * `projects/bar` has a `Policy` with: + * {all: DENY} + * The accepted values at `organizations/foo` are `E1`, E2`. + * No value is accepted at `projects/bar`. + */ + inheritFromParent?: boolean; + /** + * Optional. The Google Cloud Console will try to default to a configuration + * that matches the value specified in this `Policy`. If `suggested_value` + * is not set, it will inherit the value specified higher in the hierarchy, + * unless `inherit_from_parent` is `false`. + */ + suggestedValue?: string; + } + interface ListProjectsResponse { + /** + * Pagination token. + * + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * + * Pagination tokens have a limited lifetime. + */ + nextPageToken?: string; + /** + * The list of Projects that matched the list filter. This list can + * be paginated. + */ + projects?: Project[]; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface OrgPolicy { + /** For boolean `Constraints`, whether to enforce the `Constraint` or not. */ + booleanPolicy?: BooleanPolicy; + /** + * The name of the `Constraint` the `Policy` is configuring, for example, + * `constraints/serviceuser.services`. + * + * Immutable after creation. + */ + constraint?: string; + /** + * An opaque tag indicating the current version of the `Policy`, used for + * concurrency control. + * + * When the `Policy` is returned from either a `GetPolicy` or a + * `ListOrgPolicy` request, this `etag` indicates the version of the current + * `Policy` to use when executing a read-modify-write loop. + * + * When the `Policy` is returned from a `GetEffectivePolicy` request, the + * `etag` will be unset. + * + * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + * that was returned from a `GetOrgPolicy` request as part of a + * read-modify-write loop for concurrency control. Not setting the `etag`in a + * `SetOrgPolicy` request will result in an unconditional write of the + * `Policy`. + */ + etag?: string; + /** List of values either allowed or disallowed. */ + listPolicy?: ListPolicy; + /** + * Restores the default behavior of the constraint; independent of + * `Constraint` type. + */ + restoreDefault?: any; + /** + * The time stamp the `Policy` was previously updated. This is set by the + * server, not specified by the caller, and represents the last time a call to + * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + * be ignored. + */ + updateTime?: string; + /** Version of the `Policy`. Default version is 0; */ + version?: number; + } + interface Organization { + /** + * Timestamp when the Organization was created. Assigned by the server. + * @OutputOnly + */ + creationTime?: string; + /** + * A friendly string to be used to refer to the Organization in the UI. + * Assigned by the server, set to the primary domain of the G Suite + * customer that owns the organization. + * @OutputOnly + */ + displayName?: string; + /** + * The organization's current lifecycle state. Assigned by the server. + * @OutputOnly + */ + lifecycleState?: string; + /** + * Output Only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + */ + name?: string; + /** + * The owner of this Organization. The owner should be specified on + * creation. Once set, it cannot be changed. + * This field is required. + */ + owner?: OrganizationOwner; + } + interface OrganizationOwner { + /** The Google for Work customer id used in the Directory API. */ + directoryCustomerId?: string; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface Project { + /** + * Creation time. + * + * Read-only. + */ + createTime?: string; + /** + * The labels associated with this Project. + * + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * + * No more than 256 labels can be associated with a given resource. + * + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * + * Example: "environment" : "dev" + * Read-write. + */ + labels?: Record; + /** + * The Project lifecycle state. + * + * Read-only. + */ + lifecycleState?: string; + /** + * The user-assigned display name of the Project. + * It must be 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * + * Example: My Project + * Read-write. + */ + name?: string; + /** + * An optional reference to a parent Resource. + * + * The only supported parent type is "organization". Once set, the parent + * cannot be modified. The `parent` can be set on creation or using the + * `UpdateProject` method; the end user must have the + * `resourcemanager.projects.create` permission on the parent. + * + * Read-write. + */ + parent?: ResourceId; + /** + * The unique, user-assigned ID of the Project. + * It must be 6 to 30 lowercase letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * + * Example: tokyo-rain-123 + * Read-only after creation. + */ + projectId?: string; + /** + * The number uniquely identifying the project. + * + * Example: 415104041262 + * Read-only. + */ + projectNumber?: string; + } + interface ProjectCreationStatus { + /** Creation time of the project creation workflow. */ + createTime?: string; + /** + * True if the project can be retrieved using GetProject. No other operations + * on the project are guaranteed to work until the project creation is + * complete. + */ + gettable?: boolean; + /** True if the project creation process is complete. */ + ready?: boolean; + } + interface ResourceId { + /** + * Required field for the type-specific id. This should correspond to the id + * used in the type-specific API's. + */ + id?: string; + /** + * Required field representing the resource type this id is for. + * At present, the valid types are: "organization" + */ + type?: string; + } + interface SearchOrganizationsRequest { + /** + * An optional query string used to filter the Organizations to return in + * the response. Filter rules are case-insensitive. + * + * + * Organizations may be filtered by `owner.directoryCustomerId` or by + * `domain`, where the domain is a Google for Work domain, for example: + * + * |Filter|Description| + * |------|-----------| + * |owner.directorycustomerid:123456789|Organizations with + * `owner.directory_customer_id` equal to `123456789`.| + * |domain:google.com|Organizations corresponding to the domain `google.com`.| + * + * This field is optional. + */ + filter?: string; + /** + * The maximum number of Organizations to return in the response. + * This field is optional. + */ + pageSize?: number; + /** + * A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. + * This field is optional. + */ + pageToken?: string; + } + interface SearchOrganizationsResponse { + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + */ + nextPageToken?: string; + /** + * The list of Organizations that matched the search query, possibly + * paginated. + */ + organizations?: Organization[]; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * paths: "bindings, etag" + * This field is only used by Cloud IAM. + */ + updateMask?: string; + } + interface SetOrgPolicyRequest { + /** `Policy` to set on the resource. */ + policy?: OrgPolicy; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface FoldersResource { + /** Clears a `Policy` from a resource. */ + clearOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource for the `Policy` to clear. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + getEffectiveOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the resource to start computing the effective `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + getOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource the `Policy` is set on. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists `Constraints` that could be applied on the specified resource. */ + listAvailableOrgPolicyConstraints(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list `Constraints` for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the `Policies` set for a particular resource. */ + listOrgPolicies(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list Policies for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + setOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Resource name of the resource to attach the `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface LiensResource { + /** + * Create a Lien which applies to the resource denoted by the `parent` field. + * + * Callers of this method will require permission on the `parent` resource. + * For example, applying to `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + * + * NOTE: Some resources may limit the number of Liens which may be applied. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Delete a Lien by `name`. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name/identifier of the Lien to delete. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * List all Liens applied to the `parent` resource. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.get`. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of items to return. This is a suggestion for the server. */ + pageSize?: number; + /** The `next_page_token` value returned from a previous List request, if any. */ + pageToken?: string; + /** + * The name of the resource to list all attached Liens. + * For example, `projects/1234`. + */ + parent?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OrganizationsResource { + /** Clears a `Policy` from a resource. */ + clearOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource for the `Policy` to clear. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Fetches an Organization resource identified by the specified resource name. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the Organization to fetch, e.g. "organizations/1234". */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + getEffectiveOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the resource to start computing the effective `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for an Organization resource. May be empty + * if no such policy or resource exists. The `resource` field should be the + * organization's resource name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + getOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource the `Policy` is set on. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists `Constraints` that could be applied on the specified resource. */ + listAvailableOrgPolicyConstraints(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list `Constraints` for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the `Policies` set for a particular resource. */ + listOrgPolicies(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list Policies for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Searches Organization resources that are visible to the user and satisfy + * the specified filter. This method returns Organizations in an unspecified + * order. New Organizations do not necessarily appear at the end of the + * results. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + */ + search(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on an Organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + setOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Resource name of the resource to attach the `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified Organization. + * The `resource` field should be the organization's resource name, + * e.g. "organizations/123". + * + * There are no permissions required for making this API call. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** Clears a `Policy` from a resource. */ + clearOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource for the `Policy` to clear. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Request that a new Project be created. The result is an Operation which + * can be used to track the creation process. It is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * Our SLO permits Project creation to take up to 30 seconds at the 90th + * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile + * latency. 95th percentile latency is around 11 seconds. We recommend + * polling at the 5th second with an exponential backoff. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.create` on the specified parent for the new + * project. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Marks the Project identified by the specified + * `project_id` (for example, `my-project-123`) for deletion. + * This method will only affect the Project if the following criteria are met: + * + * + The Project does not have a billing account associated with it. + * + The Project has a lifecycle state of + * ACTIVE. + * + * This method changes the Project's lifecycle state from + * ACTIVE + * to DELETE_REQUESTED. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the Project with GetProject, + * and the Project remains visible to ListProjects. + * However, you cannot update the project. + * + * After the deletion completes, the Project is not retrievable by + * the GetProject and + * ListProjects methods. + * + * The caller must have modify permissions for this Project. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Project ID (for example, `foo-bar-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Retrieves the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Project ID (for example, `my-project-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a list of ancestors in the resource hierarchy for the Project + * identified by the specified `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + getAncestry(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Project ID (for example, `my-project-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + getEffectiveOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the resource to start computing the effective `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns the IAM access control policy for the specified Project. + * Permission is denied if the policy or the resource does not exist. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.getIamPolicy` on the project + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + getOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource the `Policy` is set on. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists Projects that are visible to the user and satisfy the + * specified filter. This method returns Projects in an unspecified order. + * New Projects do not necessarily appear at the end of the list. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * + `name` + * + `id` + * + labels.key where *key* is the name of a label + * + * Some examples of using labels as filters: + * + * |Filter|Description| + * |------|-----------| + * |name:how*|The project's name starts with "how".| + * |name:Howl|The project's name is `Howl` or `howl`.| + * |name:HOWL|Equivalent to above.| + * |NAME:howl|Equivalent to above.| + * |labels.color:*|The project has the label `color`.| + * |labels.color:red|The project's label `color` has the value `red`.| + * |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. + * + * If you specify a filter that has both `parent.type` and `parent.id`, then + * the `resourcemanager.projects.list` permission is checked on the parent. + * If the user has this permission, all projects under the parent will be + * returned after remaining filters have been applied. If the user lacks this + * permission, then all projects for which the user has the + * `resourcemanager.projects.get` permission will be returned after remaining + * filters have been applied. If no filter is specified, the call will return + * projects for which the user has `resourcemanager.projects.get` permissions. + * + * Optional. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of Projects to return in the response. + * The server can return fewer Projects than requested. + * If unspecified, server picks an appropriate default. + * + * Optional. + */ + pageSize?: number; + /** + * A pagination token returned from a previous call to ListProjects + * that indicates from where listing should continue. + * + * Optional. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists `Constraints` that could be applied on the specified resource. */ + listAvailableOrgPolicyConstraints(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list `Constraints` for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the `Policies` set for a particular resource. */ + listOrgPolicies(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list Policies for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the IAM access control policy for the specified Project. Replaces + * any existing policy. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted only to `user` and `serviceAccount`. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited via Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + Membership changes that leave the project without any owners that have + * accepted the Terms of Service (ToS) will be rejected. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. + * + * + Calling this method requires enabling the App Engine Admin API. + * + * Note: Removing service accounts from policies or changing their roles + * can render services completely inoperable. It is important to understand + * how the service account is being used before removing or updating its + * roles. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.setIamPolicy` on the project + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + setOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Resource name of the resource to attach the `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Restores the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * You can only use this method for a Project that has a lifecycle state of + * DELETE_REQUESTED. + * After deletion starts, the Project cannot be restored. + * + * The caller must have modify permissions for this Project. + */ + undelete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The project ID (for example, `foo-bar-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Updates the attributes of the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have modify permissions for this Project. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The project ID (for example, `my-project-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.cloudresourcemanager/readme.md b/types/gapi.client.cloudresourcemanager/readme.md new file mode 100644 index 0000000000..c034eb5ae9 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/readme.md @@ -0,0 +1,409 @@ +# TypeScript typings for Google Cloud Resource Manager API v1 +The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata. +For detailed description please check [documentation](https://cloud.google.com/resource-manager). + +## Installing + +Install typings for Google Cloud Resource Manager API: +``` +npm install @types/gapi.client.cloudresourcemanager@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudresourcemanager', 'v1', () => { + // now we can use gapi.client.cloudresourcemanager + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Resource Manager API resources: + +```typescript + +/* +Clears a `Policy` from a resource. +*/ +await gapi.client.folders.clearOrgPolicy({ resource: "resource", }); + +/* +Gets the effective `Policy` on a resource. This is the result of merging +`Policies` in the resource hierarchy. The returned `Policy` will not have +an `etag`set because it is a computed `Policy` across multiple resources. +*/ +await gapi.client.folders.getEffectiveOrgPolicy({ resource: "resource", }); + +/* +Gets a `Policy` on a resource. + +If no `Policy` is set on the resource, a `Policy` is returned with default +values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +`etag` value can be used with `SetOrgPolicy()` to create or update a +`Policy` during read-modify-write. +*/ +await gapi.client.folders.getOrgPolicy({ resource: "resource", }); + +/* +Lists `Constraints` that could be applied on the specified resource. +*/ +await gapi.client.folders.listAvailableOrgPolicyConstraints({ resource: "resource", }); + +/* +Lists all the `Policies` set for a particular resource. +*/ +await gapi.client.folders.listOrgPolicies({ resource: "resource", }); + +/* +Updates the specified `Policy` on the resource. Creates a new `Policy` for +that `Constraint` on the resource if one does not exist. + +Not supplying an `etag` on the request `Policy` results in an unconditional +write of the `Policy`. +*/ +await gapi.client.folders.setOrgPolicy({ resource: "resource", }); + +/* +Create a Lien which applies to the resource denoted by the `parent` field. + +Callers of this method will require permission on the `parent` resource. +For example, applying to `projects/1234` requires permission +`resourcemanager.projects.updateLiens`. + +NOTE: Some resources may limit the number of Liens which may be applied. +*/ +await gapi.client.liens.create({ }); + +/* +Delete a Lien by `name`. + +Callers of this method will require permission on the `parent` resource. +For example, a Lien with a `parent` of `projects/1234` requires permission +`resourcemanager.projects.updateLiens`. +*/ +await gapi.client.liens.delete({ name: "name", }); + +/* +List all Liens applied to the `parent` resource. + +Callers of this method will require permission on the `parent` resource. +For example, a Lien with a `parent` of `projects/1234` requires permission +`resourcemanager.projects.get`. +*/ +await gapi.client.liens.list({ }); + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); + +/* +Clears a `Policy` from a resource. +*/ +await gapi.client.organizations.clearOrgPolicy({ resource: "resource", }); + +/* +Fetches an Organization resource identified by the specified resource name. +*/ +await gapi.client.organizations.get({ name: "name", }); + +/* +Gets the effective `Policy` on a resource. This is the result of merging +`Policies` in the resource hierarchy. The returned `Policy` will not have +an `etag`set because it is a computed `Policy` across multiple resources. +*/ +await gapi.client.organizations.getEffectiveOrgPolicy({ resource: "resource", }); + +/* +Gets the access control policy for an Organization resource. May be empty +if no such policy or resource exists. The `resource` field should be the +organization's resource name, e.g. "organizations/123". + +Authorization requires the Google IAM permission +`resourcemanager.organizations.getIamPolicy` on the specified organization +*/ +await gapi.client.organizations.getIamPolicy({ resource: "resource", }); + +/* +Gets a `Policy` on a resource. + +If no `Policy` is set on the resource, a `Policy` is returned with default +values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +`etag` value can be used with `SetOrgPolicy()` to create or update a +`Policy` during read-modify-write. +*/ +await gapi.client.organizations.getOrgPolicy({ resource: "resource", }); + +/* +Lists `Constraints` that could be applied on the specified resource. +*/ +await gapi.client.organizations.listAvailableOrgPolicyConstraints({ resource: "resource", }); + +/* +Lists all the `Policies` set for a particular resource. +*/ +await gapi.client.organizations.listOrgPolicies({ resource: "resource", }); + +/* +Searches Organization resources that are visible to the user and satisfy +the specified filter. This method returns Organizations in an unspecified +order. New Organizations do not necessarily appear at the end of the +results. + +Search will only return organizations on which the user has the permission +`resourcemanager.organizations.get` +*/ +await gapi.client.organizations.search({ }); + +/* +Sets the access control policy on an Organization resource. Replaces any +existing policy. The `resource` field should be the organization's resource +name, e.g. "organizations/123". + +Authorization requires the Google IAM permission +`resourcemanager.organizations.setIamPolicy` on the specified organization +*/ +await gapi.client.organizations.setIamPolicy({ resource: "resource", }); + +/* +Updates the specified `Policy` on the resource. Creates a new `Policy` for +that `Constraint` on the resource if one does not exist. + +Not supplying an `etag` on the request `Policy` results in an unconditional +write of the `Policy`. +*/ +await gapi.client.organizations.setOrgPolicy({ resource: "resource", }); + +/* +Returns permissions that a caller has on the specified Organization. +The `resource` field should be the organization's resource name, +e.g. "organizations/123". + +There are no permissions required for making this API call. +*/ +await gapi.client.organizations.testIamPermissions({ resource: "resource", }); + +/* +Clears a `Policy` from a resource. +*/ +await gapi.client.projects.clearOrgPolicy({ resource: "resource", }); + +/* +Request that a new Project be created. The result is an Operation which +can be used to track the creation process. It is automatically deleted +after a few hours, so there is no need to call DeleteOperation. + +Our SLO permits Project creation to take up to 30 seconds at the 90th +percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile +latency. 95th percentile latency is around 11 seconds. We recommend +polling at the 5th second with an exponential backoff. + +Authorization requires the Google IAM permission +`resourcemanager.projects.create` on the specified parent for the new +project. +*/ +await gapi.client.projects.create({ }); + +/* +Marks the Project identified by the specified +`project_id` (for example, `my-project-123`) for deletion. +This method will only affect the Project if the following criteria are met: + ++ The Project does not have a billing account associated with it. ++ The Project has a lifecycle state of +ACTIVE. + +This method changes the Project's lifecycle state from +ACTIVE +to DELETE_REQUESTED. +The deletion starts at an unspecified time, +at which point the Project is no longer accessible. + +Until the deletion completes, you can check the lifecycle state +checked by retrieving the Project with GetProject, +and the Project remains visible to ListProjects. +However, you cannot update the project. + +After the deletion completes, the Project is not retrievable by +the GetProject and +ListProjects methods. + +The caller must have modify permissions for this Project. +*/ +await gapi.client.projects.delete({ projectId: "projectId", }); + +/* +Retrieves the Project identified by the specified +`project_id` (for example, `my-project-123`). + +The caller must have read permissions for this Project. +*/ +await gapi.client.projects.get({ projectId: "projectId", }); + +/* +Gets a list of ancestors in the resource hierarchy for the Project +identified by the specified `project_id` (for example, `my-project-123`). + +The caller must have read permissions for this Project. +*/ +await gapi.client.projects.getAncestry({ projectId: "projectId", }); + +/* +Gets the effective `Policy` on a resource. This is the result of merging +`Policies` in the resource hierarchy. The returned `Policy` will not have +an `etag`set because it is a computed `Policy` across multiple resources. +*/ +await gapi.client.projects.getEffectiveOrgPolicy({ resource: "resource", }); + +/* +Returns the IAM access control policy for the specified Project. +Permission is denied if the policy or the resource does not exist. + +Authorization requires the Google IAM permission +`resourcemanager.projects.getIamPolicy` on the project +*/ +await gapi.client.projects.getIamPolicy({ resource: "resource", }); + +/* +Gets a `Policy` on a resource. + +If no `Policy` is set on the resource, a `Policy` is returned with default +values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +`etag` value can be used with `SetOrgPolicy()` to create or update a +`Policy` during read-modify-write. +*/ +await gapi.client.projects.getOrgPolicy({ resource: "resource", }); + +/* +Lists Projects that are visible to the user and satisfy the +specified filter. This method returns Projects in an unspecified order. +New Projects do not necessarily appear at the end of the list. +*/ +await gapi.client.projects.list({ }); + +/* +Lists `Constraints` that could be applied on the specified resource. +*/ +await gapi.client.projects.listAvailableOrgPolicyConstraints({ resource: "resource", }); + +/* +Lists all the `Policies` set for a particular resource. +*/ +await gapi.client.projects.listOrgPolicies({ resource: "resource", }); + +/* +Sets the IAM access control policy for the specified Project. Replaces +any existing policy. + +The following constraints apply when using `setIamPolicy()`: + ++ Project does not support `allUsers` and `allAuthenticatedUsers` as +`members` in a `Binding` of a `Policy`. + ++ The owner role can be granted only to `user` and `serviceAccount`. + ++ Service accounts can be made owners of a project directly +without any restrictions. However, to be added as an owner, a user must be +invited via Cloud Platform console and must accept the invitation. + ++ A user cannot be granted the owner role using `setIamPolicy()`. The user +must be granted the owner role using the Cloud Platform Console and must +explicitly accept the invitation. + ++ Invitations to grant the owner role cannot be sent using +`setIamPolicy()`; +they must be sent only using the Cloud Platform Console. + ++ Membership changes that leave the project without any owners that have +accepted the Terms of Service (ToS) will be rejected. + ++ If the project is not part of an organization, there must be at least +one owner who has accepted the Terms of Service (ToS) agreement in the +policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner +from the policy will fail. This restriction also applies to legacy +projects that no longer have owners who have accepted the ToS. Edits to +IAM policies will be rejected until the lack of a ToS-accepting owner is +rectified. + ++ Calling this method requires enabling the App Engine Admin API. + +Note: Removing service accounts from policies or changing their roles +can render services completely inoperable. It is important to understand +how the service account is being used before removing or updating its +roles. + +Authorization requires the Google IAM permission +`resourcemanager.projects.setIamPolicy` on the project +*/ +await gapi.client.projects.setIamPolicy({ resource: "resource", }); + +/* +Updates the specified `Policy` on the resource. Creates a new `Policy` for +that `Constraint` on the resource if one does not exist. + +Not supplying an `etag` on the request `Policy` results in an unconditional +write of the `Policy`. +*/ +await gapi.client.projects.setOrgPolicy({ resource: "resource", }); + +/* +Returns permissions that a caller has on the specified Project. + +There are no permissions required for making this API call. +*/ +await gapi.client.projects.testIamPermissions({ resource: "resource", }); + +/* +Restores the Project identified by the specified +`project_id` (for example, `my-project-123`). +You can only use this method for a Project that has a lifecycle state of +DELETE_REQUESTED. +After deletion starts, the Project cannot be restored. + +The caller must have modify permissions for this Project. +*/ +await gapi.client.projects.undelete({ projectId: "projectId", }); + +/* +Updates the attributes of the Project identified by the specified +`project_id` (for example, `my-project-123`). + +The caller must have modify permissions for this Project. +*/ +await gapi.client.projects.update({ projectId: "projectId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudresourcemanager/tsconfig.json b/types/gapi.client.cloudresourcemanager/tsconfig.json new file mode 100644 index 0000000000..c82cbc16f6 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudresourcemanager-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudresourcemanager/tslint.json b/types/gapi.client.cloudresourcemanager/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudtasks/gapi.client.cloudtasks-tests.ts b/types/gapi.client.cloudtasks/gapi.client.cloudtasks-tests.ts new file mode 100644 index 0000000000..dc2da0ba4c --- /dev/null +++ b/types/gapi.client.cloudtasks/gapi.client.cloudtasks-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudtasks', 'v2beta2', () => { + /** now we can use gapi.client.cloudtasks */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudtasks/index.d.ts b/types/gapi.client.cloudtasks/index.d.ts new file mode 100644 index 0000000000..3e1d3f3c08 --- /dev/null +++ b/types/gapi.client.cloudtasks/index.d.ts @@ -0,0 +1,2100 @@ +// Type definitions for Google Cloud Tasks API v2beta2 2.0 +// Project: https://cloud.google.com/cloud-tasks/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudtasks.googleapis.com/$discovery/rest?version=v2beta2 + +/// + +declare namespace gapi.client { + /** Load Cloud Tasks API v2beta2 */ + function load(name: "cloudtasks", version: "v2beta2"): PromiseLike; + function load(name: "cloudtasks", version: "v2beta2", callback: () => any): void; + + const projects: cloudtasks.ProjectsResource; + + namespace cloudtasks { + interface AcknowledgeTaskRequest { + /** + * Required. + * + * The task's current schedule time, available in the Task.schedule_time + * returned in PullTasksResponse.tasks or + * CloudTasks.RenewLease. This restriction is to check that + * the caller is acknowledging the correct task. + */ + scheduleTime?: string; + } + interface AppEngineHttpRequest { + /** + * Task-level setting for App Engine routing. + * + * If set, AppEngineHttpTarget.app_engine_routing_override is used for + * all tasks in the queue, no matter what the setting is for the + * task-level app_engine_routing. + */ + appEngineRouting?: AppEngineRouting; + /** + * HTTP request headers. + * + * This map contains the header field names and values. + * Headers can be set when the + * [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). + * Repeated headers are not supported but a header value can contain commas. + * + * Cloud Tasks sets some headers to default values: + * + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * + * If the task has an AppEngineHttpRequest.payload, Cloud Tasks sets the + * following headers: + * + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explictly + * setting `Content-Type` to a particular media type when the + * [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * + * The headers below cannot be set or overridden: + * + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * + * In addition, some App Engine headers, which contain + * task-specific information, are also be sent to the task handler; see + * [request headers](/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + */ + headers?: Record; + /** + * The HTTP method to use for the request. The default is POST. + * + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt will fail + * with error code 405 (Method Not Allowed). See + * the Request-Line is not allowed for the resource identified by the + * Request-URI". See + * [Writing a push task request handler](/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the documentation for the request handlers in the language your app is + * written in e.g. + * [python RequestHandler](/appengine/docs/python/tools/webapp/requesthandlerclass). + */ + httpMethod?: string; + /** + * Payload. + * + * The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is + * POST or PUT. It is an error to set a data payload on a task with + * an incompatible HttpMethod. + */ + payload?: string; + /** + * The relative URL. + * + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path and query string arguments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + */ + relativeUrl?: string; + } + interface AppEngineHttpTarget { + /** + * Overrides for the + * task-level app_engine_routing. + * + * If set, AppEngineHttpTarget.app_engine_routing_override is used for + * all tasks in the queue, no matter what the setting is for the + * task-level app_engine_routing. + */ + appEngineRoutingOverride?: AppEngineRouting; + } + interface AppEngineQueueConfig { + /** Deprecated. Use AppEngineTarget.app_engine_routing_override. */ + appEngineRoutingOverride?: AppEngineRouting; + } + interface AppEngineRouting { + /** + * Output only. + * + * The host that the task is sent to. For more information, see + * [How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed). + * + * The host is constructed as: + * + * + * * `host = [application_domain_name]`
+ * `| [service] + '.' + [application_domain_name]`
+ * `| [version] + '.' + [application_domain_name]`
+ * `| [version_dot_service]+ '.' + [application_domain_name]`
+ * `| [instance] + '.' + [application_domain_name]`
+ * `| [instance_dot_service] + '.' + [application_domain_name]`
+ * `| [instance_dot_version] + '.' + [application_domain_name]`
+ * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * queue's project ID. Some tasks which were created using the App Engine + * SDK use a custom domain name. + * + * * `service =` AppEngineRouting.service + * + * * `version =` AppEngineRouting.version + * + * * `version_dot_service =` + * AppEngineRouting.version `+ '.' +` AppEngineRouting.service + * + * * `instance =` AppEngineRouting.instance + * + * * `instance_dot_service =` + * AppEngineRouting.instance `+ '.' +` AppEngineRouting.service + * + * * `instance_dot_version =` + * AppEngineRouting.instance `+ '.' +` AppEngineRouting.version + * + * * `instance_dot_version_dot_service =` + * AppEngineRouting.instance `+ '.' +` + * AppEngineRouting.version `+ '.' +` AppEngineRouting.service + * + * If AppEngineRouting.service is empty, then the task will be sent + * to the service which is the default service when the task is attempted. + * + * If AppEngineRouting.version is empty, then the task will be sent + * to the version which is the default version when the task is attempted. + * + * If AppEngineRouting.instance is empty, then the task will be sent + * to an instance which is available when the task is attempted. + * + * When AppEngineRouting.service is "default", + * AppEngineRouting.version is "default", and + * AppEngineRouting.instance is empty, AppEngineRouting.host is + * shortened to just the `application_domain_name`. + * + * If AppEngineRouting.service, AppEngineRouting.version, or + * AppEngineRouting.instance is invalid, then the task will be sent + * to the default version of the default service when the task is attempted. + */ + host?: string; + /** + * App instance. + * + * By default, the task is sent to an instance which is available when + * the task is attempted. + * + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine Standard](/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request routing](/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request routing](/appengine/docs/flexible/python/how-requests-are-routed). + */ + instance?: string; + /** + * App service. + * + * By default, the task is sent to the service which is the default + * service when the task is attempted ("default"). + * + * For some queues or tasks which were created using the App Engine Task Queue + * API, AppEngineRouting.host is not parsable into + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance. For example, some tasks which were created + * using the App Engine SDK use a custom domain name; custom domains are not + * parsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance are the empty string. + */ + service?: string; + /** + * App version. + * + * By default, the task is sent to the version which is the default + * version when the task is attempted ("default"). + * + * For some queues or tasks which were created using the App Engine Task Queue + * API, AppEngineRouting.host is not parsable into + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance. For example, some tasks which were created + * using the App Engine SDK use a custom domain name; custom domains are not + * parsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance are the empty string. + */ + version?: string; + } + interface AppEngineTaskTarget { + /** Deprecated. Use AppEngineHttpRequest.app_engine_routing. */ + appEngineRouting?: AppEngineRouting; + /** Deprecated. Use AppEngineHttpRequest.headers. */ + headers?: Record; + /** Deprecated. Use AppEngineHttpRequest.http_method. */ + httpMethod?: string; + /** Deprecated. Use AppEngineHttpRequest.payload. */ + payload?: string; + /** Deprecated. Use AppEngineHttpRequest.relative_url. */ + relativeUrl?: string; + } + interface AttemptStatus { + /** + * Output only. + * + * The time that this attempt was dispatched. + * + * `dispatch_time` will be truncated to the nearest microsecond. + */ + dispatchTime?: string; + /** + * Output only. + * + * The response from the target for this attempt. + * + * If the task has not been attempted or the task is currently running + * then the response status is google.rpc.Code.UNKNOWN. + */ + responseStatus?: Status; + /** + * Output only. + * + * The time that this attempt response was received. + * + * `response_time` will be truncated to the nearest microsecond. + */ + responseTime?: string; + /** + * Output only. + * + * The time that this attempt was scheduled. + * + * `schedule_time` will be truncated to the nearest microsecond. + */ + scheduleTime?: string; + } + interface Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface CancelLeaseRequest { + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** + * Required. + * + * The task's current schedule time, available in the Task.schedule_time + * returned in PullTasksResponse.tasks or + * CloudTasks.RenewLease. This restriction is to check that + * the caller is canceling the correct task. + */ + scheduleTime?: string; + } + interface CreateTaskRequest { + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** + * Required. + * + * The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a name for the task in + * Task.name. If a name is not specified then the system will + * generate a random unique task id, which will be returned in the + * response's Task.name. + * + * If Task.schedule_time is not set or is in the past then Cloud + * Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with google.rpc.Code.ALREADY_EXISTS. If the task's queue was + * created using Cloud Tasks, then another task with the same name + * can't be created for ~1hour after the original task was deleted + * or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or completed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these CloudTasks.CreateTask calls have significantly + * increased latency. Using hashed strings for the task id or for + * the prefix of the task id is recommended. Choosing task ids that + * are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + */ + task?: Task; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListQueuesResponse { + /** + * A token to retrieve next page of results. + * + * To return the next page of results, call + * CloudTasks.ListQueues with this value as the + * ListQueuesRequest.page_token. + * + * If the next_page_token is empty, there are no more results. + * + * The page token is valid for only 2 hours. + */ + nextPageToken?: string; + /** The list of queues. */ + queues?: Queue[]; + } + interface ListTasksResponse { + /** + * A token to retrieve next page of results. + * + * To return the next page of results, call + * CloudTasks.ListTasks with this value as the + * ListTasksRequest.page_token. + * + * If the next_page_token is empty, there are no more results. + */ + nextPageToken?: string; + /** The list of tasks. */ + tasks?: Task[]; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface Policy { + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface PullMessage { + /** A data payload consumed by the task worker to execute the task. */ + payload?: string; + /** + * A meta-data tag for this task. + * + * This value is used by CloudTasks.PullTasks calls when + * PullTasksRequest.filter is `tag=`. + * + * The tag must be less than 500 bytes. + */ + tag?: string; + } + interface PullTaskTarget { + /** Deprecated. Use PullMessage.payload. */ + payload?: string; + /** Deprecated. Use PullMessage.tag. */ + tag?: string; + } + interface PullTasksRequest { + /** + * `filter` can be used to specify a subset of tasks to lease. + * + * When `filter` is set to `tag=` then the + * PullTasksResponse will contain only tasks whose + * PullMessage.tag is equal to ``. `` must be less than + * 500 bytes. + * + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest schedule_time will be returned. + * + * Grammar Syntax: + * + * * `filter = "tag=" tag | "tag_function=" function` + * + * * `tag = string | bytes` + * + * * `function = "oldest_tag()"` + * + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + */ + filter?: string; + /** + * The duration of the lease. + * + * Each task returned in the PullTasksResponse will have its + * Task.schedule_time set to the current time plus the + * `lease_duration`. A task that has been returned in a + * PullTasksResponse is leased -- that task will not be + * returned in a different PullTasksResponse before the + * Task.schedule_time. + * + * After the lease holder has successfully finished the work + * associated with the task, the lease holder must call + * CloudTasks.AcknowledgeTask. If the task is not acknowledged + * via CloudTasks.AcknowledgeTask before the + * Task.schedule_time then it will be returned in a later + * PullTasksResponse so that another lease holder can process + * it. + * + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + */ + leaseDuration?: string; + /** + * The maximum number of tasks to lease. The maximum that can be + * requested is 1000. + */ + maxTasks?: number; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + } + interface PullTasksResponse { + /** The leased tasks. */ + tasks?: Task[]; + } + interface Queue { + /** + * App Engine HTTP target. + * + * An App Engine queue is a queue that has an AppEngineHttpTarget. + */ + appEngineHttpTarget?: AppEngineHttpTarget; + /** Deprecated. Use Queue.app_engine_http_target. */ + appEngineQueueConfig?: AppEngineQueueConfig; + /** + * The queue name. + * + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * * `PROJECT_ID` can contain uppercase and lowercase letters, + * numbers, hyphens, colons, and periods; that is, it must match + * the regular expression: `[a-zA-Z\\d-:\\.]+`. + * * `QUEUE_ID` can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * characters. + * + * Caller-specified and required in CreateQueueRequest, after which + * it becomes output only. + */ + name?: string; + /** Deprecated. Use Queue.pull_target. */ + pullQueueConfig?: any; + /** + * Pull target. + * + * A pull queue is a queue that has a PullTarget. + */ + pullTarget?: any; + /** + * Output only. + * + * The last time this queue was purged. All tasks that were + * created before this time were purged. + * + * A queue can be purged using CloudTasks.PurgeQueue, the + * [App Engine Task Queue SDK, or the Cloud + * Console](/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * + * Purge time will be truncated to the nearest microsecond. Purge + * time will be zero if the queue has never been purged. + */ + purgeTime?: string; + /** + * Output only. + * + * The state of the queue. + * + * `queue_state` can only be changed by called + * CloudTasks.PauseQueue, CloudTasks.ResumeQueue, or uploading + * [queue.yaml](/appengine/docs/python/config/queueref). + * CloudTasks.UpdateQueue cannot be used to change `queue_state`. + */ + queueState?: string; + /** + * Rate limits for task dispatches. + * + * Queue.rate_limits and Queue.retry_config are related because they + * both control task attempts however they control how tasks are attempted in + * different ways: + * + * * Queue.rate_limits controls the total rate of dispatches from a queue + * (i.e. all traffic dispatched from the queue, regardless of whether the + * dispatch is from a first attempt or a retry). + * * Queue.retry_config controls what happens to particular a task after + * its first attempt fails. That is, Queue.retry_config controls task + * retries (the second attempt, third attempt, etc). + */ + rateLimits?: RateLimits; + /** + * Settings that determine the retry behavior. + * + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine documentation](/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + */ + retryConfig?: RetryConfig; + } + interface RateLimits { + /** + * Output only. + * + * The max burst size limits how fast the queue is processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * + * * For App Engine queues, if + * RateLimits.max_tasks_dispatched_per_second is 1, this + * field is 10; otherwise this field is + * RateLimits.max_tasks_dispatched_per_second / 5. + * * For pull queues, this field is output only and always 10,000. + * + * Note: For App Engine queues that were created through + * `queue.yaml/xml`, `max_burst_size` might not have the same + * settings as specified above; CloudTasks.UpdateQueue can be + * used to set `max_burst_size` only to the values specified above. + * + * This field has the same meaning as + * [bucket_size in queue.yaml](/appengine/docs/standard/python/config/queueref#bucket_size). + */ + maxBurstSize?: number; + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * + * The maximum allowed value is 5,000. + * + * * For App Engine queues, this field is 10 by default. + * * For pull queues, this field is output only and always -1, which + * indicates no limit. + * + * This field has the same meaning as + * [max_concurrent_requests in queue.yaml](/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + */ + maxConcurrentTasks?: number; + /** + * The maximum rate at which tasks are dispatched from this + * queue. + * + * The maximum allowed value is 500. + * + * * For App Engine queues, this field is 1 by default. + * * For pull queues, this field is output only and always 10,000. + * + * This field has the same meaning as + * [rate in queue.yaml](/appengine/docs/standard/python/config/queueref#rate). + */ + maxTasksDispatchedPerSecond?: number; + } + interface RenewLeaseRequest { + /** + * Required. + * + * The desired new lease duration, starting from now. + * + * + * The maximum lease duration is 1 week. + * `new_lease_duration` will be truncated to the nearest second. + */ + newLeaseDuration?: string; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** + * Required. + * + * The task's current schedule time, available in the Task.schedule_time + * returned in PullTasksResponse.tasks or + * CloudTasks.RenewLease. This restriction is to check that + * the caller is renewing the correct task. + */ + scheduleTime?: string; + } + interface RetryConfig { + /** + * The maximum number of attempts for a task. + * + * Cloud Tasks will attempt the task `max_attempts` times (that + * is, if the first attempt fails, then there will be + * `max_attempts - 1` retries). Must be > 0. + */ + maxAttempts?: number; + /** + * The maximum amount of time to wait before retrying a task after + * it fails. The default is 1 hour. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 1 hour by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field + * is output only and always 0. + * + * `max_backoff` will be truncated to the nearest second. + * + * This field has the same meaning as + * [max_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxBackoff?: string; + /** + * The time between retries increases exponentially `max_doublings` times. + * `max_doublings` is maximum number of times that the interval between failed + * task retries will be doubled before the interval increases linearly. + * After max_doublings intervals, the retry interval will be + * 2^(max_doublings - 1) * RetryConfig.min_backoff. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 16 by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field + * is output only and always 0. + * + * This field has the same meaning as + * [max_doublings in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxDoublings?: number; + /** + * If positive, `max_retry_duration` specifies the time limit for retrying a + * failed task, measured from when the task was first attempted. Once + * `max_retry_duration` time has passed *and* the task has been attempted + * RetryConfig.max_attempts times, no further attempts will be made and + * the task will be deleted. + * + * If zero, then the task age is unlimited. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 0 seconds by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + * field is output only and always 0. + * + * `max_retry_duration` will be truncated to the nearest second. + * + * This field has the same meaning as + * [task_age_limit in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxRetryDuration?: string; + /** + * The minimum amount of time to wait before retrying a task after + * it fails. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 0.1 seconds by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + * field is output only and always 0. + * + * `min_backoff` will be truncated to the nearest second. + * + * This field has the same meaning as + * [min_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + minBackoff?: string; + /** If true, then the number of attempts is unlimited. */ + unlimitedAttempts?: boolean; + } + interface RunTaskRequest { + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface Task { + /** + * App Engine HTTP request that is sent to the task's target. Can be set + * only if Queue.app_engine_http_target is set. + * + * An App Engine task is a task that has AppEngineHttpRequest set. + */ + appEngineHttpRequest?: AppEngineHttpRequest; + /** Deprecated. Use Task.app_engine_http_request. */ + appEngineTaskTarget?: AppEngineTaskTarget; + /** + * Output only. + * + * The time that the task was created. + * + * `create_time` will be truncated to the nearest second. + */ + createTime?: string; + /** + * The task name. + * + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * * `PROJECT_ID` can contain uppercase and lowercase letters, + * numbers, hyphens, colons, and periods; that is, it must match + * the regular expression: `[a-zA-Z\\d-:\\.]+`. + * * `QUEUE_ID` can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * characters. + * * `TASK_ID` contain uppercase and lowercase letters, numbers, + * underscores, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d_-]+`. The maximum length is 500 + * characters. + * + * Optionally caller-specified in CreateTaskRequest. + */ + name?: string; + /** + * Pull message contains data that should be used by the caller of + * CloudTasks.PullTasks to process the task. Can be set only if + * Queue.pull_target is set. + * + * A pull task is a task that has PullMessage set. + */ + pullMessage?: PullMessage; + /** Deprecated. Use Task.pull_message. */ + pullTaskTarget?: PullTaskTarget; + /** + * The time when the task is scheduled to be attempted. + * + * For pull queues, this is the time when the task is available to + * be leased; if a task is currently leased, this is the time when + * the current lease expires, that is, the time that the task was + * leased plus the PullTasksRequest.lease_duration. + * + * For App Engine queues, this is when the task will be attempted or retried. + * + * `schedule_time` will be truncated to the nearest microsecond. + */ + scheduleTime?: string; + /** + * Output only. + * + * Task status. + */ + taskStatus?: TaskStatus; + /** + * Output only. + * + * The view specifies which subset of the Task has been + * returned. + */ + view?: string; + } + interface TaskStatus { + /** + * Output only. + * + * The number of attempts dispatched. This count includes tasks which have + * been dispatched but haven't received a response. + */ + attemptDispatchCount?: string; + /** + * Output only. + * + * The number of attempts which have received a response. + * + * This field is not calculated for + * [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + attemptResponseCount?: string; + /** + * Output only. + * + * The status of the task's first attempt. + * + * Only AttemptStatus.dispatch_time will be set. + * The other AttemptStatus information is not retained by Cloud Tasks. + * + * This field is not calculated for + * [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + firstAttemptStatus?: AttemptStatus; + /** + * Output only. + * + * The status of the task's last attempt. + * + * This field is not calculated for + * [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + lastAttemptStatus?: AttemptStatus; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface TasksResource { + /** + * Acknowledges a pull task. + * + * The lease holder, that is, the entity that received this task in + * a PullTasksResponse, must call this method to indicate that + * the work associated with the task has finished. + * + * The lease holder must acknowledge a task within the + * PullTasksRequest.lease_duration or the lease will expire and + * the task will become ready to be returned in a different + * PullTasksResponse. After the task is acknowledged, it will + * not be returned by a later CloudTasks.PullTasks, + * CloudTasks.GetTask, or CloudTasks.ListTasks. + */ + acknowledge(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Cancel a pull task's lease. + * + * The lease holder can use this method to cancel a task's lease + * by setting Task.schedule_time to now. This will make the task + * available to be leased to the next caller of CloudTasks.PullTasks. + */ + cancelLease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Creates a task and adds it to a queue. + * + * To add multiple tasks at the same time, use + * [HTTP batching](/storage/docs/json_api/v1/how-tos/batch) + * or the batching documentation for your client library, for example + * https://developers.google.com/api-client-library/python/guide/batch. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * the maximum task size is 100KB. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + * the maximum task size is 1MB. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has completed successfully or permanently + * failed. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a task. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists the tasks in a queue. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default due to performance + * considerations; ListTasksRequest.response_view controls the + * subset of information which is returned. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sort order used for the query. The fields supported for sorting + * are Task.schedule_time and PullMessage.tag. All results will be + * returned in ascending order. The default ordering is by + * Task.schedule_time. + */ + orderBy?: string; + /** + * Requested page size. Fewer tasks than requested might be returned. + * + * The maximum page size is 1000. If unspecified, the page size will + * be the maximum. Fewer tasks than requested might be returned, + * even if more tasks exist; use + * ListTasksResponse.next_page_token to determine if more tasks + * exist. + */ + pageSize?: number; + /** + * A token identifying the page of results to return. + * + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * ListTasksResponse.next_page_token returned from the previous + * call to CloudTasks.ListTasks method. + * + * The page token is valid for only 2 hours. + */ + pageToken?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Pulls tasks from a pull queue and acquires a lease on them for a + * specified PullTasksRequest.lease_duration. + * + * This method is invoked by the lease holder to obtain the + * lease. The lease holder must acknowledge the task via + * CloudTasks.AcknowledgeTask after they have performed the work + * associated with the task. + * + * The payload is intended to store data that the lease holder needs + * to perform the work associated with the task. To return the + * payloads in the PullTasksResponse, set + * PullTasksRequest.response_view to Task.View.FULL. + * + * A maximum of 10 qps of CloudTasks.PullTasks requests are allowed per + * queue. google.rpc.Code.RESOURCE_EXHAUSTED is returned when this limit + * is exceeded. google.rpc.Code.RESOURCE_EXHAUSTED is also returned when + * RateLimits.max_tasks_dispatched_per_second is exceeded. + */ + pull(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Renew the current lease of a pull task. + * + * The lease holder can use this method to extend the lease by a new + * duration, starting from now. The new task lease will be + * returned in Task.schedule_time. + */ + renewLease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Forces a task to run now. + * + * This command is meant to be used for manual debugging. For + * example, CloudTasks.RunTask can be used to retry a failed + * task after a fix has been made or to manually force a task to be + * dispatched now. + * + * When this method is called, Cloud Tasks will dispatch the task to its + * target, even if the queue is Queue.QueueState.PAUSED. + * + * The dispatched task is returned. That is, the task that is returned + * contains the Task.task_status after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * handler, then the task will be deleted; otherwise the task's + * Task.schedule_time will be reset to the time that + * CloudTasks.RunTask was called plus the retry delay specified + * in the queue and task's RetryConfig. + * + * CloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when + * it is called on a task that has already succeeded or permanently + * failed. google.rpc.Code.FAILED_PRECONDITION is returned when + * CloudTasks.RunTask is called on task that is dispatched or + * already running. + */ + run(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface QueuesResource { + /** + * Creates a queue. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. + * + * The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * google.cloud.location.Locations.ListLocations. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a queue. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a Queue. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Authorization requires the following [Google IAM](/iam) permission on the + * specified resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * `filter` can be used to specify a subset of queues. Any Queue + * field can be used as a filter and several operators as supported. + * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * described in + * [Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters). + * + * Sample filter "app_engine_http_target: *". + * + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. + * + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use + * ListQueuesResponse.next_page_token to determine if more + * queues exist. + */ + pageSize?: number; + /** + * A token identifying the page of results to return. + * + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * ListQueuesResponse.next_page_token returned from the previous + * call to CloudTasks.ListQueues method. It is an error to + * switch the value of ListQueuesRequest.filter while iterating + * through pages. + */ + pageToken?: string; + /** + * Required. + * + * The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The queue name. + * + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * * `PROJECT_ID` can contain uppercase and lowercase letters, + * numbers, hyphens, colons, and periods; that is, it must match + * the regular expression: `[a-zA-Z\\d-:\\.]+`. + * * `QUEUE_ID` can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * characters. + * + * Caller-specified and required in CreateQueueRequest, after which + * it becomes output only. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop executing the + * tasks in the queue until it is resumed via + * CloudTasks.ResumeQueue. Tasks can still be added when the + * queue is paused. The state of the queue is stored in + * Queue.queue_state; if paused it will be set to + * Queue.QueueState.PAUSED. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + pause(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + */ + purge(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * Queue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of + * a queue is stored in Queue.queue_state; after calling this method it + * will be set to Queue.QueueState.RUNNING. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf). + */ + resume(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy for a Queue. Replaces any existing + * policy. + * + * Authorization requires the following [Google IAM](/iam) permission on the + * specified resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on a Queue. + * If the resource does not exist, this will return an empty set of + * permissions, not a google.rpc.Code.NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + tasks: TasksResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name for the location. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + queues: QueuesResource; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudtasks/readme.md b/types/gapi.client.cloudtasks/readme.md new file mode 100644 index 0000000000..59a3b660e3 --- /dev/null +++ b/types/gapi.client.cloudtasks/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Cloud Tasks API v2beta2 +Manages the execution of large numbers of distributed requests. Cloud Tasks is in Alpha. +For detailed description please check [documentation](https://cloud.google.com/cloud-tasks/). + +## Installing + +Install typings for Cloud Tasks API: +``` +npm install @types/gapi.client.cloudtasks@v2beta2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudtasks', 'v2beta2', () => { + // now we can use gapi.client.cloudtasks + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Cloud Tasks API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudtasks/tsconfig.json b/types/gapi.client.cloudtasks/tsconfig.json new file mode 100644 index 0000000000..d4240ab7d4 --- /dev/null +++ b/types/gapi.client.cloudtasks/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudtasks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudtasks/tslint.json b/types/gapi.client.cloudtasks/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudtasks/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudtrace/gapi.client.cloudtrace-tests.ts b/types/gapi.client.cloudtrace/gapi.client.cloudtrace-tests.ts new file mode 100644 index 0000000000..96bc98ea32 --- /dev/null +++ b/types/gapi.client.cloudtrace/gapi.client.cloudtrace-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudtrace', 'v2', () => { + /** now we can use gapi.client.cloudtrace */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** Write Trace data for a project or application */ + 'https://www.googleapis.com/auth/trace.append', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudtrace/index.d.ts b/types/gapi.client.cloudtrace/index.d.ts new file mode 100644 index 0000000000..ba868581d1 --- /dev/null +++ b/types/gapi.client.cloudtrace/index.d.ts @@ -0,0 +1,378 @@ +// Type definitions for Google Stackdriver Trace API v2 2.0 +// Project: https://cloud.google.com/trace +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudtrace.googleapis.com/$discovery/rest?version=v2 + +/// + +declare namespace gapi.client { + /** Load Stackdriver Trace API v2 */ + function load(name: "cloudtrace", version: "v2"): PromiseLike; + function load(name: "cloudtrace", version: "v2", callback: () => any): void; + + const projects: cloudtrace.ProjectsResource; + + namespace cloudtrace { + interface Annotation { + /** + * A set of attributes on the annotation. There is a limit of 4 attributes + * per Annotation. + */ + attributes?: Attributes; + /** + * A user-supplied message describing the event. The maximum length for + * the description is 256 bytes. + */ + description?: TruncatableString; + } + interface AttributeValue { + /** A Boolean value represented by `true` or `false`. */ + boolValue?: boolean; + /** A 64-bit signed integer. */ + intValue?: string; + /** A string up to 256 bytes long. */ + stringValue?: TruncatableString; + } + interface Attributes { + /** + * The set of attributes. Each attribute's key can be up to 128 bytes + * long. The value can be a string up to 256 bytes, an integer, or the + * Boolean values `true` and `false`. For example: + * + * "/instance_id": "my-instance" + * "/http/user_agent": "" + * "/http/request_bytes": 300 + * "abc.com/myattribute": true + */ + attributeMap?: Record; + /** + * The number of attributes that were discarded. Attributes can be discarded + * because their keys are too long or because there are too many attributes. + * If this value is 0 then all attributes are valid. + */ + droppedAttributesCount?: number; + } + interface BatchWriteSpansRequest { + /** A collection of spans. */ + spans?: Span[]; + } + interface Link { + /** + * A set of attributes on the link. There is a limit of 32 attributes per + * link. + */ + attributes?: Attributes; + /** `SPAN_ID` identifies a span within a trace. */ + spanId?: string; + /** `TRACE_ID` identifies a trace within a project. */ + traceId?: string; + /** The relationship of the current span relative to the linked span. */ + type?: string; + } + interface Links { + /** + * The number of dropped links after the maximum size was enforced. If + * this value is 0, then no links were dropped. + */ + droppedLinksCount?: number; + /** A collection of links. */ + link?: Link[]; + } + interface Module { + /** + * A unique identifier for the module, usually a hash of its + * contents (up to 128 bytes). + */ + buildId?: TruncatableString; + /** + * For example: main binary, kernel modules, and dynamic libraries + * such as libc.so, sharedlib.so (up to 256 bytes). + */ + module?: TruncatableString; + } + interface NetworkEvent { + /** The number of compressed bytes sent or received. */ + compressedMessageSize?: string; + /** An identifier for the message, which must be unique in this span. */ + messageId?: string; + /** + * For sent messages, this is the time at which the first bit was sent. + * For received messages, this is the time at which the last bit was + * received. + */ + time?: string; + /** + * Type of NetworkEvent. Indicates whether the RPC message was sent or + * received. + */ + type?: string; + /** The number of uncompressed bytes sent or received. */ + uncompressedMessageSize?: string; + } + interface Span { + /** + * A set of attributes on the span. There is a limit of 32 attributes per + * span. + */ + attributes?: Attributes; + /** + * An optional number of child spans that were generated while this span + * was active. If set, allows implementation to detect missing child spans. + */ + childSpanCount?: number; + /** + * A description of the span's operation (up to 128 bytes). + * Stackdriver Trace displays the description in the + * {% dynamic print site_values.console_name %}. + * For example, the display name can be a qualified method name or a file name + * and a line number where the operation is called. A best practice is to use + * the same display name within an application and at the same call point. + * This makes it easier to correlate spans in different traces. + */ + displayName?: TruncatableString; + /** + * The end time of the span. On the client side, this is the time kept by + * the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + */ + endTime?: string; + /** A maximum of 128 links are allowed per Span. */ + links?: Links; + /** + * The resource name of the span in the following format: + * + * projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project. + * [SPAN_ID] is a unique identifier for a span within a trace, + * assigned when the span is created. + */ + name?: string; + /** + * The [SPAN_ID] of this span's parent span. If this is a root span, + * then this field must be empty. + */ + parentSpanId?: string; + /** + * A highly recommended but not required flag that identifies when a trace + * crosses a process boundary. True when the parent_span belongs to the + * same process as the current span. + */ + sameProcessAsParentSpan?: boolean; + /** The [SPAN_ID] portion of the span's resource name. */ + spanId?: string; + /** Stack trace captured at the start of the span. */ + stackTrace?: StackTrace; + /** + * The start time of the span. On the client side, this is the time kept by + * the local machine where the span execution starts. On the server side, this + * is the time when the server's application handler starts running. + */ + startTime?: string; + /** An optional final status for this span. */ + status?: Status; + /** + * The included time events. There can be up to 32 annotations and 128 network + * events per span. + */ + timeEvents?: TimeEvents; + } + interface StackFrame { + /** + * The column number where the function call appears, if available. + * This is important in JavaScript because of its anonymous functions. + */ + columnNumber?: string; + /** + * The name of the source file where the function call appears (up to 256 + * bytes). + */ + fileName?: TruncatableString; + /** + * The fully-qualified name that uniquely identifies the function or + * method that is active in this frame (up to 1024 bytes). + */ + functionName?: TruncatableString; + /** The line number in `file_name` where the function call appears. */ + lineNumber?: string; + /** The binary module from where the code was loaded. */ + loadModule?: Module; + /** + * An un-mangled function name, if `function_name` is + * [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can + * be fully-qualified (up to 1024 bytes). + */ + originalFunctionName?: TruncatableString; + /** The version of the deployed source code (up to 128 bytes). */ + sourceVersion?: TruncatableString; + } + interface StackFrames { + /** + * The number of stack frames that were dropped because there + * were too many stack frames. + * If this value is 0, then no stack frames were dropped. + */ + droppedFramesCount?: number; + /** Stack frames in this call stack. */ + frame?: StackFrame[]; + } + interface StackTrace { + /** Stack frames in this stack trace. A maximum of 128 frames are allowed. */ + stackFrames?: StackFrames; + /** + * The hash ID is used to conserve network bandwidth for duplicate + * stack traces within a single trace. + * + * Often multiple spans will have identical stack traces. + * The first occurrence of a stack trace should contain both the + * `stackFrame` content and a value in `stackTraceHashId`. + * + * Subsequent spans within the same request can refer + * to that stack trace by only setting `stackTraceHashId`. + */ + stackTraceHashId?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TimeEvent { + /** Text annotation with a set of attributes. */ + annotation?: Annotation; + /** An event describing an RPC message sent/received on the network. */ + networkEvent?: NetworkEvent; + /** The timestamp indicating the time the event occurred. */ + time?: string; + } + interface TimeEvents { + /** + * The number of dropped annotations in all the included time events. + * If the value is 0, then no annotations were dropped. + */ + droppedAnnotationsCount?: number; + /** + * The number of dropped network events in all the included time events. + * If the value is 0, then no network events were dropped. + */ + droppedNetworkEventsCount?: number; + /** A collection of `TimeEvent`s. */ + timeEvent?: TimeEvent[]; + } + interface TruncatableString { + /** + * The number of bytes removed from the original string. If this + * value is 0, then the string was not shortened. + */ + truncatedByteCount?: number; + /** + * The shortened string. For example, if the original string was 500 + * bytes long and the limit of the string was 128 bytes, then this + * value contains the first 128 bytes of the 500-byte string. Note that + * truncation always happens on the character boundary, to ensure that + * truncated string is still valid UTF8. In case of multi-byte characters, + * size of truncated string can be less than truncation limit. + */ + value?: string; + } + interface SpansResource { + /** Creates a new Span. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the span in the following format: + * + * projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project. + * [SPAN_ID] is a unique identifier for a span within a trace, + * assigned when the span is created. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TracesResource { + /** + * Sends new spans to Stackdriver Trace or updates existing traces. If the + * name of a trace that you send matches that of an existing trace, new spans + * are added to the existing trace. Attempt to update existing spans results + * undefined behavior. If the name does not match, a new trace is created + * with given set of spans. + */ + batchWrite(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. Name of the project where the spans belong. The format is + * `projects/PROJECT_ID`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + spans: SpansResource; + } + interface ProjectsResource { + traces: TracesResource; + } + } +} diff --git a/types/gapi.client.cloudtrace/readme.md b/types/gapi.client.cloudtrace/readme.md new file mode 100644 index 0000000000..c7c8408a0b --- /dev/null +++ b/types/gapi.client.cloudtrace/readme.md @@ -0,0 +1,58 @@ +# TypeScript typings for Stackdriver Trace API v2 +Send and retrieve trace data from Stackdriver Trace. Data is generated and available by default for all App Engine applications. Data from other applications can be written to Stackdriver Trace for display, reporting, and analysis. + +For detailed description please check [documentation](https://cloud.google.com/trace). + +## Installing + +Install typings for Stackdriver Trace API: +``` +npm install @types/gapi.client.cloudtrace@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudtrace', 'v2', () => { + // now we can use gapi.client.cloudtrace + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // Write Trace data for a project or application + 'https://www.googleapis.com/auth/trace.append', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Stackdriver Trace API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudtrace/tsconfig.json b/types/gapi.client.cloudtrace/tsconfig.json new file mode 100644 index 0000000000..977a1fd91f --- /dev/null +++ b/types/gapi.client.cloudtrace/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudtrace-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudtrace/tslint.json b/types/gapi.client.cloudtrace/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudtrace/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.clouduseraccounts/gapi.client.clouduseraccounts-tests.ts b/types/gapi.client.clouduseraccounts/gapi.client.clouduseraccounts-tests.ts new file mode 100644 index 0000000000..29c552c543 --- /dev/null +++ b/types/gapi.client.clouduseraccounts/gapi.client.clouduseraccounts-tests.ts @@ -0,0 +1,169 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('clouduseraccounts', 'vm_alpha', () => { + /** now we can use gapi.client.clouduseraccounts */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** Manage your Google Cloud User Accounts */ + 'https://www.googleapis.com/auth/cloud.useraccounts', + /** View your Google Cloud User Accounts */ + 'https://www.googleapis.com/auth/cloud.useraccounts.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes the specified operation resource. */ + await gapi.client.globalAccountsOperations.delete({ + operation: "operation", + project: "project", + }); + /** Retrieves the specified operation resource. */ + await gapi.client.globalAccountsOperations.get({ + operation: "operation", + project: "project", + }); + /** Retrieves the list of operation resources contained within the specified project. */ + await gapi.client.globalAccountsOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Adds users to the specified group. */ + await gapi.client.groups.addMember({ + groupName: "groupName", + project: "project", + }); + /** Deletes the specified Group resource. */ + await gapi.client.groups.delete({ + groupName: "groupName", + project: "project", + }); + /** Returns the specified Group resource. */ + await gapi.client.groups.get({ + groupName: "groupName", + project: "project", + }); + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + await gapi.client.groups.getIamPolicy({ + project: "project", + resource: "resource", + }); + /** Creates a Group resource in the specified project using the data included in the request. */ + await gapi.client.groups.insert({ + project: "project", + }); + /** Retrieves the list of groups contained within the specified project. */ + await gapi.client.groups.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Removes users from the specified group. */ + await gapi.client.groups.removeMember({ + groupName: "groupName", + project: "project", + }); + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + await gapi.client.groups.setIamPolicy({ + project: "project", + resource: "resource", + }); + /** Returns permissions that a caller has on the specified resource. */ + await gapi.client.groups.testIamPermissions({ + project: "project", + resource: "resource", + }); + /** Returns a list of authorized public keys for a specific user account. */ + await gapi.client.linux.getAuthorizedKeysView({ + instance: "instance", + login: true, + project: "project", + user: "user", + zone: "zone", + }); + /** Retrieves a list of user accounts for an instance within a specific project. */ + await gapi.client.linux.getLinuxAccountViews({ + filter: "filter", + instance: "instance", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Adds a public key to the specified User resource with the data included in the request. */ + await gapi.client.users.addPublicKey({ + project: "project", + user: "user", + }); + /** Deletes the specified User resource. */ + await gapi.client.users.delete({ + project: "project", + user: "user", + }); + /** Returns the specified User resource. */ + await gapi.client.users.get({ + project: "project", + user: "user", + }); + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + await gapi.client.users.getIamPolicy({ + project: "project", + resource: "resource", + }); + /** Creates a User resource in the specified project using the data included in the request. */ + await gapi.client.users.insert({ + project: "project", + }); + /** Retrieves a list of users contained within the specified project. */ + await gapi.client.users.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Removes the specified public key from the user. */ + await gapi.client.users.removePublicKey({ + fingerprint: "fingerprint", + project: "project", + user: "user", + }); + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + await gapi.client.users.setIamPolicy({ + project: "project", + resource: "resource", + }); + /** Returns permissions that a caller has on the specified resource. */ + await gapi.client.users.testIamPermissions({ + project: "project", + resource: "resource", + }); + } +}); diff --git a/types/gapi.client.clouduseraccounts/index.d.ts b/types/gapi.client.clouduseraccounts/index.d.ts new file mode 100644 index 0000000000..75e8f0d852 --- /dev/null +++ b/types/gapi.client.clouduseraccounts/index.d.ts @@ -0,0 +1,1084 @@ +// Type definitions for Google Cloud User Accounts API vm_alpha 0.0 +// Project: https://cloud.google.com/compute/docs/access/user-accounts/api/latest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/clouduseraccounts/vm_alpha/rest + +/// + +declare namespace gapi.client { + /** Load Cloud User Accounts API vm_alpha */ + function load(name: "clouduseraccounts", version: "vm_alpha"): PromiseLike; + function load(name: "clouduseraccounts", version: "vm_alpha", callback: () => any): void; + + const globalAccountsOperations: clouduseraccounts.GlobalAccountsOperationsResource; + + const groups: clouduseraccounts.GroupsResource; + + const linux: clouduseraccounts.LinuxResource; + + const users: clouduseraccounts.UsersResource; + + namespace clouduseraccounts { + interface AuditConfig { + /** + * Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of + * Binding.members. + */ + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for "data access" audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a + * special value that covers all services. + */ + service?: string; + } + interface AuthorizedKeysView { + /** [Output Only] The list of authorized public keys in SSH format. */ + keys?: string[]; + /** [Output Only] Whether the user has the ability to elevate on the instance that requested the authorized keys. */ + sudoer?: boolean; + } + interface Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. + * + * * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. + * + * * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */ + role?: string; + } + interface Condition { + /** Trusted attributes supplied by the IAM system. */ + iam?: string; + /** An operator to apply the subject with. */ + op?: string; + /** Trusted attributes discharged by the service. */ + svc?: string; + /** Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. */ + sys?: string; + /** The object of the condition. Exactly one of these must be set. */ + value?: string; + /** The objects of the condition. This is mutually exclusive with 'value'. */ + values?: string[]; + } + interface Group { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always clouduseraccounts#group for groups. */ + kind?: string; + /** [Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project. */ + members?: string[]; + /** Name of the resource; provided by the client when the resource is created. */ + name?: string; + /** [Output Only] Server defined URL for the resource. */ + selfLink?: string; + } + interface GroupList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] A list of Group resources. */ + items?: Group[]; + /** [Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups. */ + kind?: string; + /** [Output Only] A token used to continue a truncated list request. */ + nextPageToken?: string; + /** [Output Only] Server defined URL for this resource. */ + selfLink?: string; + } + interface GroupsAddMemberRequest { + /** Fully-qualified URLs of the User resources to add. */ + users?: string[]; + } + interface GroupsRemoveMemberRequest { + /** Fully-qualified URLs of the User resources to remove. */ + users?: string[]; + } + interface LinuxAccountViews { + /** [Output Only] A list of all groups within a project. */ + groupViews?: LinuxGroupView[]; + /** [Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources. */ + kind?: string; + /** [Output Only] A list of all users within a project. */ + userViews?: LinuxUserView[]; + } + interface LinuxGetAuthorizedKeysViewResponse { + /** [Output Only] A list of authorized public keys for a user. */ + resource?: AuthorizedKeysView; + } + interface LinuxGetLinuxAccountViewsResponse { + /** [Output Only] A list of authorized user accounts and groups. */ + resource?: LinuxAccountViews; + } + interface LinuxGroupView { + /** [Output Only] The Group ID. */ + gid?: number; + /** [Output Only] Group name. */ + groupName?: string; + /** [Output Only] List of user accounts that belong to the group. */ + members?: string[]; + } + interface LinuxUserView { + /** [Output Only] The GECOS (user information) entry for this account. */ + gecos?: string; + /** [Output Only] User's default group ID. */ + gid?: number; + /** [Output Only] The path to the home directory for this account. */ + homeDirectory?: string; + /** [Output Only] The path to the login shell for this account. */ + shell?: string; + /** [Output Only] User ID. */ + uid?: number; + /** [Output Only] The username of the account. */ + username?: string; + } + interface LogConfig { + /** Counter options. */ + counter?: LogConfigCounterOptions; + } + interface LogConfigCounterOptions { + /** The field value to attribute. */ + field?: string; + /** The metric to update. */ + metric?: string; + } + interface Operation { + /** [Output Only] Reserved for future use. */ + clientOperationId?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] A textual description of the operation, which is set when the operation is created. */ + description?: string; + /** [Output Only] The time that this operation was completed. This value is in RFC3339 text format. */ + endTime?: string; + /** [Output Only] If errors are generated during processing of the operation, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. */ + httpErrorMessage?: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not + * found. + */ + httpErrorStatusCode?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The time that this operation was requested. This value is in RFC3339 text format. */ + insertTime?: string; + /** [Output Only] Type of the resource. Always compute#operation for Operation resources. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] The type of operation, such as insert, update, or delete, and so on. */ + operationType?: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation + * progresses. + */ + progress?: number; + /** [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. */ + startTime?: string; + /** [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. */ + status?: string; + /** [Output Only] An optional textual description of the current status of the operation. */ + statusMessage?: string; + /** [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. */ + targetId?: string; + /** [Output Only] The URL of the resource that the operation modifies. */ + targetLink?: string; + /** [Output Only] User who requested the operation, for example: user@example.com. */ + user?: string; + /** [Output Only] If warning messages are generated during processing of the operation, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + /** [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. */ + zone?: string; + } + interface OperationList { + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] A list of Operation resources. */ + items?: Operation[]; + /** [Output Only] Type of resource. Always compute#operations for Operations resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + } + interface Policy { + /** + * Specifies audit logging configs for "data access". "data access": generally refers to data reads/writes and admin reads. "admin activity": generally + * refers to admin writes. + * + * Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging. + */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an + * error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly + * suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is + * returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will + * be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** + * If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any + * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no + * rule applies, permission is denied. + */ + rules?: Rule[]; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface PublicKey { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires. */ + expirationTimestamp?: string; + /** [Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key. */ + fingerprint?: string; + /** Public key text in SSH format, defined by RFC4253 section 6.6. */ + key?: string; + } + interface Rule { + /** Required */ + action?: string; + /** Additional restrictions that must be met */ + conditions?: Condition[]; + /** Human-readable description of the rule. */ + description?: string; + /** The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of entries. */ + ins?: string[]; + /** The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. */ + logConfigs?: LogConfig[]; + /** The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of entries. */ + notIns?: string[]; + /** + * A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions?: string[]; + } + interface TestPermissionsRequest { + /** The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. */ + permissions?: string[]; + } + interface TestPermissionsResponse { + /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */ + permissions?: string[]; + } + interface User { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** [Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project. */ + groups?: string[]; + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always clouduseraccounts#user for users. */ + kind?: string; + /** Name of the resource; provided by the client when the resource is created. */ + name?: string; + /** + * Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a + * Google account. + */ + owner?: string; + /** [Output Only] Public keys that this user may use to login. */ + publicKeys?: PublicKey[]; + /** [Output Only] Server defined URL for the resource. */ + selfLink?: string; + } + interface UserList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] A list of User resources. */ + items?: User[]; + /** [Output Only] Type of resource. Always clouduseraccounts#userList for lists of users. */ + kind?: string; + /** [Output Only] A token used to continue a truncated list request. */ + nextPageToken?: string; + /** [Output Only] Server defined URL for this resource. */ + selfLink?: string; + } + interface GlobalAccountsOperationsResource { + /** Deletes the specified operation resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the specified operation resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of operation resources contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GroupsResource { + /** Adds users to the specified group. */ + addMember(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the group for this request. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified Group resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the Group resource to delete. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Group resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the Group resource to return. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + getIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Group resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of groups contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes users from the specified group. */ + removeMember(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the group for this request. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + setIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns permissions that a caller has on the specified resource. */ + testIamPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface LinuxResource { + /** Returns a list of authorized public keys for a specific user account. */ + getAuthorizedKeysView(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The fully-qualified URL of the virtual machine requesting the view. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Whether the view was requested as part of a user-initiated login. */ + login?: boolean; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The user account for which you want to get a list of authorized public keys. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of user accounts for an instance within a specific project. */ + getLinuxAccountViews(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** The fully-qualified URL of the virtual machine requesting the views. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + } + interface UsersResource { + /** Adds a public key to the specified User resource with the data included in the request. */ + addPublicKey(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user for this request. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified User resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user resource to delete. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified User resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user resource to return. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + getIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a User resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of users contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes the specified public key from the user. */ + removePublicKey(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the + * public key. + */ + fingerprint: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user for this request. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + setIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns permissions that a caller has on the specified resource. */ + testIamPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.clouduseraccounts/readme.md b/types/gapi.client.clouduseraccounts/readme.md new file mode 100644 index 0000000000..fb442397ca --- /dev/null +++ b/types/gapi.client.clouduseraccounts/readme.md @@ -0,0 +1,178 @@ +# TypeScript typings for Cloud User Accounts API vm_alpha +Creates and manages users and groups for accessing Google Compute Engine virtual machines. +For detailed description please check [documentation](https://cloud.google.com/compute/docs/access/user-accounts/api/latest/). + +## Installing + +Install typings for Cloud User Accounts API: +``` +npm install @types/gapi.client.clouduseraccounts@vm_alpha --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('clouduseraccounts', 'vm_alpha', () => { + // now we can use gapi.client.clouduseraccounts + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // Manage your Google Cloud User Accounts + 'https://www.googleapis.com/auth/cloud.useraccounts', + + // View your Google Cloud User Accounts + 'https://www.googleapis.com/auth/cloud.useraccounts.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Cloud User Accounts API resources: + +```typescript + +/* +Deletes the specified operation resource. +*/ +await gapi.client.globalAccountsOperations.delete({ operation: "operation", project: "project", }); + +/* +Retrieves the specified operation resource. +*/ +await gapi.client.globalAccountsOperations.get({ operation: "operation", project: "project", }); + +/* +Retrieves the list of operation resources contained within the specified project. +*/ +await gapi.client.globalAccountsOperations.list({ project: "project", }); + +/* +Adds users to the specified group. +*/ +await gapi.client.groups.addMember({ groupName: "groupName", project: "project", }); + +/* +Deletes the specified Group resource. +*/ +await gapi.client.groups.delete({ groupName: "groupName", project: "project", }); + +/* +Returns the specified Group resource. +*/ +await gapi.client.groups.get({ groupName: "groupName", project: "project", }); + +/* +Gets the access control policy for a resource. May be empty if no such policy or resource exists. +*/ +await gapi.client.groups.getIamPolicy({ project: "project", resource: "resource", }); + +/* +Creates a Group resource in the specified project using the data included in the request. +*/ +await gapi.client.groups.insert({ project: "project", }); + +/* +Retrieves the list of groups contained within the specified project. +*/ +await gapi.client.groups.list({ project: "project", }); + +/* +Removes users from the specified group. +*/ +await gapi.client.groups.removeMember({ groupName: "groupName", project: "project", }); + +/* +Sets the access control policy on the specified resource. Replaces any existing policy. +*/ +await gapi.client.groups.setIamPolicy({ project: "project", resource: "resource", }); + +/* +Returns permissions that a caller has on the specified resource. +*/ +await gapi.client.groups.testIamPermissions({ project: "project", resource: "resource", }); + +/* +Returns a list of authorized public keys for a specific user account. +*/ +await gapi.client.linux.getAuthorizedKeysView({ instance: "instance", project: "project", user: "user", zone: "zone", }); + +/* +Retrieves a list of user accounts for an instance within a specific project. +*/ +await gapi.client.linux.getLinuxAccountViews({ instance: "instance", project: "project", zone: "zone", }); + +/* +Adds a public key to the specified User resource with the data included in the request. +*/ +await gapi.client.users.addPublicKey({ project: "project", user: "user", }); + +/* +Deletes the specified User resource. +*/ +await gapi.client.users.delete({ project: "project", user: "user", }); + +/* +Returns the specified User resource. +*/ +await gapi.client.users.get({ project: "project", user: "user", }); + +/* +Gets the access control policy for a resource. May be empty if no such policy or resource exists. +*/ +await gapi.client.users.getIamPolicy({ project: "project", resource: "resource", }); + +/* +Creates a User resource in the specified project using the data included in the request. +*/ +await gapi.client.users.insert({ project: "project", }); + +/* +Retrieves a list of users contained within the specified project. +*/ +await gapi.client.users.list({ project: "project", }); + +/* +Removes the specified public key from the user. +*/ +await gapi.client.users.removePublicKey({ fingerprint: "fingerprint", project: "project", user: "user", }); + +/* +Sets the access control policy on the specified resource. Replaces any existing policy. +*/ +await gapi.client.users.setIamPolicy({ project: "project", resource: "resource", }); + +/* +Returns permissions that a caller has on the specified resource. +*/ +await gapi.client.users.testIamPermissions({ project: "project", resource: "resource", }); +``` \ No newline at end of file diff --git a/types/gapi.client.clouduseraccounts/tsconfig.json b/types/gapi.client.clouduseraccounts/tsconfig.json new file mode 100644 index 0000000000..a6e3b9ffec --- /dev/null +++ b/types/gapi.client.clouduseraccounts/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.clouduseraccounts-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.clouduseraccounts/tslint.json b/types/gapi.client.clouduseraccounts/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.clouduseraccounts/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.compute/gapi.client.compute-tests.ts b/types/gapi.client.compute/gapi.client.compute-tests.ts new file mode 100644 index 0000000000..7ebfeccdcd --- /dev/null +++ b/types/gapi.client.compute/gapi.client.compute-tests.ts @@ -0,0 +1,2184 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('compute', 'v1', () => { + /** now we can use gapi.client.compute */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute', + /** View your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute.readonly', + /** Manage your data and permissions in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.full_control', + /** View your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_only', + /** Manage your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_write', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves an aggregated list of accelerator types. */ + await gapi.client.acceleratorTypes.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. */ + await gapi.client.acceleratorTypes.get({ + acceleratorType: "acceleratorType", + project: "project", + zone: "zone", + }); + /** Retrieves a list of accelerator types available to the specified project. */ + await gapi.client.acceleratorTypes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Retrieves an aggregated list of addresses. */ + await gapi.client.addresses.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified address resource. */ + await gapi.client.addresses.delete({ + address: "address", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified address resource. */ + await gapi.client.addresses.get({ + address: "address", + project: "project", + region: "region", + }); + /** Creates an address resource in the specified project using the data included in the request. */ + await gapi.client.addresses.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of addresses contained within the specified region. */ + await gapi.client.addresses.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Retrieves an aggregated list of autoscalers. */ + await gapi.client.autoscalers.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified autoscaler. */ + await gapi.client.autoscalers.delete({ + autoscaler: "autoscaler", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. */ + await gapi.client.autoscalers.get({ + autoscaler: "autoscaler", + project: "project", + zone: "zone", + }); + /** Creates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.autoscalers.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves a list of autoscalers contained within the specified zone. */ + await gapi.client.autoscalers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + await gapi.client.autoscalers.patch({ + autoscaler: "autoscaler", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Updates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.autoscalers.update({ + autoscaler: "autoscaler", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Deletes the specified BackendBucket resource. */ + await gapi.client.backendBuckets.delete({ + backendBucket: "backendBucket", + project: "project", + requestId: "requestId", + }); + /** Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. */ + await gapi.client.backendBuckets.get({ + backendBucket: "backendBucket", + project: "project", + }); + /** Creates a BackendBucket resource in the specified project using the data included in the request. */ + await gapi.client.backendBuckets.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of BackendBucket resources available to the specified project. */ + await gapi.client.backendBuckets.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + await gapi.client.backendBuckets.patch({ + backendBucket: "backendBucket", + project: "project", + requestId: "requestId", + }); + /** Updates the specified BackendBucket resource with the data included in the request. */ + await gapi.client.backendBuckets.update({ + backendBucket: "backendBucket", + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of all BackendService resources, regional and global, available to the specified project. */ + await gapi.client.backendServices.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified BackendService resource. */ + await gapi.client.backendServices.delete({ + backendService: "backendService", + project: "project", + requestId: "requestId", + }); + /** Returns the specified BackendService resource. Get a list of available backend services by making a list() request. */ + await gapi.client.backendServices.get({ + backendService: "backendService", + project: "project", + }); + /** Gets the most recent health check results for this BackendService. */ + await gapi.client.backendServices.getHealth({ + backendService: "backendService", + project: "project", + }); + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to + * keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.backendServices.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of BackendService resources available to the specified project. */ + await gapi.client.backendServices.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + await gapi.client.backendServices.patch({ + backendService: "backendService", + project: "project", + requestId: "requestId", + }); + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.backendServices.update({ + backendService: "backendService", + project: "project", + requestId: "requestId", + }); + /** Retrieves an aggregated list of disk types. */ + await gapi.client.diskTypes.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified disk type. Get a list of available disk types by making a list() request. */ + await gapi.client.diskTypes.get({ + diskType: "diskType", + project: "project", + zone: "zone", + }); + /** Retrieves a list of disk types available to the specified project. */ + await gapi.client.diskTypes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Retrieves an aggregated list of persistent disks. */ + await gapi.client.disks.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Creates a snapshot of a specified persistent disk. */ + await gapi.client.disks.createSnapshot({ + disk: "disk", + guestFlush: true, + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any + * snapshots previously made from the disk. You must separately delete snapshots. + */ + await gapi.client.disks.delete({ + disk: "disk", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. */ + await gapi.client.disks.get({ + disk: "disk", + project: "project", + zone: "zone", + }); + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create + * an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb + * property. + */ + await gapi.client.disks.insert({ + project: "project", + requestId: "requestId", + sourceImage: "sourceImage", + zone: "zone", + }); + /** Retrieves a list of persistent disks contained within the specified zone. */ + await gapi.client.disks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Resizes the specified persistent disk. */ + await gapi.client.disks.resize({ + disk: "disk", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.disks.setLabels({ + project: "project", + requestId: "requestId", + resource: "resource", + zone: "zone", + }); + /** Deletes the specified firewall. */ + await gapi.client.firewalls.delete({ + firewall: "firewall", + project: "project", + requestId: "requestId", + }); + /** Returns the specified firewall. */ + await gapi.client.firewalls.get({ + firewall: "firewall", + project: "project", + }); + /** Creates a firewall rule in the specified project using the data included in the request. */ + await gapi.client.firewalls.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of firewall rules available to the specified project. */ + await gapi.client.firewalls.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + await gapi.client.firewalls.patch({ + firewall: "firewall", + project: "project", + requestId: "requestId", + }); + /** + * Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: + * allowed, description, sourceRanges, sourceTags, targetTags. + */ + await gapi.client.firewalls.update({ + firewall: "firewall", + project: "project", + requestId: "requestId", + }); + /** Retrieves an aggregated list of forwarding rules. */ + await gapi.client.forwardingRules.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified ForwardingRule resource. */ + await gapi.client.forwardingRules.delete({ + forwardingRule: "forwardingRule", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified ForwardingRule resource. */ + await gapi.client.forwardingRules.get({ + forwardingRule: "forwardingRule", + project: "project", + region: "region", + }); + /** Creates a ForwardingRule resource in the specified project and region using the data included in the request. */ + await gapi.client.forwardingRules.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of ForwardingRule resources available to the specified project and region. */ + await gapi.client.forwardingRules.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Changes target URL for forwarding rule. The new target should be of the same type as the old target. */ + await gapi.client.forwardingRules.setTarget({ + forwardingRule: "forwardingRule", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified address resource. */ + await gapi.client.globalAddresses.delete({ + address: "address", + project: "project", + requestId: "requestId", + }); + /** Returns the specified address resource. Get a list of available addresses by making a list() request. */ + await gapi.client.globalAddresses.get({ + address: "address", + project: "project", + }); + /** Creates an address resource in the specified project using the data included in the request. */ + await gapi.client.globalAddresses.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves a list of global addresses. */ + await gapi.client.globalAddresses.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified GlobalForwardingRule resource. */ + await gapi.client.globalForwardingRules.delete({ + forwardingRule: "forwardingRule", + project: "project", + requestId: "requestId", + }); + /** Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. */ + await gapi.client.globalForwardingRules.get({ + forwardingRule: "forwardingRule", + project: "project", + }); + /** Creates a GlobalForwardingRule resource in the specified project using the data included in the request. */ + await gapi.client.globalForwardingRules.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves a list of GlobalForwardingRule resources available to the specified project. */ + await gapi.client.globalForwardingRules.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. */ + await gapi.client.globalForwardingRules.setTarget({ + forwardingRule: "forwardingRule", + project: "project", + requestId: "requestId", + }); + /** Retrieves an aggregated list of all operations. */ + await gapi.client.globalOperations.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified Operations resource. */ + await gapi.client.globalOperations.delete({ + operation: "operation", + project: "project", + }); + /** Retrieves the specified Operations resource. Get a list of operations by making a list() request. */ + await gapi.client.globalOperations.get({ + operation: "operation", + project: "project", + }); + /** Retrieves a list of Operation resources contained within the specified project. */ + await gapi.client.globalOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified HealthCheck resource. */ + await gapi.client.healthChecks.delete({ + healthCheck: "healthCheck", + project: "project", + requestId: "requestId", + }); + /** Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. */ + await gapi.client.healthChecks.get({ + healthCheck: "healthCheck", + project: "project", + }); + /** Creates a HealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.healthChecks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of HealthCheck resources available to the specified project. */ + await gapi.client.healthChecks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + await gapi.client.healthChecks.patch({ + healthCheck: "healthCheck", + project: "project", + requestId: "requestId", + }); + /** Updates a HealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.healthChecks.update({ + healthCheck: "healthCheck", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified HttpHealthCheck resource. */ + await gapi.client.httpHealthChecks.delete({ + httpHealthCheck: "httpHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. */ + await gapi.client.httpHealthChecks.get({ + httpHealthCheck: "httpHealthCheck", + project: "project", + }); + /** Creates a HttpHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpHealthChecks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of HttpHealthCheck resources available to the specified project. */ + await gapi.client.httpHealthChecks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + await gapi.client.httpHealthChecks.patch({ + httpHealthCheck: "httpHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Updates a HttpHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpHealthChecks.update({ + httpHealthCheck: "httpHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified HttpsHealthCheck resource. */ + await gapi.client.httpsHealthChecks.delete({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. */ + await gapi.client.httpsHealthChecks.get({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + }); + /** Creates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpsHealthChecks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of HttpsHealthCheck resources available to the specified project. */ + await gapi.client.httpsHealthChecks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + await gapi.client.httpsHealthChecks.patch({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Updates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpsHealthChecks.update({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified image. */ + await gapi.client.images.delete({ + image: "image", + project: "project", + requestId: "requestId", + }); + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + */ + await gapi.client.images.deprecate({ + image: "image", + project: "project", + requestId: "requestId", + }); + /** Returns the specified image. Get a list of available images by making a list() request. */ + await gapi.client.images.get({ + image: "image", + project: "project", + }); + /** Returns the latest image that is part of an image family and is not deprecated. */ + await gapi.client.images.getFromFamily({ + family: "family", + project: "project", + }); + /** Creates an image in the specified project using the data included in the request. */ + await gapi.client.images.insert({ + forceCreate: true, + project: "project", + requestId: "requestId", + }); + /** + * Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method + * does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of + * publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + */ + await gapi.client.images.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.images.setLabels({ + project: "project", + resource: "resource", + }); + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.instanceGroupManagers.abandonInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of managed instance groups and groups them by zone. */ + await gapi.client.instanceGroupManagers.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. + * Read Deleting an instance group for more information. + */ + await gapi.client.instanceGroupManagers.delete({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.instanceGroupManagers.deleteInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. */ + await gapi.client.instanceGroupManagers.get({ + instanceGroupManager: "instanceGroupManager", + project: "project", + zone: "zone", + }); + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + */ + await gapi.client.instanceGroupManagers.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves a list of managed instance groups that are contained within the specified project and zone. */ + await gapi.client.instanceGroupManagers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed + * instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous + * action failed, the list displays the errors for that failed action. + */ + await gapi.client.instanceGroupManagers.listManagedInstances({ + filter: "filter", + instanceGroupManager: "instanceGroupManager", + maxResults: 3, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.instanceGroupManagers.recreateInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the + * size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or + * deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + await gapi.client.instanceGroupManagers.resize({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + size: 4, + zone: "zone", + }); + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change + * unless you recreate them. + */ + await gapi.client.instanceGroupManagers.setInstanceTemplate({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the + * instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their + * target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + */ + await gapi.client.instanceGroupManagers.setTargetPools({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read + * Adding instances for more information. + */ + await gapi.client.instanceGroups.addInstances({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of instance groups and sorts them by zone. */ + await gapi.client.instanceGroups.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read + * Deleting an instance group for more information. + */ + await gapi.client.instanceGroups.delete({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified instance group. Get a list of available instance groups by making a list() request. */ + await gapi.client.instanceGroups.get({ + instanceGroup: "instanceGroup", + project: "project", + zone: "zone", + }); + /** Creates an instance group in the specified project using the parameters that are included in the request. */ + await gapi.client.instanceGroups.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of instance groups that are located in the specified project and zone. */ + await gapi.client.instanceGroups.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Lists the instances in the specified instance group. */ + await gapi.client.instanceGroups.listInstances({ + filter: "filter", + instanceGroup: "instanceGroup", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration + * before the VM instance is removed or deleted. + */ + await gapi.client.instanceGroups.removeInstances({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the named ports for the specified instance group. */ + await gapi.client.instanceGroups.setNamedPorts({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group + * will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + */ + await gapi.client.instanceTemplates.delete({ + instanceTemplate: "instanceTemplate", + project: "project", + requestId: "requestId", + }); + /** Returns the specified instance template. Get a list of available instance templates by making a list() request. */ + await gapi.client.instanceTemplates.get({ + instanceTemplate: "instanceTemplate", + project: "project", + }); + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an + * existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + */ + await gapi.client.instanceTemplates.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves a list of instance templates that are contained within the specified project and zone. */ + await gapi.client.instanceTemplates.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Adds an access config to an instance's network interface. */ + await gapi.client.instances.addAccessConfig({ + instance: "instance", + networkInterface: "networkInterface", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves aggregated list of instances. */ + await gapi.client.instances.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a + * disk at the same time. For more information, read Adding a persistent disk to your instance. + */ + await gapi.client.instances.attachDisk({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. */ + await gapi.client.instances.delete({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Deletes an access config from an instance's network interface. */ + await gapi.client.instances.deleteAccessConfig({ + accessConfig: "accessConfig", + instance: "instance", + networkInterface: "networkInterface", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Detaches a disk from an instance. */ + await gapi.client.instances.detachDisk({ + deviceName: "deviceName", + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified Instance resource. Get a list of available instances by making a list() request. */ + await gapi.client.instances.get({ + instance: "instance", + project: "project", + zone: "zone", + }); + /** Returns the specified instance's serial port output. */ + await gapi.client.instances.getSerialPortOutput({ + instance: "instance", + port: 2, + project: "project", + start: "start", + zone: "zone", + }); + /** Creates an instance resource in the specified project using the data included in the request. */ + await gapi.client.instances.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of instances contained within the specified zone. */ + await gapi.client.instances.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Performs a reset on the instance. For more information, see Resetting an instance. */ + await gapi.client.instances.reset({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the auto-delete flag for a disk attached to an instance. */ + await gapi.client.instances.setDiskAutoDelete({ + autoDelete: true, + deviceName: "deviceName", + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.instances.setLabels({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. */ + await gapi.client.instances.setMachineResources({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Changes the machine type for a stopped instance to the machine type specified in the request. */ + await gapi.client.instances.setMachineType({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets metadata for the specified instance to the data included in the request. */ + await gapi.client.instances.setMetadata({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read + * Specifying a Minimum CPU Platform. + */ + await gapi.client.instances.setMinCpuPlatform({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets an instance's scheduling options. */ + await gapi.client.instances.setScheduling({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. */ + await gapi.client.instances.setServiceAccount({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets tags for the specified instance to the data included in the request. */ + await gapi.client.instances.setTags({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + await gapi.client.instances.start({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + await gapi.client.instances.startWithEncryptionKey({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, + * virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP + * addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + */ + await gapi.client.instances.stop({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified License resource. */ + await gapi.client.licenses.get({ + license: "license", + project: "project", + }); + /** Retrieves an aggregated list of machine types. */ + await gapi.client.machineTypes.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified machine type. Get a list of available machine types by making a list() request. */ + await gapi.client.machineTypes.get({ + machineType: "machineType", + project: "project", + zone: "zone", + }); + /** Retrieves a list of machine types available to the specified project. */ + await gapi.client.machineTypes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Adds a peering to the specified network. */ + await gapi.client.networks.addPeering({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified network. */ + await gapi.client.networks.delete({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Returns the specified network. Get a list of available networks by making a list() request. */ + await gapi.client.networks.get({ + network: "network", + project: "project", + }); + /** Creates a network in the specified project using the data included in the request. */ + await gapi.client.networks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of networks available to the specified project. */ + await gapi.client.networks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Patches the specified network with the data included in the request. */ + await gapi.client.networks.patch({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Removes a peering from the specified network. */ + await gapi.client.networks.removePeering({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Switches the network mode from auto subnet mode to custom subnet mode. */ + await gapi.client.networks.switchToCustomMode({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Disable this project as a shared VPC host project. */ + await gapi.client.projects.disableXpnHost({ + project: "project", + requestId: "requestId", + }); + /** Disable a serivce resource (a.k.a service project) associated with this host project. */ + await gapi.client.projects.disableXpnResource({ + project: "project", + requestId: "requestId", + }); + /** Enable this project as a shared VPC host project. */ + await gapi.client.projects.enableXpnHost({ + project: "project", + requestId: "requestId", + }); + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service + * project. + */ + await gapi.client.projects.enableXpnResource({ + project: "project", + requestId: "requestId", + }); + /** Returns the specified Project resource. */ + await gapi.client.projects.get({ + project: "project", + }); + /** Get the shared VPC host project that this project links to. May be empty if no link exists. */ + await gapi.client.projects.getXpnHost({ + project: "project", + }); + /** Get service resources (a.k.a service project) associated with this host project. */ + await gapi.client.projects.getXpnResources({ + filter: "filter", + maxResults: 2, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + }); + /** List all shared VPC host projects visible to the user in an organization. */ + await gapi.client.projects.listXpnHosts({ + filter: "filter", + maxResults: 2, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + }); + /** Moves a persistent disk from one zone to another. */ + await gapi.client.projects.moveDisk({ + project: "project", + requestId: "requestId", + }); + /** Moves an instance and its attached persistent disks from one zone to another. */ + await gapi.client.projects.moveInstance({ + project: "project", + requestId: "requestId", + }); + /** Sets metadata common to all instances within the specified project using the data included in the request. */ + await gapi.client.projects.setCommonInstanceMetadata({ + project: "project", + requestId: "requestId", + }); + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the + * usage export feature will be disabled. + */ + await gapi.client.projects.setUsageExportBucket({ + project: "project", + requestId: "requestId", + }); + /** Deletes the specified autoscaler. */ + await gapi.client.regionAutoscalers.delete({ + autoscaler: "autoscaler", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified autoscaler. */ + await gapi.client.regionAutoscalers.get({ + autoscaler: "autoscaler", + project: "project", + region: "region", + }); + /** Creates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.regionAutoscalers.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of autoscalers contained within the specified region. */ + await gapi.client.regionAutoscalers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + await gapi.client.regionAutoscalers.patch({ + autoscaler: "autoscaler", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Updates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.regionAutoscalers.update({ + autoscaler: "autoscaler", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified regional BackendService resource. */ + await gapi.client.regionBackendServices.delete({ + backendService: "backendService", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified regional BackendService resource. */ + await gapi.client.regionBackendServices.get({ + backendService: "backendService", + project: "project", + region: "region", + }); + /** Gets the most recent health check results for this regional BackendService. */ + await gapi.client.regionBackendServices.getHealth({ + backendService: "backendService", + project: "project", + region: "region", + }); + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.regionBackendServices.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves the list of regional BackendService resources available to the specified project in the given region. */ + await gapi.client.regionBackendServices.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + await gapi.client.regionBackendServices.patch({ + backendService: "backendService", + project: "project", + region: "region", + requestId: "requestId", + }); + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.regionBackendServices.update({ + backendService: "backendService", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves an aggregated list of commitments. */ + await gapi.client.regionCommitments.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified commitment resource. Get a list of available commitments by making a list() request. */ + await gapi.client.regionCommitments.get({ + commitment: "commitment", + project: "project", + region: "region", + }); + /** Creates a commitment in the specified project using the data included in the request. */ + await gapi.client.regionCommitments.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of commitments contained within the specified region. */ + await gapi.client.regionCommitments.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.regionInstanceGroupManagers.abandonInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified managed instance group and all of the instances in that group. */ + await gapi.client.regionInstanceGroupManagers.delete({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.regionInstanceGroupManagers.deleteInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns all of the details about the specified managed instance group. */ + await gapi.client.regionInstanceGroupManagers.get({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + }); + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A regional managed instance group can contain up to 2000 instances. + */ + await gapi.client.regionInstanceGroupManagers.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves the list of managed instance groups that are contained within the specified region. */ + await gapi.client.regionInstanceGroupManagers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group + * has scheduled for its instances. + */ + await gapi.client.regionInstanceGroupManagers.listManagedInstances({ + filter: "filter", + instanceGroupManager: "instanceGroupManager", + maxResults: 3, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.regionInstanceGroupManagers.recreateInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the + * current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE + * when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the + * creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + await gapi.client.regionInstanceGroupManagers.resize({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + size: 5, + }); + /** Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. */ + await gapi.client.regionInstanceGroupManagers.setInstanceTemplate({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. */ + await gapi.client.regionInstanceGroupManagers.setTargetPools({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified instance group resource. */ + await gapi.client.regionInstanceGroups.get({ + instanceGroup: "instanceGroup", + project: "project", + region: "region", + }); + /** Retrieves the list of instance group resources contained within the specified region. */ + await gapi.client.regionInstanceGroups.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can + * list all instances or only the instances that are running. + */ + await gapi.client.regionInstanceGroups.listInstances({ + filter: "filter", + instanceGroup: "instanceGroup", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Sets the named ports for the specified regional instance group. */ + await gapi.client.regionInstanceGroups.setNamedPorts({ + instanceGroup: "instanceGroup", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified region-specific Operations resource. */ + await gapi.client.regionOperations.delete({ + operation: "operation", + project: "project", + region: "region", + }); + /** Retrieves the specified region-specific Operations resource. */ + await gapi.client.regionOperations.get({ + operation: "operation", + project: "project", + region: "region", + }); + /** Retrieves a list of Operation resources contained within the specified region. */ + await gapi.client.regionOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Returns the specified Region resource. Get a list of available regions by making a list() request. */ + await gapi.client.regions.get({ + project: "project", + region: "region", + }); + /** Retrieves the list of region resources available to the specified project. */ + await gapi.client.regions.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Retrieves an aggregated list of routers. */ + await gapi.client.routers.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified Router resource. */ + await gapi.client.routers.delete({ + project: "project", + region: "region", + requestId: "requestId", + router: "router", + }); + /** Returns the specified Router resource. Get a list of available routers by making a list() request. */ + await gapi.client.routers.get({ + project: "project", + region: "region", + router: "router", + }); + /** Retrieves runtime information of the specified router. */ + await gapi.client.routers.getRouterStatus({ + project: "project", + region: "region", + router: "router", + }); + /** Creates a Router resource in the specified project and region using the data included in the request. */ + await gapi.client.routers.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of Router resources available to the specified project. */ + await gapi.client.routers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and + * processing rules. + */ + await gapi.client.routers.patch({ + project: "project", + region: "region", + requestId: "requestId", + router: "router", + }); + /** Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. */ + await gapi.client.routers.preview({ + project: "project", + region: "region", + router: "router", + }); + /** Updates the specified Router resource with the data included in the request. */ + await gapi.client.routers.update({ + project: "project", + region: "region", + requestId: "requestId", + router: "router", + }); + /** Deletes the specified Route resource. */ + await gapi.client.routes.delete({ + project: "project", + requestId: "requestId", + route: "route", + }); + /** Returns the specified Route resource. Get a list of available routes by making a list() request. */ + await gapi.client.routes.get({ + project: "project", + route: "route", + }); + /** Creates a Route resource in the specified project using the data included in the request. */ + await gapi.client.routes.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of Route resources available to the specified project. */ + await gapi.client.routes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If + * any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + * + * For more information, see Deleting snaphots. + */ + await gapi.client.snapshots.delete({ + project: "project", + requestId: "requestId", + snapshot: "snapshot", + }); + /** Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. */ + await gapi.client.snapshots.get({ + project: "project", + snapshot: "snapshot", + }); + /** Retrieves the list of Snapshot resources contained within the specified project. */ + await gapi.client.snapshots.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.snapshots.setLabels({ + project: "project", + resource: "resource", + }); + /** Deletes the specified SslCertificate resource. */ + await gapi.client.sslCertificates.delete({ + project: "project", + requestId: "requestId", + sslCertificate: "sslCertificate", + }); + /** Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. */ + await gapi.client.sslCertificates.get({ + project: "project", + sslCertificate: "sslCertificate", + }); + /** Creates a SslCertificate resource in the specified project using the data included in the request. */ + await gapi.client.sslCertificates.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of SslCertificate resources available to the specified project. */ + await gapi.client.sslCertificates.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Retrieves an aggregated list of subnetworks. */ + await gapi.client.subnetworks.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified subnetwork. */ + await gapi.client.subnetworks.delete({ + project: "project", + region: "region", + requestId: "requestId", + subnetwork: "subnetwork", + }); + /** Expands the IP CIDR range of the subnetwork to a specified value. */ + await gapi.client.subnetworks.expandIpCidrRange({ + project: "project", + region: "region", + requestId: "requestId", + subnetwork: "subnetwork", + }); + /** Returns the specified subnetwork. Get a list of available subnetworks list() request. */ + await gapi.client.subnetworks.get({ + project: "project", + region: "region", + subnetwork: "subnetwork", + }); + /** Creates a subnetwork in the specified project using the data included in the request. */ + await gapi.client.subnetworks.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of subnetworks available to the specified project. */ + await gapi.client.subnetworks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. */ + await gapi.client.subnetworks.setPrivateIpGoogleAccess({ + project: "project", + region: "region", + requestId: "requestId", + subnetwork: "subnetwork", + }); + /** Deletes the specified TargetHttpProxy resource. */ + await gapi.client.targetHttpProxies.delete({ + project: "project", + requestId: "requestId", + targetHttpProxy: "targetHttpProxy", + }); + /** Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. */ + await gapi.client.targetHttpProxies.get({ + project: "project", + targetHttpProxy: "targetHttpProxy", + }); + /** Creates a TargetHttpProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetHttpProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetHttpProxy resources available to the specified project. */ + await gapi.client.targetHttpProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes the URL map for TargetHttpProxy. */ + await gapi.client.targetHttpProxies.setUrlMap({ + project: "project", + requestId: "requestId", + targetHttpProxy: "targetHttpProxy", + }); + /** Deletes the specified TargetHttpsProxy resource. */ + await gapi.client.targetHttpsProxies.delete({ + project: "project", + requestId: "requestId", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. */ + await gapi.client.targetHttpsProxies.get({ + project: "project", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Creates a TargetHttpsProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetHttpsProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetHttpsProxy resources available to the specified project. */ + await gapi.client.targetHttpsProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Replaces SslCertificates for TargetHttpsProxy. */ + await gapi.client.targetHttpsProxies.setSslCertificates({ + project: "project", + requestId: "requestId", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Changes the URL map for TargetHttpsProxy. */ + await gapi.client.targetHttpsProxies.setUrlMap({ + project: "project", + requestId: "requestId", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Retrieves an aggregated list of target instances. */ + await gapi.client.targetInstances.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified TargetInstance resource. */ + await gapi.client.targetInstances.delete({ + project: "project", + requestId: "requestId", + targetInstance: "targetInstance", + zone: "zone", + }); + /** Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. */ + await gapi.client.targetInstances.get({ + project: "project", + targetInstance: "targetInstance", + zone: "zone", + }); + /** Creates a TargetInstance resource in the specified project and zone using the data included in the request. */ + await gapi.client.targetInstances.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves a list of TargetInstance resources available to the specified project and zone. */ + await gapi.client.targetInstances.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Adds health check URLs to a target pool. */ + await gapi.client.targetPools.addHealthCheck({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Adds an instance to a target pool. */ + await gapi.client.targetPools.addInstance({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Retrieves an aggregated list of target pools. */ + await gapi.client.targetPools.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified target pool. */ + await gapi.client.targetPools.delete({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Returns the specified target pool. Get a list of available target pools by making a list() request. */ + await gapi.client.targetPools.get({ + project: "project", + region: "region", + targetPool: "targetPool", + }); + /** Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. */ + await gapi.client.targetPools.getHealth({ + project: "project", + region: "region", + targetPool: "targetPool", + }); + /** Creates a target pool in the specified project and region using the data included in the request. */ + await gapi.client.targetPools.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of target pools available to the specified project and region. */ + await gapi.client.targetPools.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Removes health check URL from a target pool. */ + await gapi.client.targetPools.removeHealthCheck({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Removes instance URL from a target pool. */ + await gapi.client.targetPools.removeInstance({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Changes a backup target pool's configurations. */ + await gapi.client.targetPools.setBackup({ + failoverRatio: 1, + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Deletes the specified TargetSslProxy resource. */ + await gapi.client.targetSslProxies.delete({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. */ + await gapi.client.targetSslProxies.get({ + project: "project", + targetSslProxy: "targetSslProxy", + }); + /** Creates a TargetSslProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetSslProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetSslProxy resources available to the specified project. */ + await gapi.client.targetSslProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes the BackendService for TargetSslProxy. */ + await gapi.client.targetSslProxies.setBackendService({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Changes the ProxyHeaderType for TargetSslProxy. */ + await gapi.client.targetSslProxies.setProxyHeader({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Changes SslCertificates for TargetSslProxy. */ + await gapi.client.targetSslProxies.setSslCertificates({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Deletes the specified TargetTcpProxy resource. */ + await gapi.client.targetTcpProxies.delete({ + project: "project", + requestId: "requestId", + targetTcpProxy: "targetTcpProxy", + }); + /** Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. */ + await gapi.client.targetTcpProxies.get({ + project: "project", + targetTcpProxy: "targetTcpProxy", + }); + /** Creates a TargetTcpProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetTcpProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetTcpProxy resources available to the specified project. */ + await gapi.client.targetTcpProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes the BackendService for TargetTcpProxy. */ + await gapi.client.targetTcpProxies.setBackendService({ + project: "project", + requestId: "requestId", + targetTcpProxy: "targetTcpProxy", + }); + /** Changes the ProxyHeaderType for TargetTcpProxy. */ + await gapi.client.targetTcpProxies.setProxyHeader({ + project: "project", + requestId: "requestId", + targetTcpProxy: "targetTcpProxy", + }); + /** Retrieves an aggregated list of target VPN gateways. */ + await gapi.client.targetVpnGateways.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified target VPN gateway. */ + await gapi.client.targetVpnGateways.delete({ + project: "project", + region: "region", + requestId: "requestId", + targetVpnGateway: "targetVpnGateway", + }); + /** Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. */ + await gapi.client.targetVpnGateways.get({ + project: "project", + region: "region", + targetVpnGateway: "targetVpnGateway", + }); + /** Creates a target VPN gateway in the specified project and region using the data included in the request. */ + await gapi.client.targetVpnGateways.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of target VPN gateways available to the specified project and region. */ + await gapi.client.targetVpnGateways.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Deletes the specified UrlMap resource. */ + await gapi.client.urlMaps.delete({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. */ + await gapi.client.urlMaps.get({ + project: "project", + urlMap: "urlMap", + }); + /** Creates a UrlMap resource in the specified project using the data included in the request. */ + await gapi.client.urlMaps.insert({ + project: "project", + requestId: "requestId", + }); + /** Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. */ + await gapi.client.urlMaps.invalidateCache({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Retrieves the list of UrlMap resources available to the specified project. */ + await gapi.client.urlMaps.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + await gapi.client.urlMaps.patch({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Updates the specified UrlMap resource with the data included in the request. */ + await gapi.client.urlMaps.update({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. */ + await gapi.client.urlMaps.validate({ + project: "project", + urlMap: "urlMap", + }); + /** Retrieves an aggregated list of VPN tunnels. */ + await gapi.client.vpnTunnels.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified VpnTunnel resource. */ + await gapi.client.vpnTunnels.delete({ + project: "project", + region: "region", + requestId: "requestId", + vpnTunnel: "vpnTunnel", + }); + /** Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. */ + await gapi.client.vpnTunnels.get({ + project: "project", + region: "region", + vpnTunnel: "vpnTunnel", + }); + /** Creates a VpnTunnel resource in the specified project and region using the data included in the request. */ + await gapi.client.vpnTunnels.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of VpnTunnel resources contained in the specified project and region. */ + await gapi.client.vpnTunnels.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Deletes the specified zone-specific Operations resource. */ + await gapi.client.zoneOperations.delete({ + operation: "operation", + project: "project", + zone: "zone", + }); + /** Retrieves the specified zone-specific Operations resource. */ + await gapi.client.zoneOperations.get({ + operation: "operation", + project: "project", + zone: "zone", + }); + /** Retrieves a list of Operation resources contained within the specified zone. */ + await gapi.client.zoneOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Returns the specified Zone resource. Get a list of available zones by making a list() request. */ + await gapi.client.zones.get({ + project: "project", + zone: "zone", + }); + /** Retrieves the list of Zone resources available to the specified project. */ + await gapi.client.zones.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + } +}); diff --git a/types/gapi.client.compute/index.d.ts b/types/gapi.client.compute/index.d.ts new file mode 100644 index 0000000000..fe53df316f --- /dev/null +++ b/types/gapi.client.compute/index.d.ts @@ -0,0 +1,17367 @@ +// Type definitions for Google Compute Engine API v1 1.0 +// Project: https://developers.google.com/compute/docs/reference/latest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/compute/v1/rest + +/// + +declare namespace gapi.client { + /** Load Compute Engine API v1 */ + function load(name: "compute", version: "v1"): PromiseLike; + function load(name: "compute", version: "v1", callback: () => any): void; + + const acceleratorTypes: compute.AcceleratorTypesResource; + + const addresses: compute.AddressesResource; + + const autoscalers: compute.AutoscalersResource; + + const backendBuckets: compute.BackendBucketsResource; + + const backendServices: compute.BackendServicesResource; + + const diskTypes: compute.DiskTypesResource; + + const disks: compute.DisksResource; + + const firewalls: compute.FirewallsResource; + + const forwardingRules: compute.ForwardingRulesResource; + + const globalAddresses: compute.GlobalAddressesResource; + + const globalForwardingRules: compute.GlobalForwardingRulesResource; + + const globalOperations: compute.GlobalOperationsResource; + + const healthChecks: compute.HealthChecksResource; + + const httpHealthChecks: compute.HttpHealthChecksResource; + + const httpsHealthChecks: compute.HttpsHealthChecksResource; + + const images: compute.ImagesResource; + + const instanceGroupManagers: compute.InstanceGroupManagersResource; + + const instanceGroups: compute.InstanceGroupsResource; + + const instanceTemplates: compute.InstanceTemplatesResource; + + const instances: compute.InstancesResource; + + const licenses: compute.LicensesResource; + + const machineTypes: compute.MachineTypesResource; + + const networks: compute.NetworksResource; + + const projects: compute.ProjectsResource; + + const regionAutoscalers: compute.RegionAutoscalersResource; + + const regionBackendServices: compute.RegionBackendServicesResource; + + const regionCommitments: compute.RegionCommitmentsResource; + + const regionInstanceGroupManagers: compute.RegionInstanceGroupManagersResource; + + const regionInstanceGroups: compute.RegionInstanceGroupsResource; + + const regionOperations: compute.RegionOperationsResource; + + const regions: compute.RegionsResource; + + const routers: compute.RoutersResource; + + const routes: compute.RoutesResource; + + const snapshots: compute.SnapshotsResource; + + const sslCertificates: compute.SslCertificatesResource; + + const subnetworks: compute.SubnetworksResource; + + const targetHttpProxies: compute.TargetHttpProxiesResource; + + const targetHttpsProxies: compute.TargetHttpsProxiesResource; + + const targetInstances: compute.TargetInstancesResource; + + const targetPools: compute.TargetPoolsResource; + + const targetSslProxies: compute.TargetSslProxiesResource; + + const targetTcpProxies: compute.TargetTcpProxiesResource; + + const targetVpnGateways: compute.TargetVpnGatewaysResource; + + const urlMaps: compute.UrlMapsResource; + + const vpnTunnels: compute.VpnTunnelsResource; + + const zoneOperations: compute.ZoneOperationsResource; + + const zones: compute.ZonesResource; + + namespace compute { + interface AcceleratorConfig { + /** The number of the guest accelerator cards exposed to this instance. */ + acceleratorCount?: number; + /** Full or partial URL of the accelerator type resource to expose to this instance. */ + acceleratorType?: string; + } + interface AcceleratorType { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this accelerator type. */ + deprecated?: DeprecationStatus; + /** [Output Only] An optional textual description of the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. */ + kind?: string; + /** [Output Only] Maximum accelerator cards allowed per instance. */ + maximumCardsPerInstance?: number; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Server-defined fully-qualified URL for this resource. */ + selfLink?: string; + /** [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. */ + zone?: string; + } + interface AcceleratorTypeAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AcceleratorTypesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AcceleratorTypeList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AcceleratorType resources. */ + items?: AcceleratorType[]; + /** [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AcceleratorTypesScopedList { + /** [Output Only] List of accelerator types contained in this scope. */ + acceleratorTypes?: AcceleratorType[]; + /** [Output Only] An informational warning that appears when the accelerator types list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AccessConfig { + /** [Output Only] Type of the resource. Always compute#accessConfig for access configs. */ + kind?: string; + /** + * The name of this access configuration. The default and recommended name is External NAT but you can use any arbitrary string you would like. For + * example, My external IP or Network Access. + */ + name?: string; + /** + * An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field + * undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the + * zone of the instance. + */ + natIP?: string; + /** The type of configuration. The default and only option is ONE_TO_ONE_NAT. */ + type?: string; + } + interface Address { + /** The static IP address represented by this resource. */ + address?: string; + /** The type of address to reserve. If unspecified, defaults to EXTERNAL. */ + addressType?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** The IP Version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address. */ + ipVersion?: string; + /** [Output Only] Type of the resource. Always compute#address for addresses. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] URL of the region where the regional address resides. This field is not applicable to global addresses. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process + * of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is + * not available. + */ + status?: string; + /** + * For external addresses, this field should not be used. + * + * The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. + */ + subnetwork?: string; + /** [Output Only] The URLs of the resources that are using this address. */ + users?: string[]; + } + interface AddressAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AddressesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AddressList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Address resources. */ + items?: Address[]; + /** [Output Only] Type of resource. Always compute#addressList for lists of addresses. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AddressesScopedList { + /** [Output Only] List of addresses contained in this scope. */ + addresses?: Address[]; + /** [Output Only] Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AliasIpRange { + /** + * The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses + * reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format + * string (e.g. 10.1.2.0/24). + */ + ipCidrRange?: string; + /** + * Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left + * unspecified, the primary range of the subnetwork will be used. + */ + subnetworkRangeName?: string; + } + interface AttachedDisk { + /** Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). */ + autoDelete?: boolean; + /** Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. */ + boot?: boolean; + /** + * Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the + * instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. + * + * If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by + * Google Compute Engine. This field is only applicable for persistent disks. + */ + deviceName?: string; + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. + * + * If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that + * is already encrypted, this field decrypts the disk using the customer-supplied encryption key. + * + * If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For + * example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. + * + * If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to + * use the disk later. + * + * Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + */ + diskEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would + * have a unique index number. + */ + index?: number; + /** + * [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. + * + * This property is mutually exclusive with the source property; you can only define one or the other, but not both. + */ + initializeParams?: AttachedDiskInitializeParams; + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + * and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For + * performance characteristics of SCSI over NVMe, see Local SSD performance. + */ + interface?: string; + /** [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. */ + kind?: string; + /** [Output Only] Any valid publicly visible licenses. */ + licenses?: string[]; + /** The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. */ + mode?: string; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or + * disks.source is required. + * + * If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. + * + * Note that for InstanceTemplate, specify the disk name, not the URL for the disk. + */ + source?: string; + /** Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. */ + type?: string; + } + interface AttachedDiskInitializeParams { + /** Specifies the disk name. If not specified, the default is to use the name of the instance. */ + diskName?: string; + /** Specifies the size of the disk in base-2 GB. */ + diskSizeGb?: string; + /** + * Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: + * + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + * + * Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are + * valid values: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + * - projects/project/zones/zone/diskTypes/diskType + * - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. + */ + diskType?: string; + /** + * The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required. + * + * To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the + * latest Debian 8 image: + * + * projects/debian-cloud/global/images/family/debian-8 + * + * Alternatively, use a specific version of a public operating system image: + * + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD + * + * To create a disk with a private image that you created, specify the image name in the following format: + * + * global/images/my-private-image + * + * You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with + * family/family-name: + * + * global/images/family/my-private-family + * + * If the source image is deleted later, this field will not be set. + */ + sourceImage?: string; + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source + * images are encrypted with your own keys. + */ + sourceImageEncryptionKey?: CustomerEncryptionKey; + } + interface Autoscaler { + /** + * The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, + * customMetricUtilizations, and loadBalancingUtilization. + * + * If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + */ + autoscalingPolicy?: AutoscalingPolicy; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The status of the autoscaler configuration. */ + status?: string; + /** + * [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for + * examples of status messages you might encounter. + */ + statusDetails?: AutoscalerStatusDetails[]; + /** URL of the managed instance group that this autoscaler will scale. */ + target?: string; + /** [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). */ + zone?: string; + } + interface AutoscalerAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AutoscalersScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AutoscalerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Autoscaler resources. */ + items?: Autoscaler[]; + /** [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AutoscalerStatusDetails { + /** The status message. */ + message?: string; + /** The type of error returned. */ + type?: string; + } + interface AutoscalersScopedList { + /** [Output Only] List of autoscalers contained in this scope. */ + autoscalers?: Autoscaler[]; + /** [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AutoscalingPolicy { + /** + * The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from + * collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is + * 60 seconds. + * + * Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To + * do this, create an instance and time the startup process. + */ + coolDownPeriodSec?: number; + /** Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. */ + cpuUtilization?: AutoscalingPolicyCpuUtilization; + /** Configuration parameters of autoscaling based on a custom metric. */ + customMetricUtilizations?: AutoscalingPolicyCustomMetricUtilization[]; + /** Configuration parameters of autoscaling based on load balancer. */ + loadBalancingUtilization?: AutoscalingPolicyLoadBalancingUtilization; + /** + * The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of + * replicas should not be lower than minimal number of replicas. + */ + maxNumReplicas?: number; + /** + * The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default + * value depending on maximum number of instances allowed. + */ + minNumReplicas?: number; + } + interface AutoscalingPolicyCpuUtilization { + /** + * The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. + * + * If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances + * you specified or until the average CPU of your instances reaches the target utilization. + * + * If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until + * the average utilization reaches the target utilization. + */ + utilizationTarget?: number; + } + interface AutoscalingPolicyCustomMetricUtilization { + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that + * the number of virtual machines handling requests should increase or decrease proportionally to the metric. + * + * The metric must have a value type of INT64 or DOUBLE. + */ + metric?: string; + /** + * The target value of the metric that autoscaler should maintain. This must be a positive value. + * + * For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to + * keep this value constant for each of the instances. + */ + utilizationTarget?: number; + /** + * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not + * specified, the default is GAUGE. + */ + utilizationTargetType?: string; + } + interface AutoscalingPolicyLoadBalancingUtilization { + /** + * Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. + * If not defined, the default is 0.8. + */ + utilizationTarget?: number; + } + interface Backend { + /** + * Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, + * RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). + * + * For Internal Load Balancing, the default and only supported mode is CONNECTION. + */ + balancingMode?: string; + /** + * A multiplier applied to the group's maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group + * will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its + * available Capacity. Valid range is [0.0,1.0]. + * + * This cannot be used for internal load balancing. + */ + capacityScaler?: number; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * The fully-qualified URL of a Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine + * instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use + * same Instance Group resource. + * + * Note that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL. + * + * When the BackendService has load balancing scheme INTERNAL, the instance group must be within the same region as the BackendService. + */ + group?: string; + /** + * The max number of simultaneous connections for the group. Can be used with either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, + * either maxConnections or maxConnectionsPerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxConnections?: number; + /** + * The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used + * in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxConnectionsPerInstance?: number; + /** + * The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, + * either maxRate or maxRatePerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxRate?: number; + /** + * The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either + * balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxRatePerInstance?: number; + /** + * Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0]. + * + * This cannot be used for internal load balancing. + */ + maxUtilization?: number; + } + interface BackendBucket { + /** Cloud Storage bucket name. */ + bucketName?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** If true, enable Cloud CDN for this BackendBucket. */ + enableCdn?: boolean; + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** Type of the resource. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface BackendBucketList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of BackendBucket resources. */ + items?: BackendBucket[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface BackendService { + /** + * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the + * browser session (or equivalent). The maximum allowed value for TTL is one day. + * + * When the load balancing scheme is INTERNAL, this field is not used. + */ + affinityCookieTtlSec?: number; + /** The list of backends that serve this BackendService. */ + backends?: Backend[]; + /** Cloud CDN configuration for this BackendService. */ + cdnPolicy?: BackendServiceCdnPolicy; + connectionDraining?: ConnectionDraining; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * If true, enable Cloud CDN for this BackendService. + * + * When the load balancing scheme is INTERNAL, this field is not used. + */ + enableCDN?: boolean; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when + * inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService. + */ + fingerprint?: string; + /** + * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be + * specified, and a health check is required for Compute Engine backend services. A health check must not be specified for App Engine backend and Cloud + * Function backend. + * + * For internal load balancing, a URL to a HealthCheck resource must be specified instead. + */ + healthChecks?: string[]; + iap?: BackendServiceIAP; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#backendService for backend services. */ + kind?: string; + /** + * Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing + * cannot be used with the other. Possible values are INTERNAL and EXTERNAL. + */ + loadBalancingScheme?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. + * + * This cannot be used for internal load balancing. + */ + port?: number; + /** + * Name of backend port. The same name should appear in the instance groups referenced by this service. Required when the load balancing scheme is + * EXTERNAL. + * + * When the load balancing scheme is INTERNAL, this field is not used. + */ + portName?: string; + /** + * The protocol this BackendService uses to communicate with backends. + * + * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. + * + * For internal load balancing, the possible values are TCP and UDP, and the default is TCP. + */ + protocol?: string; + /** [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * Type of session affinity to use. The default is NONE. + * + * When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or GENERATED_COOKIE. + * + * When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. + * + * When the protocol is UDP, this field is not used. + */ + sessionAffinity?: string; + /** How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. */ + timeoutSec?: number; + } + interface BackendServiceAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of BackendServicesScopedList resources. */ + items?: Record; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface BackendServiceCdnPolicy { + /** The CacheKeyPolicy for this CdnPolicy. */ + cacheKeyPolicy?: CacheKeyPolicy; + } + interface BackendServiceGroupHealth { + healthStatus?: HealthStatus[]; + /** [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. */ + kind?: string; + } + interface BackendServiceIAP { + enabled?: boolean; + oauth2ClientId?: string; + oauth2ClientSecret?: string; + /** [Output Only] SHA256 hash value for the field oauth2_client_secret above. */ + oauth2ClientSecretSha256?: string; + } + interface BackendServiceList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of BackendService resources. */ + items?: BackendService[]; + /** [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface BackendServicesScopedList { + /** List of BackendServices contained in this scope. */ + backendServices?: BackendService[]; + /** Informational warning which replaces the list of backend services when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface CacheInvalidationRule { + /** If set, this invalidation rule will only apply to requests with a Host header matching host. */ + host?: string; + path?: string; + } + interface CacheKeyPolicy { + /** If true, requests to different hosts will be cached separately. */ + includeHost?: boolean; + /** If true, http and https requests will be cached separately. */ + includeProtocol?: boolean; + /** + * If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire + * query string will be included. If false, the query string will be excluded from the cache key entirely. + */ + includeQueryString?: boolean; + /** + * Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + */ + queryStringBlacklist?: string[]; + /** + * Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + */ + queryStringWhitelist?: string[]; + } + interface Commitment { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] Commitment end time in RFC3339 text format. */ + endTimestamp?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#commitment for commitments. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and + * THIRTY_SIX_MONTH (3 years). + */ + plan?: string; + /** [Output Only] URL of the region where this commitment may be used. */ + region?: string; + /** List of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. */ + resources?: ResourceCommitment[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Commitment start time in RFC3339 text format. */ + startTimestamp?: string; + /** + * [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: + * NOT_YET_ACTIVE, ACTIVE, EXPIRED. + */ + status?: string; + /** [Output Only] An optional, human-readable explanation of the status. */ + statusMessage?: string; + } + interface CommitmentAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of CommitmentsScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface CommitmentList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Commitment resources. */ + items?: Commitment[]; + /** [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface CommitmentsScopedList { + /** [Output Only] List of commitments contained in this scope. */ + commitments?: Commitment[]; + /** [Output Only] Informational warning which replaces the list of commitments when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ConnectionDraining { + /** Time for which instance will be drained (not accept new connections, but still work to finish started). */ + drainingTimeoutSec?: number; + } + interface CustomerEncryptionKey { + /** Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. */ + rawKey?: string; + /** [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. */ + sha256?: string; + } + interface CustomerEncryptionKeyProtectedDisk { + /** Decrypts data associated with the disk with a customer-supplied encryption key. */ + diskEncryptionKey?: CustomerEncryptionKey; + /** Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. */ + source?: string; + } + interface DeprecationStatus { + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status + * will not change unless the client explicitly changes it. + */ + deleted?: string; + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the + * status will not change unless the client explicitly changes it. + */ + deprecated?: string; + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status + * will not change unless the client explicitly changes it. + */ + obsolete?: string; + /** + * The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated + * resource. + */ + replacement?: string; + /** + * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, or DELETED. Operations which create a new resource using a DEPRECATED + * resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use + * OBSOLETE or DELETED resources will be rejected and result in an error. + */ + state?: string; + } + interface Disk { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * Encrypts the disk using a customer-supplied encryption key. + * + * After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an + * image, or to attach the disk to a virtual machine). + * + * Customer-supplied encryption keys do not protect access to metadata of the disk. + * + * If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not + * need to provide a key to use the disk later. + */ + diskEncryptionKey?: CustomerEncryptionKey; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#disk for disks. */ + kind?: string; + /** + * A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint + * hash in order to update or change labels. + * + * To see the latest fingerprint, make a get() request to retrieve a disk. + */ + labelFingerprint?: string; + /** Labels to apply to this disk. These can be later modified by the setLabels method. */ + labels?: Record; + /** [Output Only] Last attach timestamp in RFC3339 text format. */ + lastAttachTimestamp?: string; + /** [Output Only] Last detach timestamp in RFC3339 text format. */ + lastDetachTimestamp?: string; + /** Any applicable publicly visible licenses. */ + licenses?: string[]; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Internal use only. */ + options?: string; + /** [Output Only] Server-defined fully-qualified URL for this resource. */ + selfLink?: string; + /** + * Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot + * parameter, or specify it alone to create an empty persistent disk. + * + * If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size + * of the snapshot. Acceptable values are 1 to 65536, inclusive. + */ + sizeGb?: string; + /** + * The source image used to create this disk. If the source image is deleted, this field will not be set. + * + * To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the + * latest Debian 8 image: + * + * projects/debian-cloud/global/images/family/debian-8 + * + * Alternatively, use a specific version of a public operating system image: + * + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD + * + * To create a disk with a private image that you created, specify the image name in the following format: + * + * global/images/my-private-image + * + * You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with + * family/family-name: + * + * global/images/family/my-private-family + */ + sourceImage?: string; + /** The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. */ + sourceImageEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. + * For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would + * identify the exact version of the image that was used. + */ + sourceImageId?: string; + /** + * The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid + * values: + * - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + * - projects/project/global/snapshots/snapshot + * - global/snapshots/snapshot + */ + sourceSnapshot?: string; + /** The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. */ + sourceSnapshotEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent + * disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID + * would identify the exact version of the snapshot that was used. + */ + sourceSnapshotId?: string; + /** [Output Only] The status of disk creation. */ + status?: string; + /** URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. */ + type?: string; + /** [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance */ + users?: string[]; + /** [Output Only] URL of the zone where the disk resides. */ + zone?: string; + } + interface DiskAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of DisksScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Disk resources. */ + items?: Disk[]; + /** [Output Only] Type of resource. Always compute#diskList for lists of disks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskMoveRequest { + /** + * The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone + * - projects/project/zones/zone + * - zones/zone + */ + destinationZone?: string; + /** + * The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk + * - zones/zone/disks/disk + */ + targetDisk?: string; + } + interface DiskType { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] Server-defined default disk size in GB. */ + defaultDiskSizeGb?: string; + /** [Output Only] The deprecation status associated with this disk type. */ + deprecated?: DeprecationStatus; + /** [Output Only] An optional description of this resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#diskType for disk types. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". */ + validDiskSize?: string; + /** [Output Only] URL of the zone where the disk type resides. */ + zone?: string; + } + interface DiskTypeAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of DiskTypesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#diskTypeAggregatedList. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskTypeList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of DiskType resources. */ + items?: DiskType[]; + /** [Output Only] Type of resource. Always compute#diskTypeList for disk types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskTypesScopedList { + /** [Output Only] List of disk types contained in this scope. */ + diskTypes?: DiskType[]; + /** [Output Only] Informational warning which replaces the list of disk types when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DisksResizeRequest { + /** The new size of the persistent disk, which is specified in GB. */ + sizeGb?: string; + } + interface DisksScopedList { + /** [Output Only] List of disks contained in this scope. */ + disks?: Disk[]; + /** [Output Only] Informational warning which replaces the list of disks when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Firewall { + /** The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. */ + allowed?: Array<{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following + * well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + */ + IPProtocol?: string; + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a + * range. If not specified, this rule applies to connections through any port. + * + * Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + */ + ports?: string[]; + }>; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. */ + denied?: Array<{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following + * well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + */ + IPProtocol?: string; + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a + * range. If not specified, this rule applies to connections through any port. + * + * Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + */ + ports?: string[]; + }>; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be + * expressed in CIDR format. Only IPv4 is supported. + */ + destinationRanges?: string[]; + /** + * Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; + * For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. + */ + direction?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#firewall for firewall rules. */ + kind?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: + * global/networks/default + * If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + * - projects/myproject/global/networks/my-network + * - global/networks/default + */ + network?: string; + /** + * Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities + * determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a + * rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. + */ + priority?: number; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * If source ranges are specified, the firewall will apply only to traffic that has source IP address in these ranges. These ranges must be expressed in + * CIDR format. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP + * address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both + * properties for the firewall to apply. Only IPv4 is supported. + */ + sourceRanges?: string[]; + /** + * If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that + * have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to + * traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and + * sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP + * that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. + */ + sourceTags?: string[]; + /** + * A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no + * targetTags are specified, the firewall rule applies to all instances on the specified network. + */ + targetTags?: string[]; + } + interface FirewallList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Firewall resources. */ + items?: Firewall[]; + /** [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ForwardingRule { + /** + * The IP address that this forwarding rule is serving on behalf of. + * + * For global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding + * rule. By default, this field is empty and an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding + * rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. + * + * When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding + * rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the + * subnetwork or network configured for this forwarding rule. + */ + IPAddress?: string; + /** + * The IP protocol to which this rule applies. Valid options are TCP, UDP, ESP, AH, SCTP or ICMP. + * + * When the load balancing scheme is INTERNAL, only TCP and UDP are valid. + */ + IPProtocol?: string; + /** + * This field is not used for external load balancing. + * + * For internal load balancing, this field identifies the BackendService resource to receive the matched traffic. + */ + backendService?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. This can only be specified for a global forwarding rule. */ + ipVersion?: string; + /** [Output Only] Type of the resource. Always compute#forwardingRule for Forwarding Rule resources. */ + kind?: string; + /** + * This signifies what the ForwardingRule will be used for and can only take the following values: INTERNAL, EXTERNAL The value of INTERNAL means that + * this will be used for Internal Network Load Balancing (TCP, UDP). The value of EXTERNAL means that this will be used for External Load Balancing + * (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) + */ + loadBalancingScheme?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * This field is not used for external load balancing. + * + * For internal load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is + * not specified, the default network will be used. + */ + network?: string; + /** + * This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, + * TargetInstance. + * + * Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding + * rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. + * + * Some types of forwarding target have constraints on the acceptable ports: + * - TargetHttpProxy: 80, 8080 + * - TargetHttpsProxy: 443 + * - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 + * - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 + * - TargetVpnGateway: 500, 4500 + * - + */ + portRange?: string; + /** + * This field is used along with the backend_service field for internal load balancing. + * + * When the load balancing scheme is INTERNAL, a single port or a comma separated list of ports can be configured. Only packets addressed to these ports + * will be forwarded to the backends configured with this forwarding rule. + * + * You may specify a maximum of up to 5 ports. + */ + ports?: string[]; + /** [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * This field is not used for external load balancing. + * + * For internal load balancing, this field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule. + * + * If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be + * specified. + */ + subnetwork?: string; + /** + * The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the + * forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate + * to the target object. + * + * This field is not used for internal load balancing. + */ + target?: string; + } + interface ForwardingRuleAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of ForwardingRulesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ForwardingRuleList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of ForwardingRule resources. */ + items?: ForwardingRule[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ForwardingRulesScopedList { + /** List of forwarding rules contained in this scope. */ + forwardingRules?: ForwardingRule[]; + /** Informational warning which replaces the list of forwarding rules when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface GlobalSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and + * changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make a + * get() request to the resource to get the latest fingerprint. + */ + labelFingerprint?: string; + /** + * A list of labels to apply for this resource. Each label key & value must comply with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, "webserver-frontend": "images". A label value + * can also be empty (e.g. "my-label": ""). + */ + labels?: Record; + } + interface GuestOsFeature { + /** + * The type of supported feature. Currently only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this + * property with the value WINDOWS to indicate that this is a Windows image. + */ + type?: string; + } + interface HTTPHealthCheck { + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the IP on behalf of which this health check is performed + * will be used. + */ + host?: string; + /** The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** The request path of the HTTP health check request. The default value is /. */ + requestPath?: string; + } + interface HTTPSHealthCheck { + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the IP on behalf of which this health check is performed + * will be used. + */ + host?: string; + /** The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** The request path of the HTTPS health check request. The default value is /. */ + requestPath?: string; + } + interface HealthCheck { + /** How often (in seconds) to send a health check. The default value is 5 seconds. */ + checkIntervalSec?: number; + /** [Output Only] Creation timestamp in 3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. */ + healthyThreshold?: number; + httpHealthCheck?: HTTPHealthCheck; + httpsHealthCheck?: HTTPSHealthCheck; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** Type of the resource. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + sslHealthCheck?: SSLHealthCheck; + tcpHealthCheck?: TCPHealthCheck; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec?: number; + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If not specified, the default is TCP. Exactly one of the protocol-specific + * health check field must be specified, which must match type field. + */ + type?: string; + /** A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. */ + unhealthyThreshold?: number; + } + interface HealthCheckList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of HealthCheck resources. */ + items?: HealthCheck[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface HealthCheckReference { + healthCheck?: string; + } + interface HealthStatus { + /** Health state of the instance. */ + healthState?: string; + /** URL of the instance resource. */ + instance?: string; + /** The IP address represented by this resource. */ + ipAddress?: string; + /** The port on the instance. */ + port?: number; + } + interface HostRule { + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first + * character and must be followed in the pattern by either - or .. + */ + hosts?: string[]; + /** The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. */ + pathMatcher?: string; + } + interface HttpHealthCheck { + /** How often (in seconds) to send a health check. The default value is 5 seconds. */ + checkIntervalSec?: number; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. */ + healthyThreshold?: number; + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is + * performed will be used. + */ + host?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#httpHealthCheck for HTTP health checks. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The TCP port number for the HTTP health check request. The default value is 80. */ + port?: number; + /** The request path of the HTTP health check request. The default value is /. */ + requestPath?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec?: number; + /** A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. */ + unhealthyThreshold?: number; + } + interface HttpHealthCheckList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of HttpHealthCheck resources. */ + items?: HttpHealthCheck[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface HttpsHealthCheck { + /** How often (in seconds) to send a health check. The default value is 5 seconds. */ + checkIntervalSec?: number; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. */ + healthyThreshold?: number; + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the public IP on behalf of which this health check is + * performed will be used. + */ + host?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** Type of the resource. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The TCP port number for the HTTPS health check request. The default value is 443. */ + port?: number; + /** The request path of the HTTPS health check request. The default value is "/". */ + requestPath?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have a greater value than + * checkIntervalSec. + */ + timeoutSec?: number; + /** A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. */ + unhealthyThreshold?: number; + } + interface HttpsHealthCheckList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of HttpsHealthCheck resources. */ + items?: HttpsHealthCheck[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Image { + /** Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). */ + archiveSizeBytes?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** The deprecation status associated with this image. */ + deprecated?: DeprecationStatus; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** Size of the image when restored onto a persistent disk (in GB). */ + diskSizeGb?: string; + /** + * The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The + * image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + */ + family?: string; + /** + * A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, + * which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version + * 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE. + * + * For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image. + */ + guestOsFeatures?: GuestOsFeature[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * Encrypts the image using a customer-supplied encryption key. + * + * After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the + * image). + * + * Customer-supplied encryption keys do not protect access to metadata of the disk. + * + * If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not + * need to provide a key to use the image later. + */ + imageEncryptionKey?: CustomerEncryptionKey; + /** [Output Only] Type of the resource. Always compute#image for images. */ + kind?: string; + /** + * A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint + * hash in order to update or change labels. + * + * To see the latest fingerprint, make a get() request to retrieve an image. + */ + labelFingerprint?: string; + /** Labels to apply to this image. These can be later modified by the setLabels method. */ + labels?: Record; + /** Any applicable license URI. */ + licenses?: string[]; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The parameters of the raw disk image. */ + rawDisk?: { + /** + * The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime + * format. Provided by the client when the disk image is created. + */ + containerType?: string; + /** An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created. */ + sha1Checksum?: string; + /** The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both. */ + source?: string; + }; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source + * property but not both to create an image. For example, the following are valid values: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk + * - zones/zone/disks/disk + */ + sourceDisk?: string; + /** The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. */ + sourceDiskEncryptionKey?: CustomerEncryptionKey; + /** + * The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous + * instance of a given disk name. + */ + sourceDiskId?: string; + /** + * URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of: + * - this property, or + * - the rawDisk.source property, or + * - the sourceDisk property in order to create an image. + */ + sourceImage?: string; + /** The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. */ + sourceImageEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or + * a previous instance of a given image name. + */ + sourceImageId?: string; + /** The type of the image used to create this disk. The default and only value is RAW */ + sourceType?: string; + /** + * [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully + * created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + */ + status?: string; + } + interface ImageList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Image resources. */ + items?: Image[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Instance { + /** + * Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to + * forward routes. For more information, see Enabling IP Forwarding. + */ + canIpForward?: boolean; + /** [Output Only] The CPU platform used by this instance. */ + cpuPlatform?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** Array of disks associated with this instance. Persistent disks must be created before you can assign them. */ + disks?: AttachedDisk[]; + /** List of the type and count of accelerator cards attached to the instance. */ + guestAccelerators?: AcceleratorConfig[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#instance for instances. */ + kind?: string; + /** + * A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially + * generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in + * order to update or change metadata. + * + * To see the latest fingerprint, make get() request to the instance. + */ + labelFingerprint?: string; + /** Labels to apply to this instance. These can be later modified by the setLabels method. */ + labels?: Record; + /** + * Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the + * client when the instance is created. For example, the following is a valid partial url to a predefined machine type: + * + * zones/us-central1-f/machineTypes/n1-standard-1 + * + * To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, + * etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 + * MB): + * + * zones/zone/machineTypes/custom-CPUS-MEMORY + * + * For example: zones/us-central1-f/machineTypes/custom-4-5120 + * + * For a full list of restrictions, read the Specifications for custom machine types. + */ + machineType?: string; + /** The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. */ + metadata?: Metadata; + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel + * Haswell" or minCpuPlatform: "Intel Sandy Bridge". + */ + minCpuPlatform?: string; + /** + * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + * character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot + * be a dash. + */ + name?: string; + /** + * An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as + * connecting to the internet. Multiple interfaces are supported per instance. + */ + networkInterfaces?: NetworkInterface[]; + /** Sets the scheduling options for this instance. */ + scheduling?: Scheduling; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** + * A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. + * + * Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See + * Service Accounts for more information. + */ + serviceAccounts?: ServiceAccount[]; + /** [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. */ + startRestricted?: boolean; + /** + * [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and + * TERMINATED. + */ + status?: string; + /** [Output Only] An optional, human-readable explanation of the status. */ + statusMessage?: string; + /** + * A list of tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client + * during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. + */ + tags?: Tags; + /** [Output Only] URL of the zone where the instance resides. */ + zone?: string; + } + interface InstanceAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstancesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroup { + /** [Output Only] The creation timestamp for this instance group in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports + * concurrently. + */ + fingerprint?: string; + /** [Output Only] A unique identifier for this instance group, generated by the server. */ + id?: string; + /** [Output Only] The resource type, which is always compute#instanceGroup for instance groups. */ + kind?: string; + /** The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. */ + name?: string; + /** + * Assigns a name to a port number. For example: {name: "http", port: 80} + * + * This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: + * [{name: "http", port: 80},{name: "http", port: 8080}] + * + * Named ports apply to all instances in this instance group. + */ + namedPorts?: NamedPort[]; + /** The URL of the network to which all instances in the instance group belong. */ + network?: string; + /** The URL of the region where the instance group is located (for regional resources). */ + region?: string; + /** [Output Only] The URL for this instance group. The server generates this URL. */ + selfLink?: string; + /** [Output Only] The total number of instances in the instance group. */ + size?: number; + /** The URL of the subnetwork to which all instances in the instance group belong. */ + subnetwork?: string; + /** [Output Only] The URL of the zone where the instance group is located (for zonal resources). */ + zone?: string; + } + interface InstanceGroupAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupsScopedList resources. */ + items?: Record; + /** [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroup resources. */ + items?: InstanceGroup[]; + /** [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManager { + /** + * The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a + * random four-character string to the base instance name. The base instance name must comply with RFC1035. + */ + baseInstanceName?: string; + /** [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. */ + currentActions?: InstanceGroupManagerActionsSummary; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The fingerprint of the resource data. You can use this optional field for optimistic locking when you update the resource. */ + fingerprint?: string; + /** [Output Only] A unique identifier for this resource type. The server generates this identifier. */ + id?: string; + /** [Output Only] The URL of the Instance Group resource. */ + instanceGroup?: string; + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the + * managed instance group. + */ + instanceTemplate?: string; + /** [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. */ + kind?: string; + /** The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. */ + name?: string; + /** Named ports configured for the Instance Groups complementary to this Instance Group Manager. */ + namedPorts?: NamedPort[]; + /** [Output Only] The URL of the region where the managed instance group resides (for regional resources). */ + region?: string; + /** [Output Only] The URL for this managed instance group. The server defines this URL. */ + selfLink?: string; + /** + * The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the + * instances in the managed instance group. + */ + targetPools?: string[]; + /** + * The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group + * changes this number. + */ + targetSize?: number; + /** [Output Only] The URL of the zone where the managed instance group is located (for zonal resources). */ + zone?: string; + } + interface InstanceGroupManagerActionsSummary { + /** + * [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from + * the managed instance group without deleting it. + */ + abandoning?: number; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails + * to create any of these instances, it tries again until it creates the instance successfully. + * + * If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + */ + creating?: number; + /** + * [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If + * the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + */ + creatingWithoutRetries?: number; + /** [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. */ + deleting?: number; + /** [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. */ + none?: number; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. + * Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + */ + recreating?: number; + /** + * [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a + * recreate action. For example, setting or removing target pools for the instance. + */ + refreshing?: number; + /** [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. */ + restarting?: number; + } + interface InstanceGroupManagerAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupManagersScopedList resources. */ + items?: Record; + /** [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManagerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupManager resources. */ + items?: InstanceGroupManager[]; + /** [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManagersAbandonInstancesRequest { + /** The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface InstanceGroupManagersDeleteInstancesRequest { + /** The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface InstanceGroupManagersListManagedInstancesResponse { + /** [Output Only] The list of instances in the managed instance group. */ + managedInstances?: ManagedInstance[]; + } + interface InstanceGroupManagersRecreateInstancesRequest { + /** The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface InstanceGroupManagersScopedList { + /** [Output Only] The list of managed instance groups that are contained in the specified project and zone. */ + instanceGroupManagers?: InstanceGroupManager[]; + /** [Output Only] The warning that replaces the list of managed instance groups when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManagersSetInstanceTemplateRequest { + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the + * managed instance group. + */ + instanceTemplate?: string; + } + interface InstanceGroupManagersSetTargetPoolsRequest { + /** + * The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings + * concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not + * overwrite changes that were applied from another concurrent request. + */ + fingerprint?: string; + /** + * The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of + * the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + */ + targetPools?: string[]; + } + interface InstanceGroupsAddInstancesRequest { + /** The list of instances to add to the instance group. */ + instances?: InstanceReference[]; + } + interface InstanceGroupsListInstances { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceWithNamedPorts resources. */ + items?: InstanceWithNamedPorts[]; + /** [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupsListInstancesRequest { + /** + * A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes + * all instances regardless of their state. + */ + instanceState?: string; + } + interface InstanceGroupsRemoveInstancesRequest { + /** The list of instances to remove from the instance group. */ + instances?: InstanceReference[]; + } + interface InstanceGroupsScopedList { + /** [Output Only] The list of instance groups that are contained in this scope. */ + instanceGroups?: InstanceGroup[]; + /** [Output Only] An informational warning that replaces the list of instance groups when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the + * named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure + * that you do not overwrite changes that were applied from another concurrent request. + */ + fingerprint?: string; + /** The list of named ports to set for this instance group. */ + namedPorts?: NamedPort[]; + } + interface InstanceList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Instance resources. */ + items?: Instance[]; + /** [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceMoveRequest { + /** + * The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone + * - projects/project/zones/zone + * - zones/zone + */ + destinationZone?: string; + /** + * The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance + * - zones/zone/instances/instance + */ + targetInstance?: string; + } + interface InstanceProperties { + /** + * Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP + * addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. + * If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + */ + canIpForward?: boolean; + /** An optional text description for the instances that are created from this instance template. */ + description?: string; + /** An array of disks that are associated with the instances that are created from this template. */ + disks?: AttachedDisk[]; + /** A list of guest accelerator cards' type and count to use for instances created from the instance template. */ + guestAccelerators?: AcceleratorConfig[]; + /** Labels to apply to instances that are created from this template. */ + labels?: Record; + /** The machine type to use for instances that are created from this template. */ + machineType?: string; + /** + * The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. + * See Project and instance metadata for more information. + */ + metadata?: Metadata; + /** + * Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying + * a Minimum CPU Platform. + */ + minCpuPlatform?: string; + /** An array of network access configurations for this interface. */ + networkInterfaces?: NetworkInterface[]; + /** Specifies the scheduling options for the instances that are created from this template. */ + scheduling?: Scheduling; + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this + * template. Use metadata queries to obtain the access tokens for these instances. + */ + serviceAccounts?: ServiceAccount[]; + /** + * A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The + * setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + */ + tags?: Tags; + } + interface InstanceReference { + /** The URL for a specific instance. */ + instance?: string; + } + interface InstanceTemplate { + /** [Output Only] The creation timestamp for this instance template in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] A unique identifier for this instance template. The server defines this identifier. */ + id?: string; + /** [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. */ + kind?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The instance properties for this instance template. */ + properties?: InstanceProperties; + /** [Output Only] The URL for this instance template. The server defines this URL. */ + selfLink?: string; + } + interface InstanceTemplateList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceTemplate resources. */ + items?: InstanceTemplate[]; + /** [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceWithNamedPorts { + /** [Output Only] The URL of the instance. */ + instance?: string; + /** [Output Only] The named ports that belong to this instance group. */ + namedPorts?: NamedPort[]; + /** [Output Only] The status of the instance. */ + status?: string; + } + interface InstancesScopedList { + /** [Output Only] List of instances contained in this scope. */ + instances?: Instance[]; + /** [Output Only] Informational warning which replaces the list of instances when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstancesSetLabelsRequest { + /** + * Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to + * add or change labels. + */ + labelFingerprint?: string; + labels?: Record; + } + interface InstancesSetMachineResourcesRequest { + /** List of the type and count of accelerator cards attached to the instance. */ + guestAccelerators?: AcceleratorConfig[]; + } + interface InstancesSetMachineTypeRequest { + /** + * Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: + * zones/us-central1-f/machineTypes/n1-standard-1 + */ + machineType?: string; + } + interface InstancesSetMinCpuPlatformRequest { + /** Minimum cpu/platform this instance should be started at. */ + minCpuPlatform?: string; + } + interface InstancesSetServiceAccountRequest { + /** Email address of the service account. */ + email?: string; + /** The list of scopes to be made available for this service account. */ + scopes?: string[]; + } + interface InstancesStartWithEncryptionKeyRequest { + /** + * Array of disks associated with this instance that are protected with a customer-supplied encryption key. + * + * In order to start the instance, the disk url and its corresponding key must be provided. + * + * If the disk is not protected with a customer-supplied encryption key it should not be specified. + */ + disks?: CustomerEncryptionKeyProtectedDisk[]; + } + interface License { + /** [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. */ + chargesUseFee?: boolean; + /** [Output Only] Type of resource. Always compute#license for licenses. */ + kind?: string; + /** [Output Only] Name of the resource. The name is 1-63 characters long and complies with RFC1035. */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface MachineType { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this machine type. */ + deprecated?: DeprecationStatus; + /** [Output Only] An optional textual description of the resource. */ + description?: string; + /** [Output Only] The number of virtual CPUs that are available to the instance. */ + guestCpus?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Deprecated] This property is deprecated and will never be populated with any relevant values. */ + imageSpaceGb?: number; + /** [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. */ + isSharedCpu?: boolean; + /** [Output Only] The type of the resource. Always compute#machineType for machine types. */ + kind?: string; + /** [Output Only] Maximum persistent disks allowed. */ + maximumPersistentDisks?: number; + /** [Output Only] Maximum total persistent disks size (GB) allowed. */ + maximumPersistentDisksSizeGb?: string; + /** [Output Only] The amount of physical memory available to the instance, defined in MB. */ + memoryMb?: number; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] List of extended scratch disks assigned to the instance. */ + scratchDisks?: Array<{ + /** Size of the scratch disk, defined in GB. */ + diskGb?: number; + }>; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The name of the zone where the machine type resides, such as us-central1-a. */ + zone?: string; + } + interface MachineTypeAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of MachineTypesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface MachineTypeList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of MachineType resources. */ + items?: MachineType[]; + /** [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface MachineTypesScopedList { + /** [Output Only] List of machine types contained in this scope. */ + machineTypes?: MachineType[]; + /** [Output Only] An informational warning that appears when the machine types list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ManagedInstance { + /** + * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: + * - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. + * - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + * - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it + * does not try again and the group's targetSize value is decreased instead. + * - RECREATING The managed instance group is recreating this instance. + * - DELETING The managed instance group is permanently deleting this instance. + * - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools + * that are associated with this group. + * - RESTARTING The managed instance group is restarting the instance. + * - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the + * target pool list for an instance without stopping that instance. + */ + currentAction?: string; + /** [Output only] The unique identifier for this resource. This field is empty when instance does not exist. */ + id?: string; + /** [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. */ + instance?: string; + /** [Output Only] The status of the instance. This field is empty when the instance does not exist. */ + instanceStatus?: string; + /** [Output Only] Information about the last attempt to create or delete the instance. */ + lastAttempt?: ManagedInstanceLastAttempt; + } + interface ManagedInstanceLastAttempt { + /** [Output Only] Encountered errors during the last attempt to create or delete the instance. */ + errors?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + } + interface Metadata { + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint + * hash in order to update or change metadata. + */ + fingerprint?: string; + /** Array of key/value pairs. The total size of all keys and values must be less than 512 KB. */ + items?: Array<{ + /** + * Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part + * of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + */ + key?: string; + /** + * Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only + * restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + */ + value?: string; + }>; + /** [Output Only] Type of the resource. Always compute#metadata for metadata. */ + kind?: string; + } + interface NamedPort { + /** The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. */ + name?: string; + /** The port number, which can be a value between 1 and 65535. */ + port?: number; + } + interface Network { + /** + * The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client + * when the network is created. + */ + IPv4Range?: string; + /** + * When set to true, the network is created in "auto subnet mode". When set to false, the network is in "custom subnet mode". + * + * In "auto subnet mode", a newly created network is assigned the default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork per region. + */ + autoCreateSubnetworks?: boolean; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * A gateway address for default routing to other networks. This value is read only and is selected by the Google Compute Engine, typically as the first + * usable address in the IPv4Range. + */ + gatewayIPv4?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#network for networks. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] List of network peerings for the resource. */ + peerings?: NetworkPeering[]; + /** The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. */ + routingConfig?: NetworkRoutingConfig; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Server-defined fully-qualified URLs for all subnetworks in this network. */ + subnetworks?: string[]; + } + interface NetworkInterface { + /** + * An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs + * specified, then this instance will have no external internet access. + */ + accessConfigs?: AccessConfig[]; + /** An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. */ + aliasIpRanges?: AliasIpRange[]; + /** [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. */ + kind?: string; + /** [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc. */ + name?: string; + /** + * URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network + * global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. + * + * This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is + * used. + * + * If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project/global/networks/network + * - projects/project/global/networks/network + * - global/networks/default + */ + network?: string; + /** + * An IPv4 internal network address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned + * by the system. + */ + networkIP?: string; + /** + * The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in + * auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify + * this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + * - regions/region/subnetworks/subnetwork + */ + subnetwork?: string; + } + interface NetworkList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Network resources. */ + items?: Network[]; + /** [Output Only] Type of resource. Always compute#networkList for lists of networks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface NetworkPeering { + /** + * Whether full mesh connectivity is created and managed automatically. When it is set to true, Google Compute Engine will automatically create and manage + * the routes between two networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer network. + */ + autoCreateRoutes?: boolean; + /** + * Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 + * characters long and match regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all the + * following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not + * contain project, it is assumed that the peer network is in the same project as the current network. + */ + network?: string; + /** [Output Only] State for the peering. */ + state?: string; + /** [Output Only] Details about the current state of the peering. */ + stateDetails?: string; + } + interface NetworkRoutingConfig { + /** + * The network-wide routing mode to use. If set to REGIONAL, this network's cloud routers will only advertise routes with subnetworks of this network in + * the same region as the router. If set to GLOBAL, this network's cloud routers will advertise routes with all subnetworks of this network, across + * regions. + */ + routingMode?: string; + } + interface NetworksAddPeeringRequest { + /** Whether Google Compute Engine manages the routes automatically. */ + autoCreateRoutes?: boolean; + /** Name of the peering, which should conform to RFC1035. */ + name?: string; + /** + * URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not + * contain project, it is assumed that the peer network is in the same project as the current network. + */ + peerNetwork?: string; + } + interface NetworksRemovePeeringRequest { + /** Name of the peering, which should conform to RFC1035. */ + name?: string; + } + interface Operation { + /** [Output Only] Reserved for future use. */ + clientOperationId?: string; + /** [Deprecated] This field is deprecated. */ + creationTimestamp?: string; + /** [Output Only] A textual description of the operation, which is set when the operation is created. */ + description?: string; + /** [Output Only] The time that this operation was completed. This value is in RFC3339 text format. */ + endTime?: string; + /** [Output Only] If errors are generated during processing of the operation, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. */ + httpErrorMessage?: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not + * found. + */ + httpErrorStatusCode?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The time that this operation was requested. This value is in RFC3339 text format. */ + insertTime?: string; + /** [Output Only] Type of the resource. Always compute#operation for Operation resources. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] The type of operation, such as insert, update, or delete, and so on. */ + operationType?: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation + * progresses. + */ + progress?: number; + /** [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. */ + startTime?: string; + /** [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. */ + status?: string; + /** [Output Only] An optional textual description of the current status of the operation. */ + statusMessage?: string; + /** [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. */ + targetId?: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk + * that the snapshot was created from. + */ + targetLink?: string; + /** [Output Only] User who requested the operation, for example: user@example.com. */ + user?: string; + /** [Output Only] If warning messages are generated during processing of the operation, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + /** [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. */ + zone?: string; + } + interface OperationAggregatedList { + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] A map of scoped operation lists. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface OperationList { + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] A list of Operation resources. */ + items?: Operation[]; + /** [Output Only] Type of resource. Always compute#operations for Operations resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface OperationsScopedList { + /** [Output Only] List of operations contained in this scope. */ + operations?: Operation[]; + /** [Output Only] Informational warning which replaces the list of operations when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface PathMatcher { + /** + * The full or partial URL to the BackendService resource. This will be used if none of the pathRules defined by this PathMatcher is matched by the URL's + * path portion. For example, the following are all valid URLs to a BackendService resource: + * - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService + * - compute/v1/projects/project/global/backendServices/backendService + * - global/backendServices/backendService + */ + defaultService?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** The name to which this PathMatcher is referred by the HostRule. */ + name?: string; + /** The list of path rules. */ + pathRules?: PathRule[]; + } + interface PathRule { + /** + * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path + * matcher does not include any text after the first ? or #, and those chars are not allowed here. + */ + paths?: string[]; + /** The URL of the BackendService resource if this rule is matched. */ + service?: string; + } + interface Project { + /** Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. */ + commonInstanceMetadata?: Metadata; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] Default service account used by VMs running in this project. */ + defaultServiceAccount?: string; + /** An optional textual description of the resource. */ + description?: string; + /** Restricted features enabled for use on this project. */ + enabledFeatures?: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID + * used by Compute Engine to identify resources. + */ + id?: string; + /** [Output Only] Type of the resource. Always compute#project for projects. */ + kind?: string; + /** The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. */ + name?: string; + /** [Output Only] Quotas assigned to this project. */ + quotas?: Quota[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. */ + usageExportLocation?: UsageExportLocation; + /** [Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated. */ + xpnProjectStatus?: string; + } + interface ProjectsDisableXpnResourceRequest { + /** Service resource (a.k.a service project) ID. */ + xpnResource?: XpnResourceId; + } + interface ProjectsEnableXpnResourceRequest { + /** Service resource (a.k.a service project) ID. */ + xpnResource?: XpnResourceId; + } + interface ProjectsGetXpnResources { + /** [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** Service resources (a.k.a service projects) attached to this project as their shared VPC host. */ + resources?: XpnResourceId[]; + } + interface ProjectsListXpnHostsRequest { + /** + * Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be + * inferred from the project. + */ + organization?: string; + } + interface Quota { + /** [Output Only] Quota limit for this metric. */ + limit?: number; + /** [Output Only] Name of the quota metric. */ + metric?: string; + /** [Output Only] Current usage of this metric. */ + usage?: number; + } + interface Region { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this region. */ + deprecated?: DeprecationStatus; + /** [Output Only] Textual description of the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#region for regions. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Quotas assigned to this region. */ + quotas?: Quota[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Status of the region, either UP or DOWN. */ + status?: string; + /** [Output Only] A list of zones available in this region, in the form of resource URLs. */ + zones?: string[]; + } + interface RegionAutoscalerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Autoscaler resources. */ + items?: Autoscaler[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroup resources. */ + items?: InstanceGroup[]; + /** The resource type. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupManagerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupManager resources. */ + items?: InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional + * scope. + */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupManagersAbandonInstancesRequest { + /** The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface RegionInstanceGroupManagersDeleteInstancesRequest { + /** The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface RegionInstanceGroupManagersListInstancesResponse { + /** List of managed instances. */ + managedInstances?: ManagedInstance[]; + } + interface RegionInstanceGroupManagersRecreateRequest { + /** The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface RegionInstanceGroupManagersSetTargetPoolsRequest { + /** + * Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool + * entries. This field is optional. + */ + fingerprint?: string; + /** + * The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the + * instances in the managed instance group. + */ + targetPools?: string[]; + } + interface RegionInstanceGroupManagersSetTemplateRequest { + /** URL of the InstanceTemplate resource from which all new instances will be created. */ + instanceTemplate?: string; + } + interface RegionInstanceGroupsListInstances { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceWithNamedPorts resources. */ + items?: InstanceWithNamedPorts[]; + /** The resource type. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupsListInstancesRequest { + /** Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. */ + instanceState?: string; + /** + * Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named + * ports will be returned. Always lists all instances. + */ + portName?: string; + } + interface RegionInstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the + * named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure + * that you do not overwrite changes that were applied from another concurrent request. + */ + fingerprint?: string; + /** The list of named ports to set for this instance group. */ + namedPorts?: NamedPort[]; + } + interface RegionList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Region resources. */ + items?: Region[]; + /** [Output Only] Type of resource. Always compute#regionList for lists of regions. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ResourceCommitment { + /** + * The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be + * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + */ + amount?: string; + /** Type of resource for which this commitment applies. Possible values are VCPU and MEMORY */ + type?: string; + } + interface ResourceGroupReference { + /** A URI referencing one of the instance groups listed in the backend service. */ + group?: string; + } + interface Route { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** The destination range of outgoing packets that this route applies to. Only IPv4 is supported. */ + destRange?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of this resource. Always compute#routes for Route resources. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Fully-qualified URL of the network that this route applies to. */ + network?: string; + /** + * The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: + * projects//global/gateways/default-internet-gateway + */ + nextHopGateway?: string; + /** + * The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + */ + nextHopInstance?: string; + /** The network IP address of an instance that should handle matching packets. Only IPv4 is supported. */ + nextHopIp?: string; + /** The URL of the local network if it should handle matching packets. */ + nextHopNetwork?: string; + /** [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. */ + nextHopPeering?: string; + /** The URL to a VpnTunnel that should handle matching packets. */ + nextHopVpnTunnel?: string; + /** + * The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of + * two routes with equal prefix length, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535. + */ + priority?: number; + /** [Output Only] Server-defined fully-qualified URL for this resource. */ + selfLink?: string; + /** A list of instance tags to which this route applies. */ + tags?: string[]; + /** [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + } + interface RouteList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Route resources. */ + items?: Route[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Router { + /** BGP information specific to this router. */ + bgp?: RouterBgp; + /** + * BGP information that needs to be configured into the routing stack to establish the BGP peering. It must specify peer ASN and either interface name, + * IP, or peer IP. Please refer to RFC4273. + */ + bgpPeers?: RouterBgpPeer[]; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * Router interfaces. Each interface requires either one linked resource (e.g. linkedVpnTunnel), or IP address and IP address range (e.g. ipRange), or + * both. + */ + interfaces?: RouterInterface[]; + /** [Output Only] Type of resource. Always compute#router for routers. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** URI of the network to which this router belongs. */ + network?: string; + /** [Output Only] URI of the region where the router resides. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface RouterAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Router resources. */ + items?: Record; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RouterBgp { + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. + * All VPN tunnels that link to this router will have the same local ASN. + */ + asn?: number; + } + interface RouterBgpPeer { + /** + * The priority of routes advertised to this BGP peer. In the case where there is more than one matching route of maximum length, the routes with lowest + * priority value win. + */ + advertisedRoutePriority?: number; + /** Name of the interface the BGP peer is associated with. */ + interfaceName?: string; + /** IP address of the interface inside Google Cloud Platform. Only IPv4 is supported. */ + ipAddress?: string; + /** Name of this BGP peer. The name must be 1-63 characters long and comply with RFC1035. */ + name?: string; + /** Peer BGP Autonomous System Number (ASN). For VPN use case, this value can be different for every tunnel. */ + peerAsn?: number; + /** IP address of the BGP interface outside Google cloud. Only IPv4 is supported. */ + peerIpAddress?: string; + } + interface RouterInterface { + /** + * IP address and range of the interface. The IP range must be in the RFC3927 link-local IP space. The value must be a CIDR-formatted string, for example: + * 169.254.0.1/30. NOTE: Do not truncate the address as it represents the IP address of the interface. + */ + ipRange?: string; + /** + * URI of the linked VPN tunnel. It must be in the same region as the router. Each interface can have at most one linked resource and it could either be a + * VPN Tunnel or an interconnect attachment. + */ + linkedVpnTunnel?: string; + /** Name of this interface entry. The name must be 1-63 characters long and comply with RFC1035. */ + name?: string; + } + interface RouterList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Router resources. */ + items?: Router[]; + /** [Output Only] Type of resource. Always compute#router for routers. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RouterStatus { + /** Best routes for this router's network. */ + bestRoutes?: Route[]; + /** Best routes learned by this router. */ + bestRoutesForRouter?: Route[]; + bgpPeerStatus?: RouterStatusBgpPeerStatus[]; + /** URI of the network to which this router belongs. */ + network?: string; + } + interface RouterStatusBgpPeerStatus { + /** Routes that were advertised to the remote BGP peer */ + advertisedRoutes?: Route[]; + /** IP address of the local BGP interface. */ + ipAddress?: string; + /** URL of the VPN tunnel that this BGP peer controls. */ + linkedVpnTunnel?: string; + /** Name of this BGP peer. Unique within the Routers resource. */ + name?: string; + /** Number of routes learned from the remote BGP Peer. */ + numLearnedRoutes?: number; + /** IP address of the remote BGP interface. */ + peerIpAddress?: string; + /** BGP state as specified in RFC1771. */ + state?: string; + /** Status of the BGP peer: {UP, DOWN} */ + status?: string; + /** Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds */ + uptime?: string; + /** Time this session has been up, in seconds. Format: 145 */ + uptimeSeconds?: string; + } + interface RouterStatusResponse { + /** Type of resource. */ + kind?: string; + result?: RouterStatus; + } + interface RoutersPreviewResponse { + /** Preview of given router. */ + resource?: Router; + } + interface RoutersScopedList { + /** List of routers contained in this scope. */ + routers?: Router[]; + /** Informational warning which replaces the list of routers when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SSLHealthCheck { + /** The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** + * The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can only be ASCII. + */ + request?: string; + /** + * The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data + * can only be ASCII. + */ + response?: string; + } + interface Scheduling { + /** + * Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the + * automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. + * + * By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + */ + automaticRestart?: boolean; + /** + * Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and + * only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. + */ + onHostMaintenance?: string; + /** + * Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been + * created. + */ + preemptible?: boolean; + } + interface SerialPortOutput { + /** [Output Only] The contents of the console output. */ + contents?: string; + /** [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. */ + kind?: string; + /** [Output Only] The position of the next byte of content from the serial console output. Use this value in the next request as the start parameter. */ + next?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** + * The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output + * exceeds the size of the buffer, older output will be overwritten by newer content and the start values will be mismatched. + */ + start?: string; + } + interface ServiceAccount { + /** Email address of the service account. */ + email?: string; + /** The list of scopes to be made available for this service account. */ + scopes?: string[]; + } + interface Snapshot { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] Size of the snapshot, specified in GB. */ + diskSizeGb?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. */ + kind?: string; + /** + * A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint + * is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint + * hash in order to update or change labels. + * + * To see the latest fingerprint, make a get() request to retrieve a snapshot. + */ + labelFingerprint?: string; + /** Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. */ + labels?: Record; + /** + * [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a + * Windows image). + */ + licenses?: string[]; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * Encrypts the snapshot using a customer-supplied encryption key. + * + * After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the image later For example, you must provide the + * encryption key when you create a disk from the encrypted snapshot in a future request. + * + * Customer-supplied encryption keys do not protect access to metadata of the disk. + * + * If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do + * not need to provide a key to use the snapshot later. + */ + snapshotEncryptionKey?: CustomerEncryptionKey; + /** [Output Only] The source disk used to create this snapshot. */ + sourceDisk?: string; + /** The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. */ + sourceDiskEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the + * current or a previous instance of a given disk name. + */ + sourceDiskId?: string; + /** [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. */ + status?: string; + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot + * creation/deletion. + */ + storageBytes?: string; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status + * can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + */ + storageBytesStatus?: string; + } + interface SnapshotList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Snapshot resources. */ + items?: Snapshot[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SslCertificate { + /** + * A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at + * least one intermediate cert. + */ + certificate?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** A write-only private key in PEM format. Only insert requests will include this field. */ + privateKey?: string; + /** [Output only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface SslCertificateList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of SslCertificate resources. */ + items?: SslCertificate[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Subnetwork { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. */ + description?: string; + /** + * [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource + * creation time. + */ + gatewayAddress?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or + * 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation + * time. + */ + ipCidrRange?: string; + /** [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. */ + kind?: string; + /** + * The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the + * distributed mode can have subnetworks. This field can be set only at resource creation time. + */ + network?: string; + /** + * Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time + * and updated using setPrivateIpGoogleAccess. + */ + privateIpGoogleAccess?: boolean; + /** URL of the region where the Subnetwork resides. This field can be set only at resource creation time. */ + region?: string; + /** + * An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary + * ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. + */ + secondaryIpRanges?: SubnetworkSecondaryRange[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface SubnetworkAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of SubnetworksScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SubnetworkList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Subnetwork resources. */ + items?: Subnetwork[]; + /** [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SubnetworkSecondaryRange { + /** + * The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and + * non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. + */ + ipCidrRange?: string; + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, + * and comply with RFC1035. The name must be unique within the subnetwork. + */ + rangeName?: string; + } + interface SubnetworksExpandIpCidrRangeRequest { + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within + * this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + */ + ipCidrRange?: string; + } + interface SubnetworksScopedList { + /** List of subnetworks contained in this scope. */ + subnetworks?: Subnetwork[]; + /** An informational warning that appears when the list of addresses is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SubnetworksSetPrivateIpGoogleAccessRequest { + privateIpGoogleAccess?: boolean; + } + interface TCPHealthCheck { + /** The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** + * The application data to send once the TCP connection has been established (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can only be ASCII. + */ + request?: string; + /** + * The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data + * can only be ASCII. + */ + response?: string; + } + interface Tags { + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint + * hash in order to update or change metadata. + * + * To see the latest fingerprint, make get() request to the instance. + */ + fingerprint?: string; + /** An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. */ + items?: string[]; + } + interface TargetHttpProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** URL to the UrlMap resource that defines the mapping from URL to the BackendService. */ + urlMap?: string; + } + interface TargetHttpProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetHttpProxy resources. */ + items?: TargetHttpProxy[]; + /** Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetHttpsProxiesSetSslCertificatesRequest { + /** New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. */ + sslCertificates?: string[]; + } + interface TargetHttpsProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. Currently, exactly one SSL certificate + * must be specified. + */ + sslCertificates?: string[]; + /** + * A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are + * all valid URLs for specifying a URL map: + * - https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map + * - projects/project/global/urlMaps/url-map + * - global/urlMaps/url-map + */ + urlMap?: string; + } + interface TargetHttpsProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetHttpsProxy resources. */ + items?: TargetHttpsProxy[]; + /** Type of resource. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetInstance { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the + * fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance + * - zones/zone/instances/instance + */ + instance?: string; + /** [Output Only] The type of the resource. Always compute#targetInstance for target instances. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. */ + natPolicy?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] URL of the zone where the target instance resides. */ + zone?: string; + } + interface TargetInstanceAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetInstance resources. */ + items?: Record; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetInstanceList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetInstance resources. */ + items?: TargetInstance[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetInstancesScopedList { + /** List of target instances contained in this scope. */ + targetInstances?: TargetInstance[]; + /** Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetPool { + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly + * set to a value between [0, 1]. + * + * backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary + * pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. + * + * In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the + * primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is + * healthy. + */ + backupPool?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some + * other target pool). The value of the field must be in [0, 1]. + * + * If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in + * the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. + * + * In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in + * the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + */ + failoverRatio?: number; + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. An empty list + * means all member instances will be considered healthy at all times. Only HttpHealthChecks are supported. Only one health check may be specified. + */ + healthChecks?: string[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. */ + instances?: string[]; + /** [Output Only] Type of the resource. Always compute#targetPool for target pools. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] URL of the region where the target pool resides. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * Sesssion affinity option, must be one of the following values: + * NONE: Connections from the same client IP may go to any instance in the pool. + * CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. + * CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains + * healthy. + */ + sessionAffinity?: string; + } + interface TargetPoolAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetPool resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetPoolInstanceHealth { + healthStatus?: HealthStatus[]; + /** [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. */ + kind?: string; + } + interface TargetPoolList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetPool resources. */ + items?: TargetPool[]; + /** [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetPoolsAddHealthCheckRequest { + /** The HttpHealthCheck to add to the target pool. */ + healthChecks?: HealthCheckReference[]; + } + interface TargetPoolsAddInstanceRequest { + /** + * A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + * - projects/project-id/zones/zone/instances/instance-name + * - zones/zone/instances/instance-name + */ + instances?: InstanceReference[]; + } + interface TargetPoolsRemoveHealthCheckRequest { + /** + * Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: + * - https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + * - projects/project/global/httpHealthChecks/health-check + * - global/httpHealthChecks/health-check + */ + healthChecks?: HealthCheckReference[]; + } + interface TargetPoolsRemoveInstanceRequest { + /** URLs of the instances to be removed from target pool. */ + instances?: InstanceReference[]; + } + interface TargetPoolsScopedList { + /** List of target pools contained in this scope. */ + targetPools?: TargetPool[]; + /** Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetReference { + target?: string; + } + interface TargetSslProxiesSetBackendServiceRequest { + /** The URL of the new BackendService resource for the targetSslProxy. */ + service?: string; + } + interface TargetSslProxiesSetProxyHeaderRequest { + /** The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. */ + proxyHeader?: string; + } + interface TargetSslProxiesSetSslCertificatesRequest { + /** New set of URLs to SslCertificate resources to associate with this TargetSslProxy. Currently exactly one ssl certificate must be specified. */ + sslCertificates?: string[]; + } + interface TargetSslProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** URL to the BackendService resource. */ + service?: string; + /** URLs to SslCertificate resources that are used to authenticate connections to Backends. Currently exactly one SSL certificate must be specified. */ + sslCertificates?: string[]; + } + interface TargetSslProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetSslProxy resources. */ + items?: TargetSslProxy[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetTcpProxiesSetBackendServiceRequest { + /** The URL of the new BackendService resource for the targetTcpProxy. */ + service?: string; + } + interface TargetTcpProxiesSetProxyHeaderRequest { + /** The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. */ + proxyHeader?: string; + } + interface TargetTcpProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** URL to the BackendService resource. */ + service?: string; + } + interface TargetTcpProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetTcpProxy resources. */ + items?: TargetTcpProxy[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetVpnGateway { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated to a VPN + * gateway. + */ + forwardingRules?: string[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. */ + network?: string; + /** [Output Only] URL of the region where the target VPN gateway resides. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The status of the VPN gateway. */ + status?: string; + /** [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using compute.vpntunnels.insert method and associated to a VPN gateway. */ + tunnels?: string[]; + } + interface TargetVpnGatewayAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetVpnGateway resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetVpnGatewayList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetVpnGateway resources. */ + items?: TargetVpnGateway[]; + /** [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetVpnGatewaysScopedList { + /** [Output Only] List of target vpn gateways contained in this scope. */ + targetVpnGateways?: TargetVpnGateway[]; + /** [Output Only] Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TestFailure { + actualService?: string; + expectedService?: string; + host?: string; + path?: string; + } + interface UrlMap { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** The URL of the BackendService resource if none of the hostRules match. */ + defaultService?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when + * inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap. + */ + fingerprint?: string; + /** The list of HostRules to use against the URL. */ + hostRules?: HostRule[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#urlMaps for url maps. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The list of named PathMatchers to use against the URL. */ + pathMatchers?: PathMatcher[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** The list of expected URL mappings. Request to update this UrlMap will succeed only if all of the test cases pass. */ + tests?: UrlMapTest[]; + } + interface UrlMapList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of UrlMap resources. */ + items?: UrlMap[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface UrlMapReference { + urlMap?: string; + } + interface UrlMapTest { + /** Description of this test case. */ + description?: string; + /** Host portion of the URL. */ + host?: string; + /** Path portion of the URL. */ + path?: string; + /** Expected BackendService resource the given URL should be mapped to. */ + service?: string; + } + interface UrlMapValidationResult { + loadErrors?: string[]; + /** Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. */ + loadSucceeded?: boolean; + testFailures?: TestFailure[]; + /** If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. */ + testPassed?: boolean; + } + interface UrlMapsValidateRequest { + /** Content of the UrlMap to be validated. */ + resource?: UrlMap; + } + interface UrlMapsValidateResponse { + result?: UrlMapValidationResult; + } + interface UsageExportLocation { + /** + * The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this + * bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front + * of it, such as gs://example-bucket. + */ + bucketName?: string; + /** + * An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file + * named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform + * to Cloud Storage object naming conventions. + */ + reportNamePrefix?: string; + } + interface VpnTunnel { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] Detailed status message for the VPN tunnel. */ + detailedStatus?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. */ + ikeVersion?: number; + /** [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. */ + kind?: string; + /** + * Local traffic selector to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + localTrafficSelector?: string[]; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** IP address of the peer VPN gateway. Only IPv4 is supported. */ + peerIp?: string; + /** [Output Only] URL of the region where the VPN tunnel resides. */ + region?: string; + /** + * Remote traffic selectors to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + remoteTrafficSelector?: string[]; + /** URL of router resource to be used for dynamic routing. */ + router?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. */ + sharedSecret?: string; + /** Hash of the shared secret. */ + sharedSecretHash?: string; + /** [Output Only] The status of the VPN tunnel. */ + status?: string; + /** URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. */ + targetVpnGateway?: string; + } + interface VpnTunnelAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of VpnTunnelsScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface VpnTunnelList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of VpnTunnel resources. */ + items?: VpnTunnel[]; + /** [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface VpnTunnelsScopedList { + /** List of vpn tunnels contained in this scope. */ + vpnTunnels?: VpnTunnel[]; + /** Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface XpnHostList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] A list of shared VPC host project URLs. */ + items?: Project[]; + /** [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface XpnResourceId { + /** The ID of the service resource. In the case of projects, this field matches the project ID (e.g., my-project), not the project number (e.g., 12345678). */ + id?: string; + /** The type of the service resource. */ + type?: string; + } + interface Zone { + /** [Output Only] Available cpu/platform selections for the zone. */ + availableCpuPlatforms?: string[]; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this zone. */ + deprecated?: DeprecationStatus; + /** [Output Only] Textual description of the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#zone for zones. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Full URL reference to the region which hosts the zone. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Status of the zone, either UP or DOWN. */ + status?: string; + } + interface ZoneList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Zone resources. */ + items?: Zone[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ZoneSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and + * changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. + * Make a get() request to the resource to get the latest fingerprint. + */ + labelFingerprint?: string; + /** The labels to set for this resource. */ + labels?: Record; + } + interface AcceleratorTypesResource { + /** Retrieves an aggregated list of accelerator types. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. */ + get(request: { + /** Name of the accelerator type to return. */ + acceleratorType: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of accelerator types available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface AddressesResource { + /** Retrieves an aggregated list of addresses. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified address resource. */ + delete(request: { + /** Name of the address resource to delete. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified address resource. */ + get(request: { + /** Name of the address resource to return. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Creates an address resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of addresses contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AutoscalersResource { + /** Retrieves an aggregated list of autoscalers. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified autoscaler. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to delete. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to return. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Creates an autoscaler in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of autoscalers contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to patch. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Updates an autoscaler in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to update. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + } + interface BackendBucketsResource { + /** Deletes the specified BackendBucket resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to delete. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to return. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a BackendBucket resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of BackendBucket resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to patch. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the specified BackendBucket resource with the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to update. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BackendServicesResource { + /** Retrieves the list of all BackendService resources, regional and global, available to the specified project. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Name of the project scoping this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified BackendService resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to delete. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified BackendService resource. Get a list of available backend services by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to return. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the most recent health check results for this BackendService. */ + getHealth(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to which the queried instance belongs. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to + * keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of BackendService resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to patch. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to update. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DiskTypesResource { + /** Retrieves an aggregated list of disk types. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified disk type. Get a list of available disk types by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the disk type to return. */ + diskType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of disk types available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface DisksResource { + /** Retrieves an aggregated list of persistent disks. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a snapshot of a specified persistent disk. */ + createSnapshot(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the persistent disk to snapshot. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + guestFlush?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any + * snapshots previously made from the disk. You must separately delete snapshots. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the persistent disk to delete. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the persistent disk to return. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create + * an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb + * property. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Optional. Source image to restore onto a disk. */ + sourceImage?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of persistent disks contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Resizes the specified persistent disk. */ + resize(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the persistent disk. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface FirewallsResource { + /** Deletes the specified firewall. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to delete. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified firewall. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to return. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a firewall rule in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of firewall rules available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to patch. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: + * allowed, description, sourceRanges, sourceTags, targetTags. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to update. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ForwardingRulesResource { + /** Retrieves an aggregated list of forwarding rules. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified ForwardingRule resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to delete. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified ForwardingRule resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to return. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a ForwardingRule resource in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of ForwardingRule resources available to the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes target URL for forwarding rule. The new target should be of the same type as the old target. */ + setTarget(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource in which target is to be set. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GlobalAddressesResource { + /** Deletes the specified address resource. */ + delete(request: { + /** Name of the address resource to delete. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified address resource. Get a list of available addresses by making a list() request. */ + get(request: { + /** Name of the address resource to return. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Creates an address resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of global addresses. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GlobalForwardingRulesResource { + /** Deletes the specified GlobalForwardingRule resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to delete. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to return. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a GlobalForwardingRule resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of GlobalForwardingRule resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. */ + setTarget(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource in which target is to be set. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GlobalOperationsResource { + /** Retrieves an aggregated list of all operations. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified Operations resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the specified Operations resource. Get a list of operations by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of Operation resources contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface HealthChecksResource { + /** Deletes the specified HealthCheck resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to delete. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to return. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a HealthCheck resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of HealthCheck resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to patch. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a HealthCheck resource in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to update. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface HttpHealthChecksResource { + /** Deletes the specified HttpHealthCheck resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to delete. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to return. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a HttpHealthCheck resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of HttpHealthCheck resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to patch. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a HttpHealthCheck resource in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to update. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface HttpsHealthChecksResource { + /** Deletes the specified HttpsHealthCheck resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to delete. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to return. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of HttpsHealthCheck resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to patch. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to update. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ImagesResource { + /** Deletes the specified image. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the image resource to delete. */ + image: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + */ + deprecate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Image name. */ + image: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified image. Get a list of available images by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the image resource to return. */ + image: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the latest image that is part of an image family and is not deprecated. */ + getFromFamily(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the image family to search for. */ + family: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an image in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force image creation if true. */ + forceCreate?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method + * does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of + * publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InstanceGroupManagersResource { + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + abandonInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** Retrieves the list of managed instance groups and groups them by zone. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. + * Read Deleting an instance group for more information. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group to delete. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + deleteInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where you want to create the managed instance group. */ + zone: string; + }): Request; + /** Retrieves a list of managed instance groups that are contained within the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed + * instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous + * action failed, the list displays the errors for that failed action. + */ + listManagedInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + recreateInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the + * size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or + * deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + resize(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** + * The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to + * maintain the number of instances specified by this parameter. + */ + size: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change + * unless you recreate them. + */ + setInstanceTemplate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the + * instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their + * target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + */ + setTargetPools(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + } + interface InstanceGroupsResource { + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read + * Adding instances for more information. + */ + addInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group where you are adding instances. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Retrieves the list of instance groups and sorts them by zone. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read + * Deleting an instance group for more information. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group to delete. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Returns the specified instance group. Get a list of available instance groups by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Creates an instance group in the specified project using the parameters that are included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where you want to create the instance group. */ + zone: string; + }): Request; + /** Retrieves the list of instance groups that are located in the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Lists the instances in the specified instance group. */ + listInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** The name of the instance group from which you want to generate a list of included instances. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration + * before the VM instance is removed or deleted. + */ + removeInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group where the specified instances will be removed. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Sets the named ports for the specified instance group. */ + setNamedPorts(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group where the named ports are updated. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + } + interface InstanceTemplatesResource { + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group + * will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance template to delete. */ + instanceTemplate: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified instance template. Get a list of available instance templates by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance template. */ + instanceTemplate: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an + * existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of instance templates that are contained within the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InstancesResource { + /** Adds an access config to an instance's network interface. */ + addAccessConfig(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name for this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the network interface to add to this instance. */ + networkInterface: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves aggregated list of instances. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a + * disk at the same time. For more information, read Adding a persistent disk to your instance. + */ + attachDisk(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name for this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to delete. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Deletes an access config from an instance's network interface. */ + deleteAccessConfig(request: { + /** The name of the access config to delete. */ + accessConfig: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name for this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the network interface. */ + networkInterface: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Detaches a disk from an instance. */ + detachDisk(request: { + /** Data format for the response. */ + alt?: string; + /** Disk device name to detach. */ + deviceName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Instance name. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Returns the specified Instance resource. Get a list of available instances by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to return. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Returns the specified instance's serial port output. */ + getSerialPortOutput(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Specifies which COM or serial port to retrieve data from. */ + port?: number; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For + * the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + */ + start?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Creates an instance resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves the list of instances contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Performs a reset on the instance. For more information, see Resetting an instance. */ + reset(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets the auto-delete flag for a disk attached to an instance. */ + setDiskAutoDelete(request: { + /** Data format for the response. */ + alt?: string; + /** Whether to auto-delete the disk when the instance is deleted. */ + autoDelete: boolean; + /** The device name of the disk to modify. */ + deviceName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. */ + setMachineResources(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Changes the machine type for a stopped instance to the machine type specified in the request. */ + setMachineType(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets metadata for the specified instance to the data included in the request. */ + setMetadata(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read + * Specifying a Minimum CPU Platform. + */ + setMinCpuPlatform(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets an instance's scheduling options. */ + setScheduling(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Instance name. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. */ + setServiceAccount(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to start. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets tags for the specified instance to the data included in the request. */ + setTags(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + start(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to start. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + startWithEncryptionKey(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to start. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, + * virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP + * addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to stop. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface LicensesResource { + /** Returns the specified License resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the License resource to return. */ + license: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MachineTypesResource { + /** Retrieves an aggregated list of machine types. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified machine type. Get a list of available machine types by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the machine type to return. */ + machineType: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of machine types available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface NetworksResource { + /** Adds a peering to the specified network. */ + addPeering(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network resource to add peering to. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified network. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to delete. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified network. Get a list of available networks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to return. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a network in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of networks available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Patches the specified network with the data included in the request. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to update. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes a peering from the specified network. */ + removePeering(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network resource to remove peering from. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Switches the network mode from auto subnet mode to custom subnet mode. */ + switchToCustomMode(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to be updated. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Disable this project as a shared VPC host project. */ + disableXpnHost(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Disable a serivce resource (a.k.a service project) associated with this host project. */ + disableXpnResource(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enable this project as a shared VPC host project. */ + enableXpnHost(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service + * project. + */ + enableXpnResource(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Project resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get the shared VPC host project that this project links to. May be empty if no link exists. */ + getXpnHost(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get service resources (a.k.a service project) associated with this host project. */ + getXpnResources(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all shared VPC host projects visible to the user in an organization. */ + listXpnHosts(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves a persistent disk from one zone to another. */ + moveDisk(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves an instance and its attached persistent disks from one zone to another. */ + moveInstance(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets metadata common to all instances within the specified project using the data included in the request. */ + setCommonInstanceMetadata(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the + * usage export feature will be disabled. + */ + setUsageExportBucket(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionAutoscalersResource { + /** Deletes the specified autoscaler. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to delete. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified autoscaler. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to return. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an autoscaler in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of autoscalers contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to patch. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an autoscaler in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to update. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionBackendServicesResource { + /** Deletes the specified regional BackendService resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to delete. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified regional BackendService resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to return. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the most recent health check results for this regional BackendService. */ + getHealth(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to which the queried instance belongs. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of regional BackendService resources available to the specified project in the given region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to patch. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to update. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionCommitmentsResource { + /** Retrieves an aggregated list of commitments. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified commitment resource. Get a list of available commitments by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the commitment to return. */ + commitment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a commitment in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of commitments contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionInstanceGroupManagersResource { + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + abandonInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified managed instance group and all of the instances in that group. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group to delete. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + deleteInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns all of the details about the specified managed instance group. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group to return. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A regional managed instance group can contain up to 2000 instances. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of managed instance groups that are contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group + * has scheduled for its instances. + */ + listManagedInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + recreateInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the + * current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE + * when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the + * creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + resize(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Number of instances that should exist in this instance group manager. */ + size: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. */ + setInstanceTemplate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. */ + setTargetPools(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionInstanceGroupsResource { + /** Returns the specified instance group resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance group resource to return. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of instance group resources contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can + * list all instances or only the instances that are running. + */ + listInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** Name of the regional instance group for which we want to list the instances. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the named ports for the specified regional instance group. */ + setNamedPorts(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the regional instance group where the named ports are updated. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionOperationsResource { + /** Deletes the specified region-specific Operations resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the specified region-specific Operations resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of Operation resources contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionsResource { + /** Returns the specified Region resource. Get a list of available regions by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region resource to return. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of region resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RoutersResource { + /** Retrieves an aggregated list of routers. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified Router resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Router resource to delete. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Router resource. Get a list of available routers by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the Router resource to return. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves runtime information of the specified router. */ + getRouterStatus(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the Router resource to query. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Router resource in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of Router resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and + * processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Router resource to patch. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. */ + preview(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the Router resource to query. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the specified Router resource with the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Router resource to update. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RoutesResource { + /** Deletes the specified Route resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Route resource to delete. */ + route: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Route resource. Get a list of available routes by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the Route resource to return. */ + route: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Route resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of Route resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SnapshotsResource { + /** + * Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If + * any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + * + * For more information, see Deleting snaphots. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Snapshot resource to delete. */ + snapshot: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the Snapshot resource to return. */ + snapshot: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of Snapshot resources contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SslCertificatesResource { + /** Deletes the specified SslCertificate resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the SslCertificate resource to delete. */ + sslCertificate: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the SslCertificate resource to return. */ + sslCertificate: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a SslCertificate resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of SslCertificate resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SubnetworksResource { + /** Retrieves an aggregated list of subnetworks. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified subnetwork. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Subnetwork resource to delete. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Expands the IP CIDR range of the subnetwork to a specified value. */ + expandIpCidrRange(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Subnetwork resource to update. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified subnetwork. Get a list of available subnetworks list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** Name of the Subnetwork resource to return. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a subnetwork in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of subnetworks available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. */ + setPrivateIpGoogleAccess(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Subnetwork resource. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetHttpProxiesResource { + /** Deletes the specified TargetHttpProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpProxy resource to delete. */ + targetHttpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetHttpProxy resource to return. */ + targetHttpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetHttpProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetHttpProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the URL map for TargetHttpProxy. */ + setUrlMap(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpProxy to set a URL map for. */ + targetHttpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetHttpsProxiesResource { + /** Deletes the specified TargetHttpsProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpsProxy resource to delete. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetHttpsProxy resource to return. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetHttpsProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetHttpsProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Replaces SslCertificates for TargetHttpsProxy. */ + setSslCertificates(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpsProxy resource to set an SslCertificates resource for. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the URL map for TargetHttpsProxy. */ + setUrlMap(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpsProxy resource whose URL map is to be set. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetInstancesResource { + /** Retrieves an aggregated list of target instances. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified TargetInstance resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetInstance resource to delete. */ + targetInstance: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + /** Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetInstance resource to return. */ + targetInstance: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + /** Creates a TargetInstance resource in the specified project and zone using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + /** Retrieves a list of TargetInstance resources available to the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + } + interface TargetPoolsResource { + /** Adds health check URLs to a target pool. */ + addHealthCheck(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the target pool to add a health check to. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds an instance to a target pool. */ + addInstance(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to add instances to. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves an aggregated list of target pools. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified target pool. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to delete. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified target pool. Get a list of available target pools by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** Name of the TargetPool resource to return. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. */ + getHealth(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** Name of the TargetPool resource to which the queried instance belongs. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a target pool in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of target pools available to the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes health check URL from a target pool. */ + removeHealthCheck(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the target pool to remove health checks from. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes instance URL from a target pool. */ + removeInstance(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to remove instances from. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes a backup target pool's configurations. */ + setBackup(request: { + /** Data format for the response. */ + alt?: string; + /** New failoverRatio value for the target pool. */ + failoverRatio?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to set a backup pool for. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetSslProxiesResource { + /** Deletes the specified TargetSslProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource to delete. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetSslProxy resource to return. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetSslProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetSslProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the BackendService for TargetSslProxy. */ + setBackendService(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource whose BackendService resource is to be set. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the ProxyHeaderType for TargetSslProxy. */ + setProxyHeader(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource whose ProxyHeader is to be set. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes SslCertificates for TargetSslProxy. */ + setSslCertificates(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource whose SslCertificate resource is to be set. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetTcpProxiesResource { + /** Deletes the specified TargetTcpProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetTcpProxy resource to delete. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetTcpProxy resource to return. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetTcpProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetTcpProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the BackendService for TargetTcpProxy. */ + setBackendService(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetTcpProxy resource whose BackendService resource is to be set. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the ProxyHeaderType for TargetTcpProxy. */ + setProxyHeader(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetTcpProxy resource whose ProxyHeader is to be set. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetVpnGatewaysResource { + /** Retrieves an aggregated list of target VPN gateways. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified target VPN gateway. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the target VPN gateway to delete. */ + targetVpnGateway: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the target VPN gateway to return. */ + targetVpnGateway: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a target VPN gateway in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of target VPN gateways available to the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlMapsResource { + /** Deletes the specified UrlMap resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap resource to delete. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the UrlMap resource to return. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a UrlMap resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. */ + invalidateCache(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap scoping this request. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of UrlMap resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap resource to patch. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the specified UrlMap resource with the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap resource to update. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. */ + validate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the UrlMap resource to be validated as. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VpnTunnelsResource { + /** Retrieves an aggregated list of VPN tunnels. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified VpnTunnel resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the VpnTunnel resource to delete. */ + vpnTunnel: string; + }): Request; + /** Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the VpnTunnel resource to return. */ + vpnTunnel: string; + }): Request; + /** Creates a VpnTunnel resource in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of VpnTunnel resources contained in the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ZoneOperationsResource { + /** Deletes the specified zone-specific Operations resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves the specified zone-specific Operations resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of Operation resources contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for request. */ + zone: string; + }): Request; + } + interface ZonesResource { + /** Returns the specified Zone resource. Get a list of available zones by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone resource to return. */ + zone: string; + }): Request; + /** Retrieves the list of Zone resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.compute/readme.md b/types/gapi.client.compute/readme.md new file mode 100644 index 0000000000..fcee121864 --- /dev/null +++ b/types/gapi.client.compute/readme.md @@ -0,0 +1,1557 @@ +# TypeScript typings for Compute Engine API v1 +Creates and runs virtual machines on Google Cloud Platform. +For detailed description please check [documentation](https://developers.google.com/compute/docs/reference/latest/). + +## Installing + +Install typings for Compute Engine API: +``` +npm install @types/gapi.client.compute@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('compute', 'v1', () => { + // now we can use gapi.client.compute + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute', + + // View your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute.readonly', + + // Manage your data and permissions in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.full_control', + + // View your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_only', + + // Manage your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_write', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Compute Engine API resources: + +```typescript + +/* +Retrieves an aggregated list of accelerator types. +*/ +await gapi.client.acceleratorTypes.aggregatedList({ project: "project", }); + +/* +Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. +*/ +await gapi.client.acceleratorTypes.get({ acceleratorType: "acceleratorType", project: "project", zone: "zone", }); + +/* +Retrieves a list of accelerator types available to the specified project. +*/ +await gapi.client.acceleratorTypes.list({ project: "project", zone: "zone", }); + +/* +Retrieves an aggregated list of addresses. +*/ +await gapi.client.addresses.aggregatedList({ project: "project", }); + +/* +Deletes the specified address resource. +*/ +await gapi.client.addresses.delete({ address: "address", project: "project", region: "region", }); + +/* +Returns the specified address resource. +*/ +await gapi.client.addresses.get({ address: "address", project: "project", region: "region", }); + +/* +Creates an address resource in the specified project using the data included in the request. +*/ +await gapi.client.addresses.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of addresses contained within the specified region. +*/ +await gapi.client.addresses.list({ project: "project", region: "region", }); + +/* +Retrieves an aggregated list of autoscalers. +*/ +await gapi.client.autoscalers.aggregatedList({ project: "project", }); + +/* +Deletes the specified autoscaler. +*/ +await gapi.client.autoscalers.delete({ autoscaler: "autoscaler", project: "project", zone: "zone", }); + +/* +Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. +*/ +await gapi.client.autoscalers.get({ autoscaler: "autoscaler", project: "project", zone: "zone", }); + +/* +Creates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.autoscalers.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of autoscalers contained within the specified zone. +*/ +await gapi.client.autoscalers.list({ project: "project", zone: "zone", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.autoscalers.patch({ project: "project", zone: "zone", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.autoscalers.update({ project: "project", zone: "zone", }); + +/* +Deletes the specified BackendBucket resource. +*/ +await gapi.client.backendBuckets.delete({ backendBucket: "backendBucket", project: "project", }); + +/* +Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. +*/ +await gapi.client.backendBuckets.get({ backendBucket: "backendBucket", project: "project", }); + +/* +Creates a BackendBucket resource in the specified project using the data included in the request. +*/ +await gapi.client.backendBuckets.insert({ project: "project", }); + +/* +Retrieves the list of BackendBucket resources available to the specified project. +*/ +await gapi.client.backendBuckets.list({ project: "project", }); + +/* +Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.backendBuckets.patch({ backendBucket: "backendBucket", project: "project", }); + +/* +Updates the specified BackendBucket resource with the data included in the request. +*/ +await gapi.client.backendBuckets.update({ backendBucket: "backendBucket", project: "project", }); + +/* +Retrieves the list of all BackendService resources, regional and global, available to the specified project. +*/ +await gapi.client.backendServices.aggregatedList({ project: "project", }); + +/* +Deletes the specified BackendService resource. +*/ +await gapi.client.backendServices.delete({ backendService: "backendService", project: "project", }); + +/* +Returns the specified BackendService resource. Get a list of available backend services by making a list() request. +*/ +await gapi.client.backendServices.get({ backendService: "backendService", project: "project", }); + +/* +Gets the most recent health check results for this BackendService. +*/ +await gapi.client.backendServices.getHealth({ backendService: "backendService", project: "project", }); + +/* +Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.backendServices.insert({ project: "project", }); + +/* +Retrieves the list of BackendService resources available to the specified project. +*/ +await gapi.client.backendServices.list({ project: "project", }); + +/* +Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.backendServices.patch({ backendService: "backendService", project: "project", }); + +/* +Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.backendServices.update({ backendService: "backendService", project: "project", }); + +/* +Retrieves an aggregated list of disk types. +*/ +await gapi.client.diskTypes.aggregatedList({ project: "project", }); + +/* +Returns the specified disk type. Get a list of available disk types by making a list() request. +*/ +await gapi.client.diskTypes.get({ diskType: "diskType", project: "project", zone: "zone", }); + +/* +Retrieves a list of disk types available to the specified project. +*/ +await gapi.client.diskTypes.list({ project: "project", zone: "zone", }); + +/* +Retrieves an aggregated list of persistent disks. +*/ +await gapi.client.disks.aggregatedList({ project: "project", }); + +/* +Creates a snapshot of a specified persistent disk. +*/ +await gapi.client.disks.createSnapshot({ disk: "disk", project: "project", zone: "zone", }); + +/* +Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. +*/ +await gapi.client.disks.delete({ disk: "disk", project: "project", zone: "zone", }); + +/* +Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. +*/ +await gapi.client.disks.get({ disk: "disk", project: "project", zone: "zone", }); + +/* +Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. +*/ +await gapi.client.disks.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of persistent disks contained within the specified zone. +*/ +await gapi.client.disks.list({ project: "project", zone: "zone", }); + +/* +Resizes the specified persistent disk. +*/ +await gapi.client.disks.resize({ disk: "disk", project: "project", zone: "zone", }); + +/* +Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.disks.setLabels({ project: "project", resource: "resource", zone: "zone", }); + +/* +Deletes the specified firewall. +*/ +await gapi.client.firewalls.delete({ firewall: "firewall", project: "project", }); + +/* +Returns the specified firewall. +*/ +await gapi.client.firewalls.get({ firewall: "firewall", project: "project", }); + +/* +Creates a firewall rule in the specified project using the data included in the request. +*/ +await gapi.client.firewalls.insert({ project: "project", }); + +/* +Retrieves the list of firewall rules available to the specified project. +*/ +await gapi.client.firewalls.list({ project: "project", }); + +/* +Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.firewalls.patch({ firewall: "firewall", project: "project", }); + +/* +Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. +*/ +await gapi.client.firewalls.update({ firewall: "firewall", project: "project", }); + +/* +Retrieves an aggregated list of forwarding rules. +*/ +await gapi.client.forwardingRules.aggregatedList({ project: "project", }); + +/* +Deletes the specified ForwardingRule resource. +*/ +await gapi.client.forwardingRules.delete({ forwardingRule: "forwardingRule", project: "project", region: "region", }); + +/* +Returns the specified ForwardingRule resource. +*/ +await gapi.client.forwardingRules.get({ forwardingRule: "forwardingRule", project: "project", region: "region", }); + +/* +Creates a ForwardingRule resource in the specified project and region using the data included in the request. +*/ +await gapi.client.forwardingRules.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of ForwardingRule resources available to the specified project and region. +*/ +await gapi.client.forwardingRules.list({ project: "project", region: "region", }); + +/* +Changes target URL for forwarding rule. The new target should be of the same type as the old target. +*/ +await gapi.client.forwardingRules.setTarget({ forwardingRule: "forwardingRule", project: "project", region: "region", }); + +/* +Deletes the specified address resource. +*/ +await gapi.client.globalAddresses.delete({ address: "address", project: "project", }); + +/* +Returns the specified address resource. Get a list of available addresses by making a list() request. +*/ +await gapi.client.globalAddresses.get({ address: "address", project: "project", }); + +/* +Creates an address resource in the specified project using the data included in the request. +*/ +await gapi.client.globalAddresses.insert({ project: "project", }); + +/* +Retrieves a list of global addresses. +*/ +await gapi.client.globalAddresses.list({ project: "project", }); + +/* +Deletes the specified GlobalForwardingRule resource. +*/ +await gapi.client.globalForwardingRules.delete({ forwardingRule: "forwardingRule", project: "project", }); + +/* +Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. +*/ +await gapi.client.globalForwardingRules.get({ forwardingRule: "forwardingRule", project: "project", }); + +/* +Creates a GlobalForwardingRule resource in the specified project using the data included in the request. +*/ +await gapi.client.globalForwardingRules.insert({ project: "project", }); + +/* +Retrieves a list of GlobalForwardingRule resources available to the specified project. +*/ +await gapi.client.globalForwardingRules.list({ project: "project", }); + +/* +Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. +*/ +await gapi.client.globalForwardingRules.setTarget({ forwardingRule: "forwardingRule", project: "project", }); + +/* +Retrieves an aggregated list of all operations. +*/ +await gapi.client.globalOperations.aggregatedList({ project: "project", }); + +/* +Deletes the specified Operations resource. +*/ +await gapi.client.globalOperations.delete({ operation: "operation", project: "project", }); + +/* +Retrieves the specified Operations resource. Get a list of operations by making a list() request. +*/ +await gapi.client.globalOperations.get({ operation: "operation", project: "project", }); + +/* +Retrieves a list of Operation resources contained within the specified project. +*/ +await gapi.client.globalOperations.list({ project: "project", }); + +/* +Deletes the specified HealthCheck resource. +*/ +await gapi.client.healthChecks.delete({ healthCheck: "healthCheck", project: "project", }); + +/* +Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. +*/ +await gapi.client.healthChecks.get({ healthCheck: "healthCheck", project: "project", }); + +/* +Creates a HealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.healthChecks.insert({ project: "project", }); + +/* +Retrieves the list of HealthCheck resources available to the specified project. +*/ +await gapi.client.healthChecks.list({ project: "project", }); + +/* +Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.healthChecks.patch({ healthCheck: "healthCheck", project: "project", }); + +/* +Updates a HealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.healthChecks.update({ healthCheck: "healthCheck", project: "project", }); + +/* +Deletes the specified HttpHealthCheck resource. +*/ +await gapi.client.httpHealthChecks.delete({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. +*/ +await gapi.client.httpHealthChecks.get({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Creates a HttpHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpHealthChecks.insert({ project: "project", }); + +/* +Retrieves the list of HttpHealthCheck resources available to the specified project. +*/ +await gapi.client.httpHealthChecks.list({ project: "project", }); + +/* +Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.httpHealthChecks.patch({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Updates a HttpHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpHealthChecks.update({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Deletes the specified HttpsHealthCheck resource. +*/ +await gapi.client.httpsHealthChecks.delete({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. +*/ +await gapi.client.httpsHealthChecks.get({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Creates a HttpsHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpsHealthChecks.insert({ project: "project", }); + +/* +Retrieves the list of HttpsHealthCheck resources available to the specified project. +*/ +await gapi.client.httpsHealthChecks.list({ project: "project", }); + +/* +Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.httpsHealthChecks.patch({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Updates a HttpsHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpsHealthChecks.update({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Deletes the specified image. +*/ +await gapi.client.images.delete({ image: "image", project: "project", }); + +/* +Sets the deprecation status of an image. + +If an empty request body is given, clears the deprecation status instead. +*/ +await gapi.client.images.deprecate({ image: "image", project: "project", }); + +/* +Returns the specified image. Get a list of available images by making a list() request. +*/ +await gapi.client.images.get({ image: "image", project: "project", }); + +/* +Returns the latest image that is part of an image family and is not deprecated. +*/ +await gapi.client.images.getFromFamily({ family: "family", project: "project", }); + +/* +Creates an image in the specified project using the data included in the request. +*/ +await gapi.client.images.insert({ project: "project", }); + +/* +Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. +*/ +await gapi.client.images.list({ project: "project", }); + +/* +Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.images.setLabels({ project: "project", resource: "resource", }); + +/* +Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.instanceGroupManagers.abandonInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Retrieves the list of managed instance groups and groups them by zone. +*/ +await gapi.client.instanceGroupManagers.aggregatedList({ project: "project", }); + +/* +Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. +*/ +await gapi.client.instanceGroupManagers.delete({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.instanceGroupManagers.deleteInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. +*/ +await gapi.client.instanceGroupManagers.get({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + +A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. +*/ +await gapi.client.instanceGroupManagers.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of managed instance groups that are contained within the specified project and zone. +*/ +await gapi.client.instanceGroupManagers.list({ project: "project", zone: "zone", }); + +/* +Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. +*/ +await gapi.client.instanceGroupManagers.listManagedInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.instanceGroupManagers.recreateInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +*/ +await gapi.client.instanceGroupManagers.resize({ instanceGroupManager: "instanceGroupManager", project: "project", size: 1, zone: "zone", }); + +/* +Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. +*/ +await gapi.client.instanceGroupManagers.setInstanceTemplate({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. +*/ +await gapi.client.instanceGroupManagers.setTargetPools({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. +*/ +await gapi.client.instanceGroups.addInstances({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Retrieves the list of instance groups and sorts them by zone. +*/ +await gapi.client.instanceGroups.aggregatedList({ project: "project", }); + +/* +Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. +*/ +await gapi.client.instanceGroups.delete({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Returns the specified instance group. Get a list of available instance groups by making a list() request. +*/ +await gapi.client.instanceGroups.get({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Creates an instance group in the specified project using the parameters that are included in the request. +*/ +await gapi.client.instanceGroups.insert({ project: "project", zone: "zone", }); + +/* +Retrieves the list of instance groups that are located in the specified project and zone. +*/ +await gapi.client.instanceGroups.list({ project: "project", zone: "zone", }); + +/* +Lists the instances in the specified instance group. +*/ +await gapi.client.instanceGroups.listInstances({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Removes one or more instances from the specified instance group, but does not delete those instances. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. +*/ +await gapi.client.instanceGroups.removeInstances({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Sets the named ports for the specified instance group. +*/ +await gapi.client.instanceGroups.setNamedPorts({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. +*/ +await gapi.client.instanceTemplates.delete({ instanceTemplate: "instanceTemplate", project: "project", }); + +/* +Returns the specified instance template. Get a list of available instance templates by making a list() request. +*/ +await gapi.client.instanceTemplates.get({ instanceTemplate: "instanceTemplate", project: "project", }); + +/* +Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. +*/ +await gapi.client.instanceTemplates.insert({ project: "project", }); + +/* +Retrieves a list of instance templates that are contained within the specified project and zone. +*/ +await gapi.client.instanceTemplates.list({ project: "project", }); + +/* +Adds an access config to an instance's network interface. +*/ +await gapi.client.instances.addAccessConfig({ instance: "instance", networkInterface: "networkInterface", project: "project", zone: "zone", }); + +/* +Retrieves aggregated list of instances. +*/ +await gapi.client.instances.aggregatedList({ project: "project", }); + +/* +Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. +*/ +await gapi.client.instances.attachDisk({ instance: "instance", project: "project", zone: "zone", }); + +/* +Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. +*/ +await gapi.client.instances.delete({ instance: "instance", project: "project", zone: "zone", }); + +/* +Deletes an access config from an instance's network interface. +*/ +await gapi.client.instances.deleteAccessConfig({ accessConfig: "accessConfig", instance: "instance", networkInterface: "networkInterface", project: "project", zone: "zone", }); + +/* +Detaches a disk from an instance. +*/ +await gapi.client.instances.detachDisk({ deviceName: "deviceName", instance: "instance", project: "project", zone: "zone", }); + +/* +Returns the specified Instance resource. Get a list of available instances by making a list() request. +*/ +await gapi.client.instances.get({ instance: "instance", project: "project", zone: "zone", }); + +/* +Returns the specified instance's serial port output. +*/ +await gapi.client.instances.getSerialPortOutput({ instance: "instance", project: "project", zone: "zone", }); + +/* +Creates an instance resource in the specified project using the data included in the request. +*/ +await gapi.client.instances.insert({ project: "project", zone: "zone", }); + +/* +Retrieves the list of instances contained within the specified zone. +*/ +await gapi.client.instances.list({ project: "project", zone: "zone", }); + +/* +Performs a reset on the instance. For more information, see Resetting an instance. +*/ +await gapi.client.instances.reset({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets the auto-delete flag for a disk attached to an instance. +*/ +await gapi.client.instances.setDiskAutoDelete({ autoDelete: , deviceName: "deviceName", instance: "instance", project: "project", zone: "zone", }); + +/* +Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.instances.setLabels({ instance: "instance", project: "project", zone: "zone", }); + +/* +Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. +*/ +await gapi.client.instances.setMachineResources({ instance: "instance", project: "project", zone: "zone", }); + +/* +Changes the machine type for a stopped instance to the machine type specified in the request. +*/ +await gapi.client.instances.setMachineType({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets metadata for the specified instance to the data included in the request. +*/ +await gapi.client.instances.setMetadata({ instance: "instance", project: "project", zone: "zone", }); + +/* +Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. +*/ +await gapi.client.instances.setMinCpuPlatform({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets an instance's scheduling options. +*/ +await gapi.client.instances.setScheduling({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. +*/ +await gapi.client.instances.setServiceAccount({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets tags for the specified instance to the data included in the request. +*/ +await gapi.client.instances.setTags({ instance: "instance", project: "project", zone: "zone", }); + +/* +Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. +*/ +await gapi.client.instances.start({ instance: "instance", project: "project", zone: "zone", }); + +/* +Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. +*/ +await gapi.client.instances.startWithEncryptionKey({ instance: "instance", project: "project", zone: "zone", }); + +/* +Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. +*/ +await gapi.client.instances.stop({ instance: "instance", project: "project", zone: "zone", }); + +/* +Returns the specified License resource. +*/ +await gapi.client.licenses.get({ license: "license", project: "project", }); + +/* +Retrieves an aggregated list of machine types. +*/ +await gapi.client.machineTypes.aggregatedList({ project: "project", }); + +/* +Returns the specified machine type. Get a list of available machine types by making a list() request. +*/ +await gapi.client.machineTypes.get({ machineType: "machineType", project: "project", zone: "zone", }); + +/* +Retrieves a list of machine types available to the specified project. +*/ +await gapi.client.machineTypes.list({ project: "project", zone: "zone", }); + +/* +Adds a peering to the specified network. +*/ +await gapi.client.networks.addPeering({ network: "network", project: "project", }); + +/* +Deletes the specified network. +*/ +await gapi.client.networks.delete({ network: "network", project: "project", }); + +/* +Returns the specified network. Get a list of available networks by making a list() request. +*/ +await gapi.client.networks.get({ network: "network", project: "project", }); + +/* +Creates a network in the specified project using the data included in the request. +*/ +await gapi.client.networks.insert({ project: "project", }); + +/* +Retrieves the list of networks available to the specified project. +*/ +await gapi.client.networks.list({ project: "project", }); + +/* +Patches the specified network with the data included in the request. +*/ +await gapi.client.networks.patch({ network: "network", project: "project", }); + +/* +Removes a peering from the specified network. +*/ +await gapi.client.networks.removePeering({ network: "network", project: "project", }); + +/* +Switches the network mode from auto subnet mode to custom subnet mode. +*/ +await gapi.client.networks.switchToCustomMode({ network: "network", project: "project", }); + +/* +Disable this project as a shared VPC host project. +*/ +await gapi.client.projects.disableXpnHost({ project: "project", }); + +/* +Disable a serivce resource (a.k.a service project) associated with this host project. +*/ +await gapi.client.projects.disableXpnResource({ project: "project", }); + +/* +Enable this project as a shared VPC host project. +*/ +await gapi.client.projects.enableXpnHost({ project: "project", }); + +/* +Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. +*/ +await gapi.client.projects.enableXpnResource({ project: "project", }); + +/* +Returns the specified Project resource. +*/ +await gapi.client.projects.get({ project: "project", }); + +/* +Get the shared VPC host project that this project links to. May be empty if no link exists. +*/ +await gapi.client.projects.getXpnHost({ project: "project", }); + +/* +Get service resources (a.k.a service project) associated with this host project. +*/ +await gapi.client.projects.getXpnResources({ project: "project", }); + +/* +List all shared VPC host projects visible to the user in an organization. +*/ +await gapi.client.projects.listXpnHosts({ project: "project", }); + +/* +Moves a persistent disk from one zone to another. +*/ +await gapi.client.projects.moveDisk({ project: "project", }); + +/* +Moves an instance and its attached persistent disks from one zone to another. +*/ +await gapi.client.projects.moveInstance({ project: "project", }); + +/* +Sets metadata common to all instances within the specified project using the data included in the request. +*/ +await gapi.client.projects.setCommonInstanceMetadata({ project: "project", }); + +/* +Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. +*/ +await gapi.client.projects.setUsageExportBucket({ project: "project", }); + +/* +Deletes the specified autoscaler. +*/ +await gapi.client.regionAutoscalers.delete({ autoscaler: "autoscaler", project: "project", region: "region", }); + +/* +Returns the specified autoscaler. +*/ +await gapi.client.regionAutoscalers.get({ autoscaler: "autoscaler", project: "project", region: "region", }); + +/* +Creates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.regionAutoscalers.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of autoscalers contained within the specified region. +*/ +await gapi.client.regionAutoscalers.list({ project: "project", region: "region", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.regionAutoscalers.patch({ project: "project", region: "region", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.regionAutoscalers.update({ project: "project", region: "region", }); + +/* +Deletes the specified regional BackendService resource. +*/ +await gapi.client.regionBackendServices.delete({ backendService: "backendService", project: "project", region: "region", }); + +/* +Returns the specified regional BackendService resource. +*/ +await gapi.client.regionBackendServices.get({ backendService: "backendService", project: "project", region: "region", }); + +/* +Gets the most recent health check results for this regional BackendService. +*/ +await gapi.client.regionBackendServices.getHealth({ backendService: "backendService", project: "project", region: "region", }); + +/* +Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.regionBackendServices.insert({ project: "project", region: "region", }); + +/* +Retrieves the list of regional BackendService resources available to the specified project in the given region. +*/ +await gapi.client.regionBackendServices.list({ project: "project", region: "region", }); + +/* +Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.regionBackendServices.patch({ backendService: "backendService", project: "project", region: "region", }); + +/* +Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.regionBackendServices.update({ backendService: "backendService", project: "project", region: "region", }); + +/* +Retrieves an aggregated list of commitments. +*/ +await gapi.client.regionCommitments.aggregatedList({ project: "project", }); + +/* +Returns the specified commitment resource. Get a list of available commitments by making a list() request. +*/ +await gapi.client.regionCommitments.get({ commitment: "commitment", project: "project", region: "region", }); + +/* +Creates a commitment in the specified project using the data included in the request. +*/ +await gapi.client.regionCommitments.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of commitments contained within the specified region. +*/ +await gapi.client.regionCommitments.list({ project: "project", region: "region", }); + +/* +Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.regionInstanceGroupManagers.abandonInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Deletes the specified managed instance group and all of the instances in that group. +*/ +await gapi.client.regionInstanceGroupManagers.delete({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.regionInstanceGroupManagers.deleteInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Returns all of the details about the specified managed instance group. +*/ +await gapi.client.regionInstanceGroupManagers.get({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + +A regional managed instance group can contain up to 2000 instances. +*/ +await gapi.client.regionInstanceGroupManagers.insert({ project: "project", region: "region", }); + +/* +Retrieves the list of managed instance groups that are contained within the specified region. +*/ +await gapi.client.regionInstanceGroupManagers.list({ project: "project", region: "region", }); + +/* +Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. +*/ +await gapi.client.regionInstanceGroupManagers.listManagedInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.regionInstanceGroupManagers.recreateInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +*/ +await gapi.client.regionInstanceGroupManagers.resize({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", size: 1, }); + +/* +Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. +*/ +await gapi.client.regionInstanceGroupManagers.setInstanceTemplate({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. +*/ +await gapi.client.regionInstanceGroupManagers.setTargetPools({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Returns the specified instance group resource. +*/ +await gapi.client.regionInstanceGroups.get({ instanceGroup: "instanceGroup", project: "project", region: "region", }); + +/* +Retrieves the list of instance group resources contained within the specified region. +*/ +await gapi.client.regionInstanceGroups.list({ project: "project", region: "region", }); + +/* +Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. +*/ +await gapi.client.regionInstanceGroups.listInstances({ instanceGroup: "instanceGroup", project: "project", region: "region", }); + +/* +Sets the named ports for the specified regional instance group. +*/ +await gapi.client.regionInstanceGroups.setNamedPorts({ instanceGroup: "instanceGroup", project: "project", region: "region", }); + +/* +Deletes the specified region-specific Operations resource. +*/ +await gapi.client.regionOperations.delete({ operation: "operation", project: "project", region: "region", }); + +/* +Retrieves the specified region-specific Operations resource. +*/ +await gapi.client.regionOperations.get({ operation: "operation", project: "project", region: "region", }); + +/* +Retrieves a list of Operation resources contained within the specified region. +*/ +await gapi.client.regionOperations.list({ project: "project", region: "region", }); + +/* +Returns the specified Region resource. Get a list of available regions by making a list() request. +*/ +await gapi.client.regions.get({ project: "project", region: "region", }); + +/* +Retrieves the list of region resources available to the specified project. +*/ +await gapi.client.regions.list({ project: "project", }); + +/* +Retrieves an aggregated list of routers. +*/ +await gapi.client.routers.aggregatedList({ project: "project", }); + +/* +Deletes the specified Router resource. +*/ +await gapi.client.routers.delete({ project: "project", region: "region", router: "router", }); + +/* +Returns the specified Router resource. Get a list of available routers by making a list() request. +*/ +await gapi.client.routers.get({ project: "project", region: "region", router: "router", }); + +/* +Retrieves runtime information of the specified router. +*/ +await gapi.client.routers.getRouterStatus({ project: "project", region: "region", router: "router", }); + +/* +Creates a Router resource in the specified project and region using the data included in the request. +*/ +await gapi.client.routers.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of Router resources available to the specified project. +*/ +await gapi.client.routers.list({ project: "project", region: "region", }); + +/* +Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +*/ +await gapi.client.routers.patch({ project: "project", region: "region", router: "router", }); + +/* +Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. +*/ +await gapi.client.routers.preview({ project: "project", region: "region", router: "router", }); + +/* +Updates the specified Router resource with the data included in the request. +*/ +await gapi.client.routers.update({ project: "project", region: "region", router: "router", }); + +/* +Deletes the specified Route resource. +*/ +await gapi.client.routes.delete({ project: "project", route: "route", }); + +/* +Returns the specified Route resource. Get a list of available routes by making a list() request. +*/ +await gapi.client.routes.get({ project: "project", route: "route", }); + +/* +Creates a Route resource in the specified project using the data included in the request. +*/ +await gapi.client.routes.insert({ project: "project", }); + +/* +Retrieves the list of Route resources available to the specified project. +*/ +await gapi.client.routes.list({ project: "project", }); + +/* +Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + +For more information, see Deleting snaphots. +*/ +await gapi.client.snapshots.delete({ project: "project", snapshot: "snapshot", }); + +/* +Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. +*/ +await gapi.client.snapshots.get({ project: "project", snapshot: "snapshot", }); + +/* +Retrieves the list of Snapshot resources contained within the specified project. +*/ +await gapi.client.snapshots.list({ project: "project", }); + +/* +Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.snapshots.setLabels({ project: "project", resource: "resource", }); + +/* +Deletes the specified SslCertificate resource. +*/ +await gapi.client.sslCertificates.delete({ project: "project", sslCertificate: "sslCertificate", }); + +/* +Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. +*/ +await gapi.client.sslCertificates.get({ project: "project", sslCertificate: "sslCertificate", }); + +/* +Creates a SslCertificate resource in the specified project using the data included in the request. +*/ +await gapi.client.sslCertificates.insert({ project: "project", }); + +/* +Retrieves the list of SslCertificate resources available to the specified project. +*/ +await gapi.client.sslCertificates.list({ project: "project", }); + +/* +Retrieves an aggregated list of subnetworks. +*/ +await gapi.client.subnetworks.aggregatedList({ project: "project", }); + +/* +Deletes the specified subnetwork. +*/ +await gapi.client.subnetworks.delete({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Expands the IP CIDR range of the subnetwork to a specified value. +*/ +await gapi.client.subnetworks.expandIpCidrRange({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Returns the specified subnetwork. Get a list of available subnetworks list() request. +*/ +await gapi.client.subnetworks.get({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Creates a subnetwork in the specified project using the data included in the request. +*/ +await gapi.client.subnetworks.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of subnetworks available to the specified project. +*/ +await gapi.client.subnetworks.list({ project: "project", region: "region", }); + +/* +Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. +*/ +await gapi.client.subnetworks.setPrivateIpGoogleAccess({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Deletes the specified TargetHttpProxy resource. +*/ +await gapi.client.targetHttpProxies.delete({ project: "project", targetHttpProxy: "targetHttpProxy", }); + +/* +Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. +*/ +await gapi.client.targetHttpProxies.get({ project: "project", targetHttpProxy: "targetHttpProxy", }); + +/* +Creates a TargetHttpProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetHttpProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetHttpProxy resources available to the specified project. +*/ +await gapi.client.targetHttpProxies.list({ project: "project", }); + +/* +Changes the URL map for TargetHttpProxy. +*/ +await gapi.client.targetHttpProxies.setUrlMap({ project: "project", targetHttpProxy: "targetHttpProxy", }); + +/* +Deletes the specified TargetHttpsProxy resource. +*/ +await gapi.client.targetHttpsProxies.delete({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. +*/ +await gapi.client.targetHttpsProxies.get({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Creates a TargetHttpsProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetHttpsProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetHttpsProxy resources available to the specified project. +*/ +await gapi.client.targetHttpsProxies.list({ project: "project", }); + +/* +Replaces SslCertificates for TargetHttpsProxy. +*/ +await gapi.client.targetHttpsProxies.setSslCertificates({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Changes the URL map for TargetHttpsProxy. +*/ +await gapi.client.targetHttpsProxies.setUrlMap({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Retrieves an aggregated list of target instances. +*/ +await gapi.client.targetInstances.aggregatedList({ project: "project", }); + +/* +Deletes the specified TargetInstance resource. +*/ +await gapi.client.targetInstances.delete({ project: "project", targetInstance: "targetInstance", zone: "zone", }); + +/* +Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. +*/ +await gapi.client.targetInstances.get({ project: "project", targetInstance: "targetInstance", zone: "zone", }); + +/* +Creates a TargetInstance resource in the specified project and zone using the data included in the request. +*/ +await gapi.client.targetInstances.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of TargetInstance resources available to the specified project and zone. +*/ +await gapi.client.targetInstances.list({ project: "project", zone: "zone", }); + +/* +Adds health check URLs to a target pool. +*/ +await gapi.client.targetPools.addHealthCheck({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Adds an instance to a target pool. +*/ +await gapi.client.targetPools.addInstance({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Retrieves an aggregated list of target pools. +*/ +await gapi.client.targetPools.aggregatedList({ project: "project", }); + +/* +Deletes the specified target pool. +*/ +await gapi.client.targetPools.delete({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Returns the specified target pool. Get a list of available target pools by making a list() request. +*/ +await gapi.client.targetPools.get({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. +*/ +await gapi.client.targetPools.getHealth({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Creates a target pool in the specified project and region using the data included in the request. +*/ +await gapi.client.targetPools.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of target pools available to the specified project and region. +*/ +await gapi.client.targetPools.list({ project: "project", region: "region", }); + +/* +Removes health check URL from a target pool. +*/ +await gapi.client.targetPools.removeHealthCheck({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Removes instance URL from a target pool. +*/ +await gapi.client.targetPools.removeInstance({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Changes a backup target pool's configurations. +*/ +await gapi.client.targetPools.setBackup({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Deletes the specified TargetSslProxy resource. +*/ +await gapi.client.targetSslProxies.delete({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. +*/ +await gapi.client.targetSslProxies.get({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Creates a TargetSslProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetSslProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetSslProxy resources available to the specified project. +*/ +await gapi.client.targetSslProxies.list({ project: "project", }); + +/* +Changes the BackendService for TargetSslProxy. +*/ +await gapi.client.targetSslProxies.setBackendService({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Changes the ProxyHeaderType for TargetSslProxy. +*/ +await gapi.client.targetSslProxies.setProxyHeader({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Changes SslCertificates for TargetSslProxy. +*/ +await gapi.client.targetSslProxies.setSslCertificates({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Deletes the specified TargetTcpProxy resource. +*/ +await gapi.client.targetTcpProxies.delete({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. +*/ +await gapi.client.targetTcpProxies.get({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Creates a TargetTcpProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetTcpProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetTcpProxy resources available to the specified project. +*/ +await gapi.client.targetTcpProxies.list({ project: "project", }); + +/* +Changes the BackendService for TargetTcpProxy. +*/ +await gapi.client.targetTcpProxies.setBackendService({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Changes the ProxyHeaderType for TargetTcpProxy. +*/ +await gapi.client.targetTcpProxies.setProxyHeader({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Retrieves an aggregated list of target VPN gateways. +*/ +await gapi.client.targetVpnGateways.aggregatedList({ project: "project", }); + +/* +Deletes the specified target VPN gateway. +*/ +await gapi.client.targetVpnGateways.delete({ project: "project", region: "region", targetVpnGateway: "targetVpnGateway", }); + +/* +Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. +*/ +await gapi.client.targetVpnGateways.get({ project: "project", region: "region", targetVpnGateway: "targetVpnGateway", }); + +/* +Creates a target VPN gateway in the specified project and region using the data included in the request. +*/ +await gapi.client.targetVpnGateways.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of target VPN gateways available to the specified project and region. +*/ +await gapi.client.targetVpnGateways.list({ project: "project", region: "region", }); + +/* +Deletes the specified UrlMap resource. +*/ +await gapi.client.urlMaps.delete({ project: "project", urlMap: "urlMap", }); + +/* +Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. +*/ +await gapi.client.urlMaps.get({ project: "project", urlMap: "urlMap", }); + +/* +Creates a UrlMap resource in the specified project using the data included in the request. +*/ +await gapi.client.urlMaps.insert({ project: "project", }); + +/* +Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. +*/ +await gapi.client.urlMaps.invalidateCache({ project: "project", urlMap: "urlMap", }); + +/* +Retrieves the list of UrlMap resources available to the specified project. +*/ +await gapi.client.urlMaps.list({ project: "project", }); + +/* +Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.urlMaps.patch({ project: "project", urlMap: "urlMap", }); + +/* +Updates the specified UrlMap resource with the data included in the request. +*/ +await gapi.client.urlMaps.update({ project: "project", urlMap: "urlMap", }); + +/* +Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +*/ +await gapi.client.urlMaps.validate({ project: "project", urlMap: "urlMap", }); + +/* +Retrieves an aggregated list of VPN tunnels. +*/ +await gapi.client.vpnTunnels.aggregatedList({ project: "project", }); + +/* +Deletes the specified VpnTunnel resource. +*/ +await gapi.client.vpnTunnels.delete({ project: "project", region: "region", vpnTunnel: "vpnTunnel", }); + +/* +Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. +*/ +await gapi.client.vpnTunnels.get({ project: "project", region: "region", vpnTunnel: "vpnTunnel", }); + +/* +Creates a VpnTunnel resource in the specified project and region using the data included in the request. +*/ +await gapi.client.vpnTunnels.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of VpnTunnel resources contained in the specified project and region. +*/ +await gapi.client.vpnTunnels.list({ project: "project", region: "region", }); + +/* +Deletes the specified zone-specific Operations resource. +*/ +await gapi.client.zoneOperations.delete({ operation: "operation", project: "project", zone: "zone", }); + +/* +Retrieves the specified zone-specific Operations resource. +*/ +await gapi.client.zoneOperations.get({ operation: "operation", project: "project", zone: "zone", }); + +/* +Retrieves a list of Operation resources contained within the specified zone. +*/ +await gapi.client.zoneOperations.list({ project: "project", zone: "zone", }); + +/* +Returns the specified Zone resource. Get a list of available zones by making a list() request. +*/ +await gapi.client.zones.get({ project: "project", zone: "zone", }); + +/* +Retrieves the list of Zone resources available to the specified project. +*/ +await gapi.client.zones.list({ project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.compute/tsconfig.json b/types/gapi.client.compute/tsconfig.json new file mode 100644 index 0000000000..496204435b --- /dev/null +++ b/types/gapi.client.compute/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.compute-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.compute/tslint.json b/types/gapi.client.compute/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.compute/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.consumersurveys/gapi.client.consumersurveys-tests.ts b/types/gapi.client.consumersurveys/gapi.client.consumersurveys-tests.ts new file mode 100644 index 0000000000..a374f6283a --- /dev/null +++ b/types/gapi.client.consumersurveys/gapi.client.consumersurveys-tests.ts @@ -0,0 +1,86 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('consumersurveys', 'v2', () => { + /** now we can use gapi.client.consumersurveys */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and edit your surveys and results */ + 'https://www.googleapis.com/auth/consumersurveys', + /** View the results for your surveys */ + 'https://www.googleapis.com/auth/consumersurveys.readonly', + /** View your email address */ + 'https://www.googleapis.com/auth/userinfo.email', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves a MobileAppPanel that is available to the authenticated user. */ + await gapi.client.mobileapppanels.get({ + panelId: "panelId", + }); + /** Lists the MobileAppPanels available to the authenticated user. */ + await gapi.client.mobileapppanels.list({ + maxResults: 1, + startIndex: 2, + token: "token", + }); + /** Updates a MobileAppPanel. Currently the only property that can be updated is the owners property. */ + await gapi.client.mobileapppanels.update({ + panelId: "panelId", + }); + /** + * Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an + * argument to get results. + */ + await gapi.client.results.get({ + surveyUrlId: "surveyUrlId", + }); + /** Removes a survey from view in all user GET requests. */ + await gapi.client.surveys.delete({ + surveyUrlId: "surveyUrlId", + }); + /** Retrieves information about the specified survey. */ + await gapi.client.surveys.get({ + surveyUrlId: "surveyUrlId", + }); + /** Creates a survey. */ + await gapi.client.surveys.insert({ + }); + /** Lists the surveys owned by the authenticated user. */ + await gapi.client.surveys.list({ + maxResults: 1, + startIndex: 2, + token: "token", + }); + /** Begins running a survey. */ + await gapi.client.surveys.start({ + resourceId: "resourceId", + }); + /** Stops a running survey. */ + await gapi.client.surveys.stop({ + resourceId: "resourceId", + }); + /** Updates a survey. Currently the only property that can be updated is the owners property. */ + await gapi.client.surveys.update({ + surveyUrlId: "surveyUrlId", + }); + } +}); diff --git a/types/gapi.client.consumersurveys/index.d.ts b/types/gapi.client.consumersurveys/index.d.ts new file mode 100644 index 0000000000..41531fce6d --- /dev/null +++ b/types/gapi.client.consumersurveys/index.d.ts @@ -0,0 +1,397 @@ +// Type definitions for Google Consumer Surveys API v2 2.0 +// Project: undefined +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/consumersurveys/v2/rest + +/// + +declare namespace gapi.client { + /** Load Consumer Surveys API v2 */ + function load(name: "consumersurveys", version: "v2"): PromiseLike; + function load(name: "consumersurveys", version: "v2", callback: () => any): void; + + const mobileapppanels: consumersurveys.MobileapppanelsResource; + + const results: consumersurveys.ResultsResource; + + const surveys: consumersurveys.SurveysResource; + + namespace consumersurveys { + interface FieldMask { + fields?: FieldMask[]; + id?: number; + } + interface MobileAppPanel { + country?: string; + isPublicPanel?: boolean; + language?: string; + mobileAppPanelId?: string; + name?: string; + owners?: string[]; + } + interface MobileAppPanelsListResponse { + pageInfo?: PageInfo; + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + /** An individual predefined panel of Opinion Rewards mobile users. */ + resources?: MobileAppPanel[]; + tokenPagination?: TokenPagination; + } + interface PageInfo { + resultPerPage?: number; + startIndex?: number; + totalResults?: number; + } + interface ResultsGetRequest { + resultMask?: ResultsMask; + } + interface ResultsMask { + fields?: FieldMask[]; + projection?: string; + } + interface Survey { + audience?: SurveyAudience; + cost?: SurveyCost; + customerData?: string; + description?: string; + owners?: string[]; + questions?: SurveyQuestion[]; + rejectionReason?: SurveyRejection; + state?: string; + surveyUrlId?: string; + title?: string; + wantedResponseCount?: number; + } + interface SurveyAudience { + ages?: string[]; + country?: string; + countrySubdivision?: string; + gender?: string; + languages?: string[]; + mobileAppPanelId?: string; + populationSource?: string; + } + interface SurveyCost { + costPerResponseNanos?: string; + currencyCode?: string; + maxCostPerResponseNanos?: string; + nanos?: string; + } + interface SurveyQuestion { + answerOrder?: string; + answers?: string[]; + hasOther?: boolean; + highValueLabel?: string; + images?: SurveyQuestionImage[]; + lastAnswerPositionPinned?: boolean; + lowValueLabel?: string; + mustPickSuggestion?: boolean; + numStars?: string; + openTextPlaceholder?: string; + openTextSuggestions?: string[]; + question?: string; + sentimentText?: string; + singleLineResponse?: boolean; + thresholdAnswers?: string[]; + type?: string; + unitOfMeasurementLabel?: string; + videoId?: string; + } + interface SurveyQuestionImage { + altText?: string; + data?: string; + url?: string; + } + interface SurveyRejection { + explanation?: string; + type?: string; + } + interface SurveyResults { + status?: string; + surveyUrlId?: string; + } + interface SurveysDeleteResponse { + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + } + interface SurveysListResponse { + pageInfo?: PageInfo; + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + /** An individual survey resource. */ + resources?: Survey[]; + tokenPagination?: TokenPagination; + } + interface SurveysStartRequest { + /** Threshold to start a survey automically if the quoted prices is less than or equal to this value. See Survey.Cost for more details. */ + maxCostPerResponseNanos?: string; + } + interface SurveysStartResponse { + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + } + interface SurveysStopResponse { + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + } + interface TokenPagination { + nextPageToken?: string; + previousPageToken?: string; + } + interface MobileapppanelsResource { + /** Retrieves a MobileAppPanel that is available to the authenticated user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** External URL ID for the panel. */ + panelId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the MobileAppPanels available to the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a MobileAppPanel. Currently the only property that can be updated is the owners property. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** External URL ID for the panel. */ + panelId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ResultsResource { + /** + * Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an + * argument to get results. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SurveysResource { + /** Removes a survey from view in all user GET requests. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves information about the specified survey. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a survey. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the surveys owned by the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Begins running a survey. */ + start(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + resourceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Stops a running survey. */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + resourceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a survey. Currently the only property that can be updated is the owners property. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.consumersurveys/readme.md b/types/gapi.client.consumersurveys/readme.md new file mode 100644 index 0000000000..2c9ec3157f --- /dev/null +++ b/types/gapi.client.consumersurveys/readme.md @@ -0,0 +1,115 @@ +# TypeScript typings for Consumer Surveys API v2 +Creates and conducts surveys, lists the surveys that an authenticated user owns, and retrieves survey results and information about specified surveys. +For detailed description please check [documentation](undefined). + +## Installing + +Install typings for Consumer Surveys API: +``` +npm install @types/gapi.client.consumersurveys@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('consumersurveys', 'v2', () => { + // now we can use gapi.client.consumersurveys + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and edit your surveys and results + 'https://www.googleapis.com/auth/consumersurveys', + + // View the results for your surveys + 'https://www.googleapis.com/auth/consumersurveys.readonly', + + // View your email address + 'https://www.googleapis.com/auth/userinfo.email', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Consumer Surveys API resources: + +```typescript + +/* +Retrieves a MobileAppPanel that is available to the authenticated user. +*/ +await gapi.client.mobileapppanels.get({ panelId: "panelId", }); + +/* +Lists the MobileAppPanels available to the authenticated user. +*/ +await gapi.client.mobileapppanels.list({ }); + +/* +Updates a MobileAppPanel. Currently the only property that can be updated is the owners property. +*/ +await gapi.client.mobileapppanels.update({ panelId: "panelId", }); + +/* +Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an argument to get results. +*/ +await gapi.client.results.get({ surveyUrlId: "surveyUrlId", }); + +/* +Removes a survey from view in all user GET requests. +*/ +await gapi.client.surveys.delete({ surveyUrlId: "surveyUrlId", }); + +/* +Retrieves information about the specified survey. +*/ +await gapi.client.surveys.get({ surveyUrlId: "surveyUrlId", }); + +/* +Creates a survey. +*/ +await gapi.client.surveys.insert({ }); + +/* +Lists the surveys owned by the authenticated user. +*/ +await gapi.client.surveys.list({ }); + +/* +Begins running a survey. +*/ +await gapi.client.surveys.start({ resourceId: "resourceId", }); + +/* +Stops a running survey. +*/ +await gapi.client.surveys.stop({ resourceId: "resourceId", }); + +/* +Updates a survey. Currently the only property that can be updated is the owners property. +*/ +await gapi.client.surveys.update({ surveyUrlId: "surveyUrlId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.consumersurveys/tsconfig.json b/types/gapi.client.consumersurveys/tsconfig.json new file mode 100644 index 0000000000..e8c3646083 --- /dev/null +++ b/types/gapi.client.consumersurveys/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.consumersurveys-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.consumersurveys/tslint.json b/types/gapi.client.consumersurveys/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.consumersurveys/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.container/gapi.client.container-tests.ts b/types/gapi.client.container/gapi.client.container-tests.ts new file mode 100644 index 0000000000..7a30c61361 --- /dev/null +++ b/types/gapi.client.container/gapi.client.container-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('container', 'v1', () => { + /** now we can use gapi.client.container */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.container/index.d.ts b/types/gapi.client.container/index.d.ts new file mode 100644 index 0000000000..41fa31c25f --- /dev/null +++ b/types/gapi.client.container/index.d.ts @@ -0,0 +1,2201 @@ +// Type definitions for Google Google Container Engine API v1 1.0 +// Project: https://cloud.google.com/container-engine/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://container.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Container Engine API v1 */ + function load(name: "container", version: "v1"): PromiseLike; + function load(name: "container", version: "v1", callback: () => any): void; + + const projects: container.ProjectsResource; + + namespace container { + interface AcceleratorConfig { + /** The number of the accelerator cards exposed to an instance. */ + acceleratorCount?: string; + /** + * The accelerator type resource name. List of supported accelerators + * [here](/compute/docs/gpus/#Introduction) + */ + acceleratorType?: string; + } + interface AddonsConfig { + /** + * Configuration for the horizontal pod autoscaling feature, which + * increases or decreases the number of replica pods a replication controller + * has based on the resource usage of the existing pods. + */ + horizontalPodAutoscaling?: HorizontalPodAutoscaling; + /** + * Configuration for the HTTP (L7) load balancing controller addon, which + * makes it easy to set up HTTP load balancers for services in a cluster. + */ + httpLoadBalancing?: HttpLoadBalancing; + /** Configuration for the Kubernetes Dashboard. */ + kubernetesDashboard?: KubernetesDashboard; + /** + * Configuration for NetworkPolicy. This only tracks whether the addon + * is enabled or not on the Master, it does not track whether network policy + * is enabled for the nodes. + */ + networkPolicyConfig?: NetworkPolicyConfig; + } + interface AutoUpgradeOptions { + /** + * [Output only] This field is set when upgrades are about to commence + * with the approximate start time for the upgrades, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + autoUpgradeStartTime?: string; + /** + * [Output only] This field is set when upgrades are about to commence + * with the description of the upgrade. + */ + description?: string; + } + interface CidrBlock { + /** cidr_block must be specified in CIDR notation. */ + cidrBlock?: string; + /** display_name is an optional field for users to identify CIDR blocks. */ + displayName?: string; + } + interface ClientCertificateConfig { + /** Issue a client certificate. */ + issueClientCertificate?: boolean; + } + interface Cluster { + /** Configurations for the various addons available to run in the cluster. */ + addonsConfig?: AddonsConfig; + /** + * The IP address range of the container pods in this cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`). Leave blank to have + * one automatically chosen or specify a `/14` block in `10.0.0.0/8`. + */ + clusterIpv4Cidr?: string; + /** + * [Output only] The time the cluster was created, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + createTime?: string; + /** [Output only] The current software version of the master endpoint. */ + currentMasterVersion?: string; + /** [Output only] The number of nodes currently in the cluster. */ + currentNodeCount?: number; + /** + * [Output only] The current version of the node software components. + * If they are currently at multiple versions because they're in the process + * of being upgraded, this reflects the minimum version of all nodes. + */ + currentNodeVersion?: string; + /** An optional description of this cluster. */ + description?: string; + /** + * Kubernetes alpha features are enabled on this cluster. This includes alpha + * API groups (e.g. v1alpha1) and features that may not be production ready in + * the kubernetes version of the master and nodes. + * The cluster has no SLA for uptime and master/node upgrades are disabled. + * Alpha enabled clusters are automatically deleted thirty days after + * creation. + */ + enableKubernetesAlpha?: boolean; + /** + * [Output only] The IP address of this cluster's master endpoint. + * The endpoint can be accessed from the internet at + * `https://username:password@endpoint/`. + * + * See the `masterAuth` property of this resource for username and + * password information. + */ + endpoint?: string; + /** + * [Output only] The time the cluster will be automatically + * deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + expireTime?: string; + /** + * The initial Kubernetes version for this cluster. Valid versions are those + * found in validMasterVersions returned by getServerConfig. The version can + * be upgraded over time; such upgrades are reflected in + * currentMasterVersion and currentNodeVersion. + */ + initialClusterVersion?: string; + /** + * The number of nodes to create in this cluster. You must ensure that your + * Compute Engine resource quota + * is sufficient for this number of instances. You must also have available + * firewall and routes quota. + * For requests, this field should only be used in lieu of a + * "node_pool" object, since this configuration (along with the + * "node_config") will be used to create a "NodePool" object with an + * auto-generated name. Do not use this and a node_pool at the same time. + */ + initialNodeCount?: number; + /** + * [Output only] The resource URLs of [instance + * groups](/compute/docs/instance-groups/) associated with this + * cluster. + */ + instanceGroupUrls?: string[]; + /** Configuration for cluster IP allocation. */ + ipAllocationPolicy?: IPAllocationPolicy; + /** The fingerprint of the set of labels for this cluster. */ + labelFingerprint?: string; + /** Configuration for the legacy ABAC authorization mode. */ + legacyAbac?: LegacyAbac; + /** + * The list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's nodes + * should be located. + */ + locations?: string[]; + /** + * The logging service the cluster should use to write logs. + * Currently available options: + * + * * `logging.googleapis.com` - the Google Cloud Logging service. + * * `none` - no logs will be exported from the cluster. + * * if left as an empty string,`logging.googleapis.com` will be used. + */ + loggingService?: string; + /** Configure the maintenance policy for this cluster. */ + maintenancePolicy?: MaintenancePolicy; + /** The authentication information for accessing the master endpoint. */ + masterAuth?: MasterAuth; + /** + * Master authorized networks is a Beta feature. + * The configuration options for master authorized networks feature. + */ + masterAuthorizedNetworksConfig?: MasterAuthorizedNetworksConfig; + /** + * The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + * * `none` - no metrics will be exported from the cluster. + * * if left as an empty string, `monitoring.googleapis.com` will be used. + */ + monitoringService?: string; + /** + * The name of this cluster. The name must be unique within this project + * and zone, and can be up to 40 characters with the following restrictions: + * + * * Lowercase letters, numbers, and hyphens only. + * * Must start with a letter. + * * Must end with a number or a letter. + */ + name?: string; + /** + * The name of the Google Compute Engine + * [network](/compute/docs/networks-and-firewalls#networks) to which the + * cluster is connected. If left unspecified, the `default` network + * will be used. + */ + network?: string; + /** Configuration options for the NetworkPolicy feature. */ + networkPolicy?: NetworkPolicy; + /** + * Parameters used in creating the cluster's nodes. + * See `nodeConfig` for the description of its properties. + * For requests, this field should only be used in lieu of a + * "node_pool" object, since this configuration (along with the + * "initial_node_count") will be used to create a "NodePool" object with an + * auto-generated name. Do not use this and a node_pool at the same time. + * For responses, this field will be populated with the node configuration of + * the first node pool. + * + * If unspecified, the defaults are used. + */ + nodeConfig?: NodeConfig; + /** + * [Output only] The size of the address space on each node for hosting + * containers. This is provisioned from within the `container_ipv4_cidr` + * range. + */ + nodeIpv4CidrSize?: number; + /** + * The node pools associated with this cluster. + * This field should not be set if "node_config" or "initial_node_count" are + * specified. + */ + nodePools?: NodePool[]; + /** + * The resource labels for the cluster to use to annotate any related + * Google Compute Engine resources. + */ + resourceLabels?: Record; + /** [Output only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * [Output only] The IP address range of the Kubernetes services in + * this cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `1.2.3.4/29`). Service addresses are + * typically put in the last `/16` from the container CIDR. + */ + servicesIpv4Cidr?: string; + /** [Output only] The current status of this cluster. */ + status?: string; + /** + * [Output only] Additional information about the current status of this + * cluster, if available. + */ + statusMessage?: string; + /** + * The name of the Google Compute Engine + * [subnetwork](/compute/docs/subnetworks) to which the + * cluster is connected. + */ + subnetwork?: string; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone?: string; + } + interface ClusterUpdate { + /** Configurations for the various addons available to run in the cluster. */ + desiredAddonsConfig?: AddonsConfig; + /** + * The desired image type for the node pool. + * NOTE: Set the "desired_node_pool" field as well. + */ + desiredImageType?: string; + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's nodes + * should be located. Changing the locations a cluster is in will result + * in nodes being either created or removed from the cluster, depending on + * whether locations are being added or removed. + * + * This list must always include the cluster's primary zone. + */ + desiredLocations?: string[]; + /** + * Master authorized networks is a Beta feature. + * The desired configuration options for master authorized networks feature. + */ + desiredMasterAuthorizedNetworksConfig?: MasterAuthorizedNetworksConfig; + /** + * The Kubernetes version to change the master to. The only valid value is the + * latest supported version. Use "-" to have the server automatically select + * the latest version. + */ + desiredMasterVersion?: string; + /** + * The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com" - the Google Cloud Monitoring service + * * "none" - no metrics will be exported from the cluster + */ + desiredMonitoringService?: string; + /** + * Autoscaler configuration for the node pool specified in + * desired_node_pool_id. If there is only one pool in the + * cluster and desired_node_pool_id is not provided then + * the change applies to that single node pool. + */ + desiredNodePoolAutoscaling?: NodePoolAutoscaling; + /** + * The node pool to be upgraded. This field is mandatory if + * "desired_node_version", "desired_image_family" or + * "desired_node_pool_autoscaling" is specified and there is more than one + * node pool on the cluster. + */ + desiredNodePoolId?: string; + /** + * The Kubernetes version to change the nodes to (typically an + * upgrade). Use `-` to upgrade to the latest version supported by + * the server. + */ + desiredNodeVersion?: string; + } + interface CreateClusterRequest { + /** + * A [cluster + * resource](/container-engine/reference/rest/v1/projects.zones.clusters) + */ + cluster?: Cluster; + } + interface CreateNodePoolRequest { + /** The node pool to create. */ + nodePool?: NodePool; + } + interface DailyMaintenanceWindow { + /** + * [Output only] Duration of the time window, automatically chosen to be + * smallest possible in the given scenario. + * Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + * format "PTnHnMnS". + */ + duration?: string; + /** + * Time within the maintenance window to start the maintenance operations. + * Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + * format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + */ + startTime?: string; + } + interface HorizontalPodAutoscaling { + /** + * Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + * When enabled, it ensures that a Heapster pod is running in the cluster, + * which is also used by the Cloud Monitoring service. + */ + disabled?: boolean; + } + interface HttpLoadBalancing { + /** + * Whether the HTTP Load Balancing controller is enabled in the cluster. + * When enabled, it runs a small pod in the cluster that manages the load + * balancers. + */ + disabled?: boolean; + } + interface IPAllocationPolicy { + /** This field is deprecated, use cluster_ipv4_cidr_block. */ + clusterIpv4Cidr?: string; + /** + * The IP address range for the cluster pod IPs. If this field is set, then + * `cluster.cluster_ipv4_cidr` must be left blank. + * + * This field is only applicable when `use_ip_aliases` is true. + * + * Set to blank to have a range chosen with the default size. + * + * Set to /netmask (e.g. `/14`) to have a range chosen with a specific + * netmask. + * + * Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + clusterIpv4CidrBlock?: string; + /** + * The name of the secondary range to be used for the cluster CIDR + * block. The secondary range will be used for pod IP + * addresses. This must be an existing secondary range associated + * with the cluster subnetwork. + * + * This field is only applicable with use_ip_aliases is true and + * create_subnetwork is false. + */ + clusterSecondaryRangeName?: string; + /** + * Whether a new subnetwork will be created automatically for the cluster. + * + * This field is only applicable when `use_ip_aliases` is true. + */ + createSubnetwork?: boolean; + /** This field is deprecated, use node_ipv4_cidr_block. */ + nodeIpv4Cidr?: string; + /** + * The IP address range of the instance IPs in this cluster. + * + * This is applicable only if `create_subnetwork` is true. + * + * Set to blank to have a range chosen with the default size. + * + * Set to /netmask (e.g. `/14`) to have a range chosen with a specific + * netmask. + * + * Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + nodeIpv4CidrBlock?: string; + /** This field is deprecated, use services_ipv4_cidr_block. */ + servicesIpv4Cidr?: string; + /** + * The IP address range of the services IPs in this cluster. If blank, a range + * will be automatically chosen with the default size. + * + * This field is only applicable when `use_ip_aliases` is true. + * + * Set to blank to have a range chosen with the default size. + * + * Set to /netmask (e.g. `/14`) to have a range chosen with a specific + * netmask. + * + * Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + servicesIpv4CidrBlock?: string; + /** + * The name of the secondary range to be used as for the services + * CIDR block. The secondary range will be used for service + * ClusterIPs. This must be an existing secondary range associated + * with the cluster subnetwork. + * + * This field is only applicable with use_ip_aliases is true and + * create_subnetwork is false. + */ + servicesSecondaryRangeName?: string; + /** + * A custom subnetwork name to be used if `create_subnetwork` is true. If + * this field is empty, then an automatic name will be chosen for the new + * subnetwork. + */ + subnetworkName?: string; + /** Whether alias IPs will be used for pod IPs in the cluster. */ + useIpAliases?: boolean; + } + interface KubernetesDashboard { + /** Whether the Kubernetes Dashboard is enabled for this cluster. */ + disabled?: boolean; + } + interface LegacyAbac { + /** + * Whether the ABAC authorizer is enabled for this cluster. When enabled, + * identities in the system, including service accounts, nodes, and + * controllers, will have statically granted permissions beyond those + * provided by the RBAC configuration or IAM. + */ + enabled?: boolean; + } + interface ListClustersResponse { + /** + * A list of clusters in the project in the specified zone, or + * across all ones. + */ + clusters?: Cluster[]; + /** + * If any zones are listed here, the list of clusters returned + * may be missing those zones. + */ + missingZones?: string[]; + } + interface ListNodePoolsResponse { + /** A list of node pools for a cluster. */ + nodePools?: NodePool[]; + } + interface ListOperationsResponse { + /** + * If any zones are listed here, the list of operations returned + * may be missing the operations from those zones. + */ + missingZones?: string[]; + /** A list of operations in the project in the specified zone. */ + operations?: Operation[]; + } + interface MaintenancePolicy { + /** Specifies the maintenance window in which maintenance may be performed. */ + window?: MaintenanceWindow; + } + interface MaintenanceWindow { + /** DailyMaintenanceWindow specifies a daily maintenance operation window. */ + dailyMaintenanceWindow?: DailyMaintenanceWindow; + } + interface MasterAuth { + /** + * [Output only] Base64-encoded public certificate used by clients to + * authenticate to the cluster endpoint. + */ + clientCertificate?: string; + /** + * Configuration for client certificate authentication on the cluster. If no + * configuration is specified, a client certificate is issued. + */ + clientCertificateConfig?: ClientCertificateConfig; + /** + * [Output only] Base64-encoded private key used by clients to authenticate + * to the cluster endpoint. + */ + clientKey?: string; + /** + * [Output only] Base64-encoded public certificate that is the root of + * trust for the cluster. + */ + clusterCaCertificate?: string; + /** + * The password to use for HTTP basic authentication to the master endpoint. + * Because the master endpoint is open to the Internet, you should create a + * strong password. If a password is provided for cluster creation, username + * must be non-empty. + */ + password?: string; + /** + * The username to use for HTTP basic authentication to the master endpoint. + * For clusters v1.6.0 and later, you can disable basic authentication by + * providing an empty username. + */ + username?: string; + } + interface MasterAuthorizedNetworksConfig { + /** + * cidr_blocks define up to 10 external networks that could access + * Kubernetes master through HTTPS. + */ + cidrBlocks?: CidrBlock[]; + /** Whether or not master authorized networks is enabled. */ + enabled?: boolean; + } + interface NetworkPolicy { + /** Whether network policy is enabled on the cluster. */ + enabled?: boolean; + /** The selected network policy provider. */ + provider?: string; + } + interface NetworkPolicyConfig { + /** Whether NetworkPolicy is enabled for this cluster. */ + disabled?: boolean; + } + interface NodeConfig { + /** + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + */ + accelerators?: AcceleratorConfig[]; + /** + * Size of the disk attached to each node, specified in GB. + * The smallest allowed disk size is 10GB. + * + * If unspecified, the default disk size is 100GB. + */ + diskSizeGb?: number; + /** + * The image type to use for this node. Note that for a given image type, + * the latest version of it will be used. + */ + imageType?: string; + /** + * The map of Kubernetes labels (key/value pairs) to be applied to each node. + * These will added in addition to any default label(s) that + * Kubernetes may apply to the node. + * In case of conflict in label keys, the applied set may differ depending on + * the Kubernetes version -- it's best to assume the behavior is undefined + * and conflicts should be avoided. + * For more information, including usage and the valid values, see: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + */ + labels?: Record; + /** + * The number of local SSD disks to be attached to the node. + * + * The limit for this value is dependant upon the maximum number of + * disks available on a machine per zone. See: + * https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + * for more information. + */ + localSsdCount?: number; + /** + * The name of a Google Compute Engine [machine + * type](/compute/docs/machine-types) (e.g. + * `n1-standard-1`). + * + * If unspecified, the default machine type is + * `n1-standard-1`. + */ + machineType?: string; + /** + * The metadata key/value pairs assigned to instances in the cluster. + * + * Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes + * in length. These are reflected as part of a URL in the metadata server. + * Additionally, to avoid ambiguity, keys must not conflict with any other + * metadata keys for the project or be one of the four reserved keys: + * "instance-template", "kube-env", "startup-script", and "user-data" + * + * Values are free-form strings, and only have meaning as interpreted by + * the image running in the instance. The only restriction placed on them is + * that each value's size must be less than or equal to 32 KB. + * + * The total size of all keys and values must be less than 512 KB. + */ + metadata?: Record; + /** + * Minimum CPU platform to be used by this instance. The instance may be + * scheduled on the specified or newer CPU platform. Applicable values are the + * friendly names of CPU platforms, such as + * minCpuPlatform: "Intel Haswell" or + * minCpuPlatform: "Intel Sandy Bridge". For more + * information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + */ + minCpuPlatform?: string; + /** + * The set of Google API scopes to be made available on all of the + * node VMs under the "default" service account. + * + * The following scopes are recommended, but not required, and by default are + * not included: + * + * * `https://www.googleapis.com/auth/compute` is required for mounting + * persistent storage on your nodes. + * * `https://www.googleapis.com/auth/devstorage.read_only` is required for + * communicating with **gcr.io** + * (the [Google Container Registry](/container-registry/)). + * + * If unspecified, no scopes are added, unless Cloud Logging or Cloud + * Monitoring are enabled, in which case their required scopes will be added. + */ + oauthScopes?: string[]; + /** + * Whether the nodes are created as preemptible VM instances. See: + * https://cloud.google.com/compute/docs/instances/preemptible for more + * information about preemptible VM instances. + */ + preemptible?: boolean; + /** + * The Google Cloud Platform Service Account to be used by the node VMs. If + * no Service Account is specified, the "default" service account is used. + */ + serviceAccount?: string; + /** + * The list of instance tags applied to all nodes. Tags are used to identify + * valid sources or targets for network firewalls and are specified by + * the client during cluster or node pool creation. Each tag within the list + * must comply with RFC1035. + */ + tags?: string[]; + } + interface NodeManagement { + /** + * A flag that specifies whether the node auto-repair is enabled for the node + * pool. If enabled, the nodes in this node pool will be monitored and, if + * they fail health checks too many times, an automatic repair action will be + * triggered. + */ + autoRepair?: boolean; + /** + * A flag that specifies whether node auto-upgrade is enabled for the node + * pool. If enabled, node auto-upgrade helps keep the nodes in your node pool + * up to date with the latest release version of Kubernetes. + */ + autoUpgrade?: boolean; + /** Specifies the Auto Upgrade knobs for the node pool. */ + upgradeOptions?: AutoUpgradeOptions; + } + interface NodePool { + /** + * Autoscaler configuration for this NodePool. Autoscaler is enabled + * only if a valid configuration is present. + */ + autoscaling?: NodePoolAutoscaling; + /** The node configuration of the pool. */ + config?: NodeConfig; + /** + * The initial node count for the pool. You must ensure that your + * Compute Engine resource quota + * is sufficient for this number of instances. You must also have available + * firewall and routes quota. + */ + initialNodeCount?: number; + /** + * [Output only] The resource URLs of [instance + * groups](/compute/docs/instance-groups/) associated with this + * node pool. + */ + instanceGroupUrls?: string[]; + /** NodeManagement configuration for this NodePool. */ + management?: NodeManagement; + /** The name of the node pool. */ + name?: string; + /** [Output only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output only] The status of the nodes in this pool instance. */ + status?: string; + /** + * [Output only] Additional information about the current status of this + * node pool instance, if available. + */ + statusMessage?: string; + /** [Output only] The version of the Kubernetes of this node. */ + version?: string; + } + interface NodePoolAutoscaling { + /** Is autoscaling enabled for this node pool. */ + enabled?: boolean; + /** + * Maximum number of nodes in the NodePool. Must be >= min_node_count. There + * has to enough quota to scale up the cluster. + */ + maxNodeCount?: number; + /** + * Minimum number of nodes in the NodePool. Must be >= 1 and <= + * max_node_count. + */ + minNodeCount?: number; + } + interface Operation { + /** Detailed operation progress, if available. */ + detail?: string; + /** + * [Output only] The time the operation completed, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + endTime?: string; + /** The server-assigned ID for the operation. */ + name?: string; + /** The operation type. */ + operationType?: string; + /** Server-defined URL for the resource. */ + selfLink?: string; + /** + * [Output only] The time the operation started, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + startTime?: string; + /** The current status of the operation. */ + status?: string; + /** If an error has occurred, a textual description of the error. */ + statusMessage?: string; + /** Server-defined URL for the target of the operation. */ + targetLink?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation + * is taking place. + */ + zone?: string; + } + interface ServerConfig { + /** Version of Kubernetes the service deploys by default. */ + defaultClusterVersion?: string; + /** Default image type. */ + defaultImageType?: string; + /** List of valid image types. */ + validImageTypes?: string[]; + /** List of valid master versions. */ + validMasterVersions?: string[]; + /** List of valid node upgrade target versions. */ + validNodeVersions?: string[]; + } + interface SetAddonsConfigRequest { + /** + * The desired configurations for the various addons available to run in the + * cluster. + */ + addonsConfig?: AddonsConfig; + } + interface SetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, + * used to detect conflicts. The fingerprint is initially generated by + * Container Engine and changes after every request to modify or update + * labels. You must always provide an up-to-date fingerprint hash when + * updating or changing labels. Make a get() request to the + * resource to get the latest fingerprint. + */ + labelFingerprint?: string; + /** The labels to set for that cluster. */ + resourceLabels?: Record; + } + interface SetLegacyAbacRequest { + /** Whether ABAC authorization will be enabled in the cluster. */ + enabled?: boolean; + } + interface SetLocationsRequest { + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's nodes + * should be located. Changing the locations a cluster is in will result + * in nodes being either created or removed from the cluster, depending on + * whether locations are being added or removed. + * + * This list must always include the cluster's primary zone. + */ + locations?: string[]; + } + interface SetLoggingServiceRequest { + /** + * The logging service the cluster should use to write metrics. + * Currently available options: + * + * * "logging.googleapis.com" - the Google Cloud Logging service + * * "none" - no metrics will be exported from the cluster + */ + loggingService?: string; + } + interface SetMaintenancePolicyRequest { + /** + * The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + */ + maintenancePolicy?: MaintenancePolicy; + } + interface SetMasterAuthRequest { + /** The exact form of action to be taken on the master auth. */ + action?: string; + /** A description of the update. */ + update?: MasterAuth; + } + interface SetMonitoringServiceRequest { + /** + * The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com" - the Google Cloud Monitoring service + * * "none" - no metrics will be exported from the cluster + */ + monitoringService?: string; + } + interface SetNetworkPolicyRequest { + /** Configuration options for the NetworkPolicy feature. */ + networkPolicy?: NetworkPolicy; + } + interface SetNodePoolAutoscalingRequest { + /** Autoscaling configuration for the node pool. */ + autoscaling?: NodePoolAutoscaling; + } + interface SetNodePoolManagementRequest { + /** NodeManagement configuration for the node pool. */ + management?: NodeManagement; + } + interface SetNodePoolSizeRequest { + /** The desired node count for the pool. */ + nodeCount?: number; + } + interface UpdateClusterRequest { + /** A description of the update. */ + update?: ClusterUpdate; + } + interface UpdateMasterRequest { + /** + * The Kubernetes version to change the master to. The only valid value is the + * latest supported version. Use "-" to have the server automatically select + * the latest version. + */ + masterVersion?: string; + } + interface UpdateNodePoolRequest { + /** The desired image type for the node pool. */ + imageType?: string; + /** + * The Kubernetes version to change the nodes to (typically an + * upgrade). Use `-` to upgrade to the latest version supported by + * the server. + */ + nodeVersion?: string; + } + interface NodePoolsResource { + /** Sets the autoscaling settings of a specific node pool. */ + autoscaling(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to upgrade. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Creates a node pool for a cluster. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Deletes a node pool from a cluster. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to delete. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Retrieves the node pool requested. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Lists the node pools for a cluster. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Roll back the previously Aborted or Failed NodePool upgrade. + * This will be an no-op if the last upgrade successfully completed. + */ + rollback(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to rollback. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to rollback. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the NodeManagement options for a node pool. */ + setManagement(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to update. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the size of a specific node pool. */ + setSize(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to update. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Updates the version and/or image type of a specific node pool. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to upgrade. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + } + interface ClustersResource { + /** Sets the addons of a specific cluster. */ + addons(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Completes master IP rotation. */ + completeIpRotation(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Creates a cluster, consisting of the specified number and type of Google + * Compute Engine instances. + * + * By default, the cluster is created in the project's + * [default network](/compute/docs/networks-and-firewalls#networks). + * + * One firewall is added for the cluster. After cluster creation, + * the cluster creates routes for each node to allow the containers + * on that node to communicate with all other instances in the + * cluster. + * + * Finally, an entry is added to the project's global metadata indicating + * which CIDR range is being used by the cluster. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Deletes the cluster, including the Kubernetes endpoint and all worker + * nodes. + * + * Firewalls and routes that were configured during cluster creation + * are also deleted. + * + * Other Google Compute Engine resources that might be in use by the cluster + * (e.g. load balancer resources) will not be deleted if they weren't present + * at the initial create time. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to delete. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Gets the details of a specific cluster. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to retrieve. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Enables or disables the ABAC authorization mechanism on a cluster. */ + legacyAbac(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Lists all clusters owned by a project in either the specified zone or all + * zones. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides, or "-" for all zones. + */ + zone: string; + }): Request; + /** Sets the locations of a specific cluster. */ + locations(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the logging service of a specific cluster. */ + logging(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Updates the master of a specific cluster. */ + master(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the monitoring service of a specific cluster. */ + monitoring(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets labels on a cluster. */ + resourceLabels(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the maintenance policy for a cluster. */ + setMaintenancePolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Used to set master auth materials. Currently supports :- + * Changing the admin password of a specific cluster. + * This can be either via password generation or explicitly set the password. + */ + setMasterAuth(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Enables/Disables Network Policy for a cluster. */ + setNetworkPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Start master IP rotation. */ + startIpRotation(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Updates the settings of a specific cluster. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + nodePools: NodePoolsResource; + } + interface OperationsResource { + /** Cancels the specified operation. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The server-assigned `name` of the operation. */ + operationId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation resides. + */ + zone: string; + }): Request<{}>; + /** Gets the specified operation. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The server-assigned `name` of the operation. */ + operationId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Lists all operations in a project in a specific zone or all zones. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine [zone](/compute/docs/zones#available) + * to return operations for, or `-` for all zones. + */ + zone: string; + }): Request; + } + interface ZonesResource { + /** Returns configuration info about the Container Engine service. */ + getServerconfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine [zone](/compute/docs/zones#available) + * to return operations for. + */ + zone: string; + }): Request; + clusters: ClustersResource; + operations: OperationsResource; + } + interface ProjectsResource { + zones: ZonesResource; + } + } +} diff --git a/types/gapi.client.container/readme.md b/types/gapi.client.container/readme.md new file mode 100644 index 0000000000..a36149296e --- /dev/null +++ b/types/gapi.client.container/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Google Container Engine API v1 +The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology. +For detailed description please check [documentation](https://cloud.google.com/container-engine/). + +## Installing + +Install typings for Google Container Engine API: +``` +npm install @types/gapi.client.container@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('container', 'v1', () => { + // now we can use gapi.client.container + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Container Engine API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.container/tsconfig.json b/types/gapi.client.container/tsconfig.json new file mode 100644 index 0000000000..51ff6c98bb --- /dev/null +++ b/types/gapi.client.container/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.container-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.container/tslint.json b/types/gapi.client.container/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.container/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.content/gapi.client.content-tests.ts b/types/gapi.client.content/gapi.client.content-tests.ts new file mode 100644 index 0000000000..20b6ef8c93 --- /dev/null +++ b/types/gapi.client.content/gapi.client.content-tests.ts @@ -0,0 +1,387 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('content', 'v2', () => { + /** now we can use gapi.client.content */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your product listings and accounts for Google Shopping */ + 'https://www.googleapis.com/auth/content', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Returns information about the authenticated user. */ + await gapi.client.accounts.authinfo({ + }); + /** + * Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounts.claimwebsite({ + accountId: "accountId", + merchantId: "merchantId", + overwrite: true, + }); + /** Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. */ + await gapi.client.accounts.custombatch({ + dryRun: true, + }); + /** Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + await gapi.client.accounts.delete({ + accountId: "accountId", + dryRun: true, + force: true, + merchantId: "merchantId", + }); + /** + * Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounts.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + await gapi.client.accounts.insert({ + dryRun: true, + merchantId: "merchantId", + }); + /** Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.accounts.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + */ + await gapi.client.accounts.patch({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounts.update({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + await gapi.client.accountstatuses.custombatch({ + }); + /** + * Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accountstatuses.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.accountstatuses.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** Retrieves and updates tax settings of multiple accounts in a single request. */ + await gapi.client.accounttax.custombatch({ + dryRun: true, + }); + /** + * Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounttax.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.accounttax.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + await gapi.client.accounttax.patch({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounttax.update({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + await gapi.client.datafeeds.custombatch({ + dryRun: true, + }); + /** Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.delete({ + datafeedId: "datafeedId", + dryRun: true, + merchantId: "merchantId", + }); + /** Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.get({ + datafeedId: "datafeedId", + merchantId: "merchantId", + }); + /** Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.insert({ + dryRun: true, + merchantId: "merchantId", + }); + /** Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports + * patch semantics. + */ + await gapi.client.datafeeds.patch({ + datafeedId: "datafeedId", + dryRun: true, + merchantId: "merchantId", + }); + /** Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.update({ + datafeedId: "datafeedId", + dryRun: true, + merchantId: "merchantId", + }); + await gapi.client.datafeedstatuses.custombatch({ + }); + /** Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeedstatuses.get({ + country: "country", + datafeedId: "datafeedId", + language: "language", + merchantId: "merchantId", + }); + /** Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeedstatuses.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. + * This method can only be called for non-multi-client accounts. + */ + await gapi.client.inventory.custombatch({ + dryRun: true, + }); + /** + * Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This + * method can only be called for non-multi-client accounts. + */ + await gapi.client.inventory.set({ + dryRun: true, + merchantId: "merchantId", + productId: "productId", + storeCode: "storeCode", + }); + /** Marks an order as acknowledged. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.acknowledge({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.advancetestorder({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.cancel({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.cancellineitem({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.createtestorder({ + merchantId: "merchantId", + }); + /** Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.custombatch({ + }); + /** Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.get({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.getbymerchantorderid({ + merchantId: "merchantId", + merchantOrderId: "merchantOrderId", + }); + /** + * Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for + * non-multi-client accounts. + */ + await gapi.client.orders.gettestordertemplate({ + merchantId: "merchantId", + templateName: "templateName", + }); + /** Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.list({ + acknowledged: true, + maxResults: 2, + merchantId: "merchantId", + orderBy: "orderBy", + pageToken: "pageToken", + placedDateEnd: "placedDateEnd", + placedDateStart: "placedDateStart", + statuses: "statuses", + }); + /** Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.refund({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Returns a line item. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.returnlineitem({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.shiplineitems({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.updatemerchantorderid({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.updateshipment({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.custombatch({ + dryRun: true, + }); + /** Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.delete({ + dryRun: true, + merchantId: "merchantId", + productId: "productId", + }); + /** Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.get({ + merchantId: "merchantId", + productId: "productId", + }); + /** + * Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this + * method updates that entry. This method can only be called for non-multi-client accounts. + */ + await gapi.client.products.insert({ + dryRun: true, + merchantId: "merchantId", + }); + /** Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.list({ + includeInvalidInsertedItems: true, + maxResults: 2, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. */ + await gapi.client.productstatuses.custombatch({ + includeAttributes: true, + }); + /** Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.productstatuses.get({ + includeAttributes: true, + merchantId: "merchantId", + productId: "productId", + }); + /** Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.productstatuses.list({ + includeAttributes: true, + includeInvalidInsertedItems: true, + maxResults: 3, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** Retrieves and updates the shipping settings of multiple accounts in a single request. */ + await gapi.client.shippingsettings.custombatch({ + dryRun: true, + }); + /** + * Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.shippingsettings.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Retrieves supported carriers and carrier services for an account. */ + await gapi.client.shippingsettings.getsupportedcarriers({ + merchantId: "merchantId", + }); + /** Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.shippingsettings.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + await gapi.client.shippingsettings.patch({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.shippingsettings.update({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + } +}); diff --git a/types/gapi.client.content/index.d.ts b/types/gapi.client.content/index.d.ts new file mode 100644 index 0000000000..f3b3b51845 --- /dev/null +++ b/types/gapi.client.content/index.d.ts @@ -0,0 +1,3459 @@ +// Type definitions for Google Content API for Shopping v2 2.0 +// Project: https://developers.google.com/shopping-content +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/content/v2/rest + +/// + +declare namespace gapi.client { + /** Load Content API for Shopping v2 */ + function load(name: "content", version: "v2"): PromiseLike; + function load(name: "content", version: "v2", callback: () => any): void; + + const accounts: content.AccountsResource; + + const accountstatuses: content.AccountstatusesResource; + + const accounttax: content.AccounttaxResource; + + const datafeeds: content.DatafeedsResource; + + const datafeedstatuses: content.DatafeedstatusesResource; + + const inventory: content.InventoryResource; + + const orders: content.OrdersResource; + + const products: content.ProductsResource; + + const productstatuses: content.ProductstatusesResource; + + const shippingsettings: content.ShippingsettingsResource; + + namespace content { + interface Account { + /** Indicates whether the merchant sells adult content. */ + adultContent?: boolean; + /** + * List of linked AdWords accounts that are active or pending approval. To create a new link request, add a new link with status active to the list. It + * will remain in a pending state until approved or rejected either in the AdWords interface or through the AdWords API. To delete an active link, or to + * cancel a link request, remove it from the list. + */ + adwordsLinks?: AccountAdwordsLink[]; + /** Merchant Center account ID. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#account". */ + kind?: string; + /** Display name for the account. */ + name?: string; + /** URL for individual seller reviews, i.e., reviews for each child account. */ + reviewsUrl?: string; + /** Client-specific, locally-unique, internal ID for the child account. */ + sellerId?: string; + /** Users with access to the account. Every account (except for subaccounts) must have at least one admin user. */ + users?: AccountUser[]; + /** The merchant's website. */ + websiteUrl?: string; + /** + * List of linked YouTube channels that are active or pending approval. To create a new link request, add a new link with status active to the list. It + * will remain in a pending state until approved or rejected in the YT Creator Studio interface. To delete an active link, or to cancel a link request, + * remove it from the list. + */ + youtubeChannelLinks?: AccountYouTubeChannelLink[]; + } + interface AccountAdwordsLink { + /** Customer ID of the AdWords account. */ + adwordsId?: string; + /** + * Status of the link between this Merchant Center account and the AdWords account. Upon retrieval, it represents the actual status of the link and can be + * either active if it was approved in Google AdWords or pending if it's pending approval. Upon insertion, it represents the intended status of the link. + * Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status will + * remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if it + * was active or cancel the link request if it was pending. + */ + status?: string; + } + interface AccountIdentifier { + /** The aggregator ID, set for aggregators and subaccounts (in that case, it represents the aggregator of the subaccount). */ + aggregatorId?: string; + /** The merchant account ID, set for individual accounts and subaccounts. */ + merchantId?: string; + } + interface AccountStatus { + /** The ID of the account for which the status is reported. */ + accountId?: string; + /** A list of account level issues. */ + accountLevelIssues?: AccountStatusAccountLevelIssue[]; + /** A list of data quality issues. */ + dataQualityIssues?: AccountStatusDataQualityIssue[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountStatus". */ + kind?: string; + /** Whether the account's website is claimed or not. */ + websiteClaimed?: boolean; + } + interface AccountStatusAccountLevelIssue { + /** Country for which this issue is reported. */ + country?: string; + /** Additional details about the issue. */ + detail?: string; + /** Issue identifier. */ + id?: string; + /** Severity of the issue. */ + severity?: string; + /** Short description of the issue. */ + title?: string; + } + interface AccountStatusDataQualityIssue { + /** Country for which this issue is reported. */ + country?: string; + /** A more detailed description of the issue. */ + detail?: string; + /** Actual value displayed on the landing page. */ + displayedValue?: string; + /** Example items featuring the issue. */ + exampleItems?: AccountStatusExampleItem[]; + /** Issue identifier. */ + id?: string; + /** Last time the account was checked for this issue. */ + lastChecked?: string; + /** The attribute name that is relevant for the issue. */ + location?: string; + /** Number of items in the account found to have the said issue. */ + numItems?: number; + /** Severity of the problem. */ + severity?: string; + /** Submitted value that causes the issue. */ + submittedValue?: string; + } + interface AccountStatusExampleItem { + /** Unique item ID as specified in the uploaded product data. */ + itemId?: string; + /** Landing page of the item. */ + link?: string; + /** The item value that was submitted. */ + submittedValue?: string; + /** Title of the item. */ + title?: string; + /** The actual value on the landing page. */ + valueOnLandingPage?: string; + } + interface AccountTax { + /** The ID of the account to which these account tax settings belong. */ + accountId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountTax". */ + kind?: string; + /** Tax rules. Updating the tax rules will enable US taxes (not reversible). Defining no rules is equivalent to not charging tax at all. */ + rules?: AccountTaxTaxRule[]; + } + interface AccountTaxTaxRule { + /** Country code in which tax is applicable. */ + country?: string; + /** State (or province) is which the tax is applicable, described by its location id (also called criteria id). */ + locationId?: string; + /** Explicit tax rate in percent, represented as a floating point number without the percentage character. Must not be negative. */ + ratePercent?: string; + /** If true, shipping charges are also taxed. */ + shippingTaxed?: boolean; + /** Whether the tax rate is taken from a global tax table or specified explicitly. */ + useGlobalRate?: boolean; + } + interface AccountUser { + /** Whether user is an admin. */ + admin?: boolean; + /** User's email address. */ + emailAddress?: string; + } + interface AccountYouTubeChannelLink { + /** Channel ID. */ + channelId?: string; + /** + * Status of the link between this Merchant Center account and the YouTube channel. Upon retrieval, it represents the actual status of the link and can be + * either active if it was approved in YT Creator Studio or pending if it's pending approval. Upon insertion, it represents the intended status of the + * link. Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status + * will remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if + * it was active or cancel the link request if it was pending. + */ + status?: string; + } + interface AccountsAuthInfoResponse { + /** + * The account identifiers corresponding to the authenticated user. + * - For an individual account: only the merchant ID is defined + * - For an aggregator: only the aggregator ID is defined + * - For a subaccount of an MCA: both the merchant ID and the aggregator ID are defined. + */ + accountIdentifiers?: AccountIdentifier[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsAuthInfoResponse". */ + kind?: string; + } + interface AccountsClaimWebsiteResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsClaimWebsiteResponse". */ + kind?: string; + } + interface AccountsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: AccountsCustomBatchRequestEntry[]; + } + interface AccountsCustomBatchRequestEntry { + /** The account to create or update. Only defined if the method is insert or update. */ + account?: Account; + /** The ID of the targeted account. Only defined if the method is get, delete or claimwebsite. */ + accountId?: string; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** Whether the account should be deleted if the account has offers. Only applicable if the method is delete. */ + force?: boolean; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** Only applicable if the method is claimwebsite. Indicates whether or not to take the claim from another account in case there is a conflict. */ + overwrite?: boolean; + } + interface AccountsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: AccountsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponse". */ + kind?: string; + } + interface AccountsCustomBatchResponseEntry { + /** The retrieved, created, or updated account. Not defined if the method was delete or claimwebsite. */ + account?: Account; + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponseEntry". */ + kind?: string; + } + interface AccountsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of accounts. */ + nextPageToken?: string; + resources?: Account[]; + } + interface AccountstatusesCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: AccountstatusesCustomBatchRequestEntry[]; + } + interface AccountstatusesCustomBatchRequestEntry { + /** The ID of the (sub-)account whose status to get. */ + accountId?: string; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + /** The method (get). */ + method?: string; + } + interface AccountstatusesCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: AccountstatusesCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountstatusesCustomBatchResponse". */ + kind?: string; + } + interface AccountstatusesCustomBatchResponseEntry { + /** The requested account status. Defined if and only if the request was successful. */ + accountStatus?: AccountStatus; + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + } + interface AccountstatusesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accountstatusesListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of account statuses. */ + nextPageToken?: string; + resources?: AccountStatus[]; + } + interface AccounttaxCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: AccounttaxCustomBatchRequestEntry[]; + } + interface AccounttaxCustomBatchRequestEntry { + /** The ID of the account for which to get/update account tax settings. */ + accountId?: string; + /** The account tax settings to update. Only defined if the method is update. */ + accountTax?: AccountTax; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + } + interface AccounttaxCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: AccounttaxCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accounttaxCustomBatchResponse". */ + kind?: string; + } + interface AccounttaxCustomBatchResponseEntry { + /** The retrieved or updated account tax settings. */ + accountTax?: AccountTax; + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#accounttaxCustomBatchResponseEntry". */ + kind?: string; + } + interface AccounttaxListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accounttaxListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of account tax settings. */ + nextPageToken?: string; + resources?: AccountTax[]; + } + interface CarrierRate { + /** Carrier service, such as "UPS" or "Fedex". The list of supported carriers can be retrieved via the getSupportedCarriers method. Required. */ + carrierName?: string; + /** + * Carrier service, such as "ground" or "2 days". The list of supported services for a carrier can be retrieved via the getSupportedCarriers method. + * Required. + */ + carrierService?: string; + /** + * Additive shipping rate modifier. Can be negative. For example { "value": "1", "currency" : "USD" } adds $1 to the rate, { "value": "-3", "currency" : + * "USD" } removes $3 from the rate. Optional. + */ + flatAdjustment?: Price; + /** Name of the carrier rate. Must be unique per rate group. Required. */ + name?: string; + /** Shipping origin for this carrier rate. Required. */ + originPostalCode?: string; + /** + * Multiplicative shipping rate modifier as a number in decimal notation. Can be negative. For example "5.4" increases the rate by 5.4%, "-3" decreases + * the rate by 3%. Optional. + */ + percentageAdjustment?: string; + } + interface CarriersCarrier { + /** The CLDR country code of the carrier (e.g., "US"). Always present. */ + country?: string; + /** The name of the carrier (e.g., "UPS"). Always present. */ + name?: string; + /** A list of supported services (e.g., "ground") for that carrier. Contains at least one service. */ + services?: string[]; + } + interface Datafeed { + /** The two-letter ISO 639-1 language in which the attributes are defined in the data feed. */ + attributeLanguage?: string; + /** + * [DEPRECATED] Please use target.language instead. The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for + * targetCountry. + */ + contentLanguage?: string; + /** The type of data feed. For product inventory feeds, only feeds for local stores, not online stores, are supported. */ + contentType?: string; + /** Fetch schedule for the feed file. */ + fetchSchedule?: DatafeedFetchSchedule; + /** The filename of the feed. All feeds must have a unique file name. */ + fileName?: string; + /** Format of the feed file. */ + format?: DatafeedFormat; + /** The ID of the data feed. */ + id?: string; + /** [DEPRECATED] Please use target.includedDestination instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center). */ + intendedDestinations?: string[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeed". */ + kind?: string; + /** A descriptive name of the data feed. */ + name?: string; + /** + * [DEPRECATED] Please use target.country instead. The country where the items in the feed will be included in the search index, represented as a CLDR + * territory code. + */ + targetCountry?: string; + /** The targets this feed should apply to (country, language, destinations). */ + targets?: DatafeedTarget[]; + } + interface DatafeedFetchSchedule { + /** The day of the month the feed file should be fetched (1-31). */ + dayOfMonth?: number; + /** + * The URL where the feed file can be fetched. Google Merchant Center will support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP + * protocols, so the value will need to be a valid link using one of those four protocols. + */ + fetchUrl?: string; + /** The hour of the day the feed file should be fetched (0-23). */ + hour?: number; + /** The minute of the hour the feed file should be fetched (0-59). Read-only. */ + minuteOfHour?: number; + /** An optional password for fetch_url. */ + password?: string; + /** Whether the scheduled fetch is paused or not. */ + paused?: boolean; + /** Time zone used for schedule. UTC by default. E.g., "America/Los_Angeles". */ + timeZone?: string; + /** An optional user name for fetch_url. */ + username?: string; + /** The day of the week the feed file should be fetched. */ + weekday?: string; + } + interface DatafeedFormat { + /** + * Delimiter for the separation of values in a delimiter-separated values feed. If not specified, the delimiter will be auto-detected. Ignored for non-DSV + * data feeds. + */ + columnDelimiter?: string; + /** Character encoding scheme of the data feed. If not specified, the encoding will be auto-detected. */ + fileEncoding?: string; + /** Specifies how double quotes are interpreted. If not specified, the mode will be auto-detected. Ignored for non-DSV data feeds. */ + quotingMode?: string; + } + interface DatafeedStatus { + /** The country for which the status is reported, represented as a CLDR territory code. */ + country?: string; + /** The ID of the feed for which the status is reported. */ + datafeedId?: string; + /** The list of errors occurring in the feed. */ + errors?: DatafeedStatusError[]; + /** The number of items in the feed that were processed. */ + itemsTotal?: string; + /** The number of items in the feed that were valid. */ + itemsValid?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedStatus". */ + kind?: string; + /** The two-letter ISO 639-1 language for which the status is reported. */ + language?: string; + /** The last date at which the feed was uploaded. */ + lastUploadDate?: string; + /** The processing status of the feed. */ + processingStatus?: string; + /** The list of errors occurring in the feed. */ + warnings?: DatafeedStatusError[]; + } + interface DatafeedStatusError { + /** The code of the error, e.g., "validation/invalid_value". */ + code?: string; + /** The number of occurrences of the error in the feed. */ + count?: string; + /** A list of example occurrences of the error, grouped by product. */ + examples?: DatafeedStatusExample[]; + /** The error message, e.g., "Invalid price". */ + message?: string; + } + interface DatafeedStatusExample { + /** The ID of the example item. */ + itemId?: string; + /** Line number in the data feed where the example is found. */ + lineNumber?: string; + /** The problematic value. */ + value?: string; + } + interface DatafeedTarget { + /** The country where the items in the feed will be included in the search index, represented as a CLDR territory code. */ + country?: string; + /** The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center). */ + excludedDestinations?: string[]; + /** + * The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included + * unless provided in the excluded_destination field. + */ + includedDestinations?: string[]; + /** The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targets[].country. */ + language?: string; + } + interface DatafeedsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: DatafeedsCustomBatchRequestEntry[]; + } + interface DatafeedsCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The data feed to insert. */ + datafeed?: Datafeed; + /** The ID of the data feed to get or delete. */ + datafeedId?: string; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + } + interface DatafeedsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: DatafeedsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedsCustomBatchResponse". */ + kind?: string; + } + interface DatafeedsCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** The requested data feed. Defined if and only if the request was successful. */ + datafeed?: Datafeed; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + } + interface DatafeedsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of datafeeds. */ + nextPageToken?: string; + resources?: Datafeed[]; + } + interface DatafeedstatusesCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: DatafeedstatusesCustomBatchRequestEntry[]; + } + interface DatafeedstatusesCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** + * The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that for multi-target + * datafeeds this parameter is required. + */ + country?: string; + /** The ID of the data feed to get. */ + datafeedId?: string; + /** + * The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that for multi-target + * datafeeds this parameter is required. + */ + language?: string; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + } + interface DatafeedstatusesCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: DatafeedstatusesCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedstatusesCustomBatchResponse". */ + kind?: string; + } + interface DatafeedstatusesCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** The requested data feed status. Defined if and only if the request was successful. */ + datafeedStatus?: DatafeedStatus; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + } + interface DatafeedstatusesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedstatusesListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of datafeed statuses. */ + nextPageToken?: string; + resources?: DatafeedStatus[]; + } + interface DeliveryTime { + /** + * Maximum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Must be greater than or equal to + * minTransitTimeInDays. Required. + */ + maxTransitTimeInDays?: number; + /** Minimum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Required. */ + minTransitTimeInDays?: number; + } + interface Error { + /** The domain of the error. */ + domain?: string; + /** A description of the error. */ + message?: string; + /** The error code. */ + reason?: string; + } + interface Errors { + /** The HTTP status of the first error in errors. */ + code?: number; + /** A list of errors. */ + errors?: Error[]; + /** The message of the first error in errors. */ + message?: string; + } + interface Headers { + /** A list of location ID sets. Must be non-empty. Can only be set if all other fields are not set. */ + locations?: LocationIdSet[]; + /** + * A list of inclusive number of items upper bounds. The last value can be "infinity". For example ["10", "50", "infinity"] represents the headers "<= 10 + * items", " 50 items". Must be non-empty. Can only be set if all other fields are not set. + */ + numberOfItems?: string[]; + /** + * A list of postal group names. The last value can be "all other locations". Example: ["zone 1", "zone 2", "all other locations"]. The referred postal + * code groups must match the delivery country of the service. Must be non-empty. Can only be set if all other fields are not set. + */ + postalCodeGroupNames?: string[]; + /** + * be "infinity". For example [{"value": "10", "currency": "USD"}, {"value": "500", "currency": "USD"}, {"value": "infinity", "currency": "USD"}] + * represents the headers "<= $10", " $500". All prices within a service must have the same currency. Must be non-empty. Can only be set if all other + * fields are not set. + */ + prices?: Price[]; + /** + * be "infinity". For example [{"value": "10", "unit": "kg"}, {"value": "50", "unit": "kg"}, {"value": "infinity", "unit": "kg"}] represents the headers + * "<= 10kg", " 50kg". All weights within a service must have the same unit. Must be non-empty. Can only be set if all other fields are not set. + */ + weights?: Weight[]; + } + interface Installment { + /** The amount the buyer has to pay per month. */ + amount?: Price; + /** The number of installments the buyer has to pay. */ + months?: string; + } + interface Inventory { + /** The availability of the product. */ + availability?: string; + /** Number and amount of installments to pay for an item. Brazil only. */ + installment?: Installment; + /** Identifies what kind of resource this is. Value: the fixed string "content#inventory". */ + kind?: string; + /** Loyalty points that users receive after purchasing the item. Japan only. */ + loyaltyPoints?: LoyaltyPoints; + /** + * Store pickup information. Only supported for local inventory. Not setting pickup means "don't update" while setting it to the empty value ({} in JSON) + * means "delete". Otherwise, pickupMethod and pickupSla must be set together, unless pickupMethod is "not supported". + */ + pickup?: InventoryPickup; + /** The price of the product. */ + price?: Price; + /** The quantity of the product. Must be equal to or greater than zero. Supported only for local products. */ + quantity?: number; + /** The sale price of the product. Mandatory if sale_price_effective_date is defined. */ + salePrice?: Price; + /** A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided. */ + salePriceEffectiveDate?: string; + /** The quantity of the product that is reserved for sell-on-google ads. Supported only for online products. */ + sellOnGoogleQuantity?: number; + } + interface InventoryCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: InventoryCustomBatchRequestEntry[]; + } + interface InventoryCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** Price and availability of the product. */ + inventory?: Inventory; + /** The ID of the managing account. */ + merchantId?: string; + /** The ID of the product for which to update price and availability. */ + productId?: string; + /** The code of the store for which to update price and availability. Use online to update price and availability of an online product. */ + storeCode?: string; + } + interface InventoryCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: InventoryCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#inventoryCustomBatchResponse". */ + kind?: string; + } + interface InventoryCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#inventoryCustomBatchResponseEntry". */ + kind?: string; + } + interface InventoryPickup { + /** + * Whether store pickup is available for this offer and whether the pickup option should be shown as buy, reserve, or not supported. Only supported for + * local inventory. Unless the value is "not supported", must be submitted together with pickupSla. + */ + pickupMethod?: string; + /** + * The expected date that an order will be ready for pickup, relative to when the order is placed. Only supported for local inventory. Must be submitted + * together with pickupMethod. + */ + pickupSla?: string; + } + interface InventorySetRequest { + /** The availability of the product. */ + availability?: string; + /** Number and amount of installments to pay for an item. Brazil only. */ + installment?: Installment; + /** Loyalty points that users receive after purchasing the item. Japan only. */ + loyaltyPoints?: LoyaltyPoints; + /** + * Store pickup information. Only supported for local inventory. Not setting pickup means "don't update" while setting it to the empty value ({} in JSON) + * means "delete". Otherwise, pickupMethod and pickupSla must be set together, unless pickupMethod is "not supported". + */ + pickup?: InventoryPickup; + /** The price of the product. */ + price?: Price; + /** The quantity of the product. Must be equal to or greater than zero. Supported only for local products. */ + quantity?: number; + /** The sale price of the product. Mandatory if sale_price_effective_date is defined. */ + salePrice?: Price; + /** A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided. */ + salePriceEffectiveDate?: string; + /** The quantity of the product that is reserved for sell-on-google ads. Supported only for online products. */ + sellOnGoogleQuantity?: number; + } + interface InventorySetResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#inventorySetResponse". */ + kind?: string; + } + interface LocationIdSet { + /** A non-empty list of location IDs. They must all be of the same location type (e.g., state). */ + locationIds?: string[]; + } + interface LoyaltyPoints { + /** Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters. */ + name?: string; + /** The retailer's loyalty points in absolute value. */ + pointsValue?: string; + /** The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0. */ + ratio?: number; + } + interface Order { + /** Whether the order was acknowledged. */ + acknowledged?: boolean; + /** The channel type of the order: "purchaseOnGoogle" or "googleExpress". */ + channelType?: string; + /** The details of the customer who placed the order. */ + customer?: OrderCustomer; + /** The details for the delivery. */ + deliveryDetails?: OrderDeliveryDetails; + /** The REST id of the order. Globally unique. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#order". */ + kind?: string; + /** Line items that are ordered. */ + lineItems?: OrderLineItem[]; + merchantId?: string; + /** Merchant-provided id of the order. */ + merchantOrderId?: string; + /** + * The net amount for the order. For example, if an order was originally for a grand total of $100 and a refund was issued for $20, the net amount will be + * $80. + */ + netAmount?: Price; + /** The details of the payment method. */ + paymentMethod?: OrderPaymentMethod; + /** The status of the payment. */ + paymentStatus?: string; + /** The date when the order was placed, in ISO 8601 format. */ + placedDate?: string; + /** The details of the merchant provided promotions applied to the order. More details about the program are here. */ + promotions?: OrderPromotion[]; + /** Refunds for the order. */ + refunds?: OrderRefund[]; + /** Shipments of the order. */ + shipments?: OrderShipment[]; + /** The total cost of shipping for all items. */ + shippingCost?: Price; + /** The tax for the total shipping cost. */ + shippingCostTax?: Price; + /** The requested shipping option. */ + shippingOption?: string; + /** The status of the order. */ + status?: string; + } + interface OrderAddress { + /** CLDR country code (e.g. "US"). */ + country?: string; + /** + * Strings representing the lines of the printed label for mailing the order, for example: + * John Smith + * 1600 Amphitheatre Parkway + * Mountain View, CA, 94043 + * United States + */ + fullAddress?: string[]; + /** Whether the address is a post office box. */ + isPostOfficeBox?: boolean; + /** City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs). */ + locality?: string; + /** Postal Code or ZIP (e.g. "94043"). */ + postalCode?: string; + /** Name of the recipient. */ + recipientName?: string; + /** Top-level administrative subdivision of the country (e.g. "CA"). */ + region?: string; + /** Street-level part of the address. */ + streetAddress?: string[]; + } + interface OrderCancellation { + /** The actor that created the cancellation. */ + actor?: string; + /** Date on which the cancellation has been created, in ISO 8601 format. */ + creationDate?: string; + /** The quantity that was canceled. */ + quantity?: number; + /** + * The reason for the cancellation. Orders that are cancelled with a noInventory reason will lead to the removal of the product from POG until you make an + * update to that product. This will not affect your Shopping ads. + */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrderCustomer { + /** Email address of the customer. */ + email?: string; + /** + * If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has + * already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. + */ + explicitMarketingPreference?: boolean; + /** Full name of the customer. */ + fullName?: string; + } + interface OrderDeliveryDetails { + /** The delivery address */ + address?: OrderAddress; + /** The phone number of the person receiving the delivery. */ + phoneNumber?: string; + } + interface OrderLineItem { + /** Cancellations of the line item. */ + cancellations?: OrderCancellation[]; + /** The channel type of the order: "purchaseOnGoogle" or "googleExpress". */ + channelType?: string; + /** The id of the line item. */ + id?: string; + /** Total price for the line item. For example, if two items for $10 are purchased, the total price will be $20. */ + price?: Price; + /** Product data from the time of the order placement. */ + product?: OrderLineItemProduct; + /** Number of items canceled. */ + quantityCanceled?: number; + /** Number of items delivered. */ + quantityDelivered?: number; + /** Number of items ordered. */ + quantityOrdered?: number; + /** Number of items pending. */ + quantityPending?: number; + /** Number of items returned. */ + quantityReturned?: number; + /** Number of items shipped. */ + quantityShipped?: number; + /** Details of the return policy for the line item. */ + returnInfo?: OrderLineItemReturnInfo; + /** Returns of the line item. */ + returns?: OrderReturn[]; + /** Details of the requested shipping for the line item. */ + shippingDetails?: OrderLineItemShippingDetails; + /** Total tax amount for the line item. For example, if two items are purchased, and each have a cost tax of $2, the total tax amount will be $4. */ + tax?: Price; + } + interface OrderLineItemProduct { + /** Brand of the item. */ + brand?: string; + /** The item's channel (online or local). */ + channel?: string; + /** Condition or state of the item. */ + condition?: string; + /** The two-letter ISO 639-1 language code for the item. */ + contentLanguage?: string; + /** Global Trade Item Number (GTIN) of the item. */ + gtin?: string; + /** The REST id of the product. */ + id?: string; + /** URL of an image of the item. */ + imageLink?: string; + /** Shared identifier for all variants of the same product. */ + itemGroupId?: string; + /** Manufacturer Part Number (MPN) of the item. */ + mpn?: string; + /** An identifier of the item. */ + offerId?: string; + /** Price of the item. */ + price?: Price; + /** URL to the cached image shown to the user when order was placed. */ + shownImage?: string; + /** The CLDR territory code of the target country of the product. */ + targetCountry?: string; + /** The title of the product. */ + title?: string; + /** + * Variant attributes for the item. These are dimensions of the product, such as color, gender, material, pattern, and size. You can find a comprehensive + * list of variant attributes here. + */ + variantAttributes?: OrderLineItemProductVariantAttribute[]; + } + interface OrderLineItemProductVariantAttribute { + /** The dimension of the variant. */ + dimension?: string; + /** The value for the dimension. */ + value?: string; + } + interface OrderLineItemReturnInfo { + /** How many days later the item can be returned. */ + daysToReturn?: number; + /** Whether the item is returnable. */ + isReturnable?: boolean; + /** URL of the item return policy. */ + policyUrl?: string; + } + interface OrderLineItemShippingDetails { + /** The delivery by date, in ISO 8601 format. */ + deliverByDate?: string; + /** Details of the shipping method. */ + method?: OrderLineItemShippingDetailsMethod; + /** The ship by date, in ISO 8601 format. */ + shipByDate?: string; + } + interface OrderLineItemShippingDetailsMethod { + /** The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values. */ + carrier?: string; + /** Maximum transit time. */ + maxDaysInTransit?: number; + /** The name of the shipping method. */ + methodName?: string; + /** Minimum transit time. */ + minDaysInTransit?: number; + } + interface OrderPaymentMethod { + /** The billing address. */ + billingAddress?: OrderAddress; + /** The card expiration month (January = 1, February = 2 etc.). */ + expirationMonth?: number; + /** The card expiration year (4-digit, e.g. 2015). */ + expirationYear?: number; + /** The last four digits of the card number. */ + lastFourDigits?: string; + /** The billing phone number. */ + phoneNumber?: string; + /** + * The type of instrument. + * + * Acceptable values are: + * - "AMEX" + * - "DISCOVER" + * - "JCB" + * - "MASTERCARD" + * - "UNIONPAY" + * - "VISA" + * - "" + */ + type?: string; + } + interface OrderPromotion { + benefits?: OrderPromotionBenefit[]; + /** + * The date and time frame when the promotion is active and ready for validation review. Note that the promotion live time may be delayed for a few hours + * due to the validation review. + * Start date and end date are separated by a forward slash (/). The start date is specified by the format (YYYY-MM-DD), followed by the letter ?T?, the + * time of the day when the sale starts (in Greenwich Mean Time, GMT), followed by an expression of the time zone for the sale. The end date is in the + * same format. + */ + effectiveDates?: string; + /** Optional. The text code that corresponds to the promotion when applied on the retailer?s website. */ + genericRedemptionCode?: string; + /** The unique ID of the promotion. */ + id?: string; + /** The full title of the promotion. */ + longTitle?: string; + /** Whether the promotion is applicable to all products or only specific products. */ + productApplicability?: string; + /** Indicates that the promotion is valid online. */ + redemptionChannel?: string; + } + interface OrderPromotionBenefit { + /** The discount in the order price when the promotion is applied. */ + discount?: Price; + /** The OfferId(s) that were purchased in this order and map to this specific benefit of the promotion. */ + offerIds?: string[]; + /** Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types. */ + subType?: string; + /** The impact on tax when the promotion is applied. */ + taxImpact?: Price; + /** Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping). */ + type?: string; + } + interface OrderRefund { + /** The actor that created the refund. */ + actor?: string; + /** The amount that is refunded. */ + amount?: Price; + /** Date on which the item has been created, in ISO 8601 format. */ + creationDate?: string; + /** The reason for the refund. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrderReturn { + /** The actor that created the refund. */ + actor?: string; + /** Date on which the item has been created, in ISO 8601 format. */ + creationDate?: string; + /** Quantity that is returned. */ + quantity?: number; + /** The reason for the return. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrderShipment { + /** + * The carrier handling the shipment. + * + * Acceptable values are: + * - "gsx" + * - "ups" + * - "united parcel service" + * - "usps" + * - "united states postal service" + * - "fedex" + * - "dhl" + * - "ecourier" + * - "cxt" + * - "google" + * - "on trac" + * - "ontrac" + * - "on-trac" + * - "on_trac" + * - "delvic" + * - "dynamex" + * - "lasership" + * - "smartpost" + * - "fedex smartpost" + * - "mpx" + * - "uds" + * - "united delivery service" + */ + carrier?: string; + /** Date on which the shipment has been created, in ISO 8601 format. */ + creationDate?: string; + /** Date on which the shipment has been delivered, in ISO 8601 format. Present only if status is delievered */ + deliveryDate?: string; + /** The id of the shipment. */ + id?: string; + /** The line items that are shipped. */ + lineItems?: OrderShipmentLineItemShipment[]; + /** The status of the shipment. */ + status?: string; + /** The tracking id for the shipment. */ + trackingId?: string; + } + interface OrderShipmentLineItemShipment { + /** The id of the line item that is shipped. */ + lineItemId?: string; + /** The quantity that is shipped. */ + quantity?: number; + } + interface OrdersAcknowledgeRequest { + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + } + interface OrdersAcknowledgeResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersAcknowledgeResponse". */ + kind?: string; + } + interface OrdersAdvanceTestOrderResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersAdvanceTestOrderResponse". */ + kind?: string; + } + interface OrdersCancelLineItemRequest { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The + * amount must not be larger than the net amount left on the order. + */ + amount?: Price; + /** The ID of the line item to cancel. */ + lineItemId?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The quantity to cancel. */ + quantity?: number; + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCancelLineItemResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelLineItemResponse". */ + kind?: string; + } + interface OrdersCancelRequest { + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCancelResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelResponse". */ + kind?: string; + } + interface OrdersCreateTestOrderRequest { + /** + * The test order template to use. Specify as an alternative to testOrder as a shortcut for retrieving a template and then creating an order using that + * template. + */ + templateName?: string; + /** The test order to create. */ + testOrder?: TestOrder; + } + interface OrdersCreateTestOrderResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCreateTestOrderResponse". */ + kind?: string; + /** The ID of the newly created test order. */ + orderId?: string; + } + interface OrdersCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: OrdersCustomBatchRequestEntry[]; + } + interface OrdersCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** Required for cancel method. */ + cancel?: OrdersCustomBatchRequestEntryCancel; + /** Required for cancelLineItem method. */ + cancelLineItem?: OrdersCustomBatchRequestEntryCancelLineItem; + /** The ID of the managing account. */ + merchantId?: string; + /** The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods. */ + merchantOrderId?: string; + /** The method to apply. */ + method?: string; + /** The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId. */ + operationId?: string; + /** The ID of the order. Required for all methods beside getByMerchantOrderId. */ + orderId?: string; + /** Required for refund method. */ + refund?: OrdersCustomBatchRequestEntryRefund; + /** Required for returnLineItem method. */ + returnLineItem?: OrdersCustomBatchRequestEntryReturnLineItem; + /** Required for shipLineItems method. */ + shipLineItems?: OrdersCustomBatchRequestEntryShipLineItems; + /** Required for updateShipment method. */ + updateShipment?: OrdersCustomBatchRequestEntryUpdateShipment; + } + interface OrdersCustomBatchRequestEntryCancel { + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryCancelLineItem { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The + * amount must not be larger than the net amount left on the order. + */ + amount?: Price; + /** The ID of the line item to cancel. */ + lineItemId?: string; + /** The quantity to cancel. */ + quantity?: number; + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryRefund { + /** The amount that is refunded. */ + amount?: Price; + /** The reason for the refund. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryReturnLineItem { + /** The ID of the line item to return. */ + lineItemId?: string; + /** The quantity to return. */ + quantity?: number; + /** The reason for the return. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryShipLineItems { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a + * list of acceptable values. + */ + carrier?: string; + /** Line items to ship. */ + lineItems?: OrderShipmentLineItemShipment[]; + /** Deprecated. Please use shipmentInfo instead. The ID of the shipment. */ + shipmentId?: string; + /** Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). */ + shipmentInfos?: OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. */ + trackingId?: string; + } + interface OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { + /** The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. */ + carrier?: string; + /** The ID of the shipment. */ + shipmentId?: string; + /** The tracking id for the shipment. */ + trackingId?: string; + } + interface OrdersCustomBatchRequestEntryUpdateShipment { + /** + * The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable + * values. + */ + carrier?: string; + /** The ID of the shipment. */ + shipmentId?: string; + /** New status for the shipment. Not updated if missing. */ + status?: string; + /** The tracking id for the shipment. Not updated if missing. */ + trackingId?: string; + } + interface OrdersCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: OrdersCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponse". */ + kind?: string; + } + interface OrdersCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** The status of the execution. Only defined if the method is not get or getByMerchantOrderId and if the request was successful. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponseEntry". */ + kind?: string; + /** The retrieved order. Only defined if the method is get and if the request was successful. */ + order?: Order; + } + interface OrdersGetByMerchantOrderIdResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersGetByMerchantOrderIdResponse". */ + kind?: string; + /** The requested order. */ + order?: Order; + } + interface OrdersGetTestOrderTemplateResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersGetTestOrderTemplateResponse". */ + kind?: string; + /** The requested test order template. */ + template?: TestOrder; + } + interface OrdersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of orders. */ + nextPageToken?: string; + resources?: Order[]; + } + interface OrdersRefundRequest { + /** The amount that is refunded. */ + amount?: Price; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The reason for the refund. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersRefundResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersRefundResponse". */ + kind?: string; + } + interface OrdersReturnLineItemRequest { + /** The ID of the line item to return. */ + lineItemId?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The quantity to return. */ + quantity?: number; + /** The reason for the return. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersReturnLineItemResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersReturnLineItemResponse". */ + kind?: string; + } + interface OrdersShipLineItemsRequest { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a + * list of acceptable values. + */ + carrier?: string; + /** Line items to ship. */ + lineItems?: OrderShipmentLineItemShipment[]; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** Deprecated. Please use shipmentInfo instead. The ID of the shipment. */ + shipmentId?: string; + /** Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). */ + shipmentInfos?: OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. */ + trackingId?: string; + } + interface OrdersShipLineItemsResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersShipLineItemsResponse". */ + kind?: string; + } + interface OrdersUpdateMerchantOrderIdRequest { + /** The merchant order id to be assigned to the order. Must be unique per merchant. */ + merchantOrderId?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + } + interface OrdersUpdateMerchantOrderIdResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateMerchantOrderIdResponse". */ + kind?: string; + } + interface OrdersUpdateShipmentRequest { + /** + * The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable + * values. + */ + carrier?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The ID of the shipment. */ + shipmentId?: string; + /** New status for the shipment. Not updated if missing. */ + status?: string; + /** The tracking id for the shipment. Not updated if missing. */ + trackingId?: string; + } + interface OrdersUpdateShipmentResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateShipmentResponse". */ + kind?: string; + } + interface PostalCodeGroup { + /** The CLDR territory code of the country the postal code group applies to. Required. */ + country?: string; + /** The name of the postal code group, referred to in headers. Required. */ + name?: string; + /** A range of postal codes. Required. */ + postalCodeRanges?: PostalCodeRange[]; + } + interface PostalCodeRange { + /** + * A postal code or a pattern of the form prefix* denoting the inclusive lower bound of the range defining the area. Examples values: "94108", "9410*", + * "9*". Required. + */ + postalCodeRangeBegin?: string; + /** + * A postal code or a pattern of the form prefix* denoting the inclusive upper bound of the range defining the area. It must have the same length as + * postalCodeRangeBegin: if postalCodeRangeBegin is a postal code then postalCodeRangeEnd must be a postal code too; if postalCodeRangeBegin is a pattern + * then postalCodeRangeEnd must be a pattern with the same prefix length. Optional: if not set, then the area is defined as being all the postal codes + * matching postalCodeRangeBegin. + */ + postalCodeRangeEnd?: string; + } + interface Price { + /** The currency of the price. */ + currency?: string; + /** The price represented as a number. */ + value?: string; + } + interface Product { + /** Additional URLs of images of the item. */ + additionalImageLinks?: string[]; + /** Additional categories of the item (formatted as in products feed specification). */ + additionalProductTypes?: string[]; + /** Set to true if the item is targeted towards adults. */ + adult?: boolean; + /** Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise. */ + adwordsGrouping?: string; + /** Similar to adwords_grouping, but only works on CPC. */ + adwordsLabels?: string[]; + /** Allows advertisers to override the item URL when the product is shown within the context of Product Ads. */ + adwordsRedirect?: string; + /** Target age group of the item. */ + ageGroup?: string; + /** Specifies the intended aspects for the product. */ + aspects?: ProductAspect[]; + /** Availability status of the item. */ + availability?: string; + /** The day a pre-ordered product becomes available for delivery, in ISO 8601 format. */ + availabilityDate?: string; + /** Brand of the item. */ + brand?: string; + /** The item's channel (online or local). */ + channel?: string; + /** Color of the item. */ + color?: string; + /** Condition or state of the item. */ + condition?: string; + /** The two-letter ISO 639-1 language code for the item. */ + contentLanguage?: string; + /** + * A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., + * { "name": "size type", "type": "text", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. + */ + customAttributes?: ProductCustomAttribute[]; + /** A list of custom (merchant-provided) custom attribute groups. */ + customGroups?: ProductCustomGroup[]; + /** Custom label 0 for custom grouping of items in a Shopping campaign. */ + customLabel0?: string; + /** Custom label 1 for custom grouping of items in a Shopping campaign. */ + customLabel1?: string; + /** Custom label 2 for custom grouping of items in a Shopping campaign. */ + customLabel2?: string; + /** Custom label 3 for custom grouping of items in a Shopping campaign. */ + customLabel3?: string; + /** Custom label 4 for custom grouping of items in a Shopping campaign. */ + customLabel4?: string; + /** Description of the item. */ + description?: string; + /** Specifies the intended destinations for the product. */ + destinations?: ProductDestination[]; + /** An identifier for an item for dynamic remarketing campaigns. */ + displayAdsId?: string; + /** URL directly to your item's landing page for dynamic remarketing campaigns. */ + displayAdsLink?: string; + /** Advertiser-specified recommendations. */ + displayAdsSimilarIds?: string[]; + /** Title of an item for dynamic remarketing campaigns. */ + displayAdsTitle?: string; + /** Offer margin for dynamic remarketing campaigns. */ + displayAdsValue?: number; + /** The energy efficiency class as defined in EU directive 2010/30/EU. */ + energyEfficiencyClass?: string; + /** + * Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in + * productstatuses as googleExpirationDate and might be earlier if expirationDate is too far in the future. + */ + expirationDate?: string; + /** Target gender of the item. */ + gender?: string; + /** Google's category of the item (see Google product taxonomy). */ + googleProductCategory?: string; + /** Global Trade Item Number (GTIN) of the item. */ + gtin?: string; + /** The REST id of the product. */ + id?: string; + /** + * False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the + * Unique Product Identifier Rules for all target countries except for Canada. + */ + identifierExists?: boolean; + /** URL of an image of the item. */ + imageLink?: string; + /** Number and amount of installments to pay for an item. Brazil only. */ + installment?: Installment; + /** Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price. */ + isBundle?: boolean; + /** Shared identifier for all variants of the same product. */ + itemGroupId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#product". */ + kind?: string; + /** URL directly linking to your item's page on your website. */ + link?: string; + /** Loyalty points that users receive after purchasing the item. Japan only. */ + loyaltyPoints?: LoyaltyPoints; + /** The material of which the item is made. */ + material?: string; + /** Maximal product handling time (in business days). */ + maxHandlingTime?: string; + /** Minimal product handling time (in business days). */ + minHandlingTime?: string; + /** Link to a mobile-optimized version of the landing page. */ + mobileLink?: string; + /** Manufacturer Part Number (MPN) of the item. */ + mpn?: string; + /** The number of identical products in a merchant-defined multipack. */ + multipack?: string; + /** + * An identifier of the item. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. + * Only valid unicode characters are accepted. See the products feed specification for details. + */ + offerId?: string; + /** Whether an item is available for purchase only online. */ + onlineOnly?: boolean; + /** The item's pattern (e.g. polka dots). */ + pattern?: string; + /** Price of the item. */ + price?: Price; + /** Your category of the item (formatted as in products feed specification). */ + productType?: string; + /** The unique ID of a promotion. */ + promotionIds?: string[]; + /** Advertised sale price of the item. */ + salePrice?: Price; + /** Date range during which the item is on sale (see products feed specification). */ + salePriceEffectiveDate?: string; + /** The quantity of the product that is reserved for sell-on-google ads. */ + sellOnGoogleQuantity?: string; + /** Shipping rules. */ + shipping?: ProductShipping[]; + /** Height of the item for shipping. */ + shippingHeight?: ProductShippingDimension; + /** The shipping label of the product, used to group product in account-level shipping rules. */ + shippingLabel?: string; + /** Length of the item for shipping. */ + shippingLength?: ProductShippingDimension; + /** Weight of the item for shipping. */ + shippingWeight?: ProductShippingWeight; + /** Width of the item for shipping. */ + shippingWidth?: ProductShippingDimension; + /** System in which the size is specified. Recommended for apparel items. */ + sizeSystem?: string; + /** The cut of the item. Recommended for apparel items. */ + sizeType?: string; + /** Size of the item. */ + sizes?: string[]; + /** The CLDR territory code for the item. */ + targetCountry?: string; + /** Tax information. */ + taxes?: ProductTax[]; + /** Title of the item. */ + title?: string; + /** The preference of the denominator of the unit price. */ + unitPricingBaseMeasure?: ProductUnitPricingBaseMeasure; + /** The measure and dimension of an item. */ + unitPricingMeasure?: ProductUnitPricingMeasure; + /** The read-only list of intended destinations which passed validation. */ + validatedDestinations?: string[]; + /** Read-only warnings. */ + warnings?: Error[]; + } + interface ProductAspect { + /** The name of the aspect. */ + aspectName?: string; + /** The name of the destination. Leave out to apply to all destinations. */ + destinationName?: string; + /** Whether the aspect is required, excluded or should be validated. */ + intention?: string; + } + interface ProductCustomAttribute { + /** The name of the attribute. Underscores will be replaced by spaces upon insertion. */ + name?: string; + /** The type of the attribute. */ + type?: string; + /** Free-form unit of the attribute. Unit can only be used for values of type INT or FLOAT. */ + unit?: string; + /** The value of the attribute. */ + value?: string; + } + interface ProductCustomGroup { + /** The sub-attributes. */ + attributes?: ProductCustomAttribute[]; + /** The name of the group. Underscores will be replaced by spaces upon insertion. */ + name?: string; + } + interface ProductDestination { + /** The name of the destination. */ + destinationName?: string; + /** Whether the destination is required, excluded or should be validated. */ + intention?: string; + } + interface ProductShipping { + /** The CLDR territory code of the country to which an item will ship. */ + country?: string; + /** The location where the shipping is applicable, represented by a location group name. */ + locationGroupName?: string; + /** The numeric id of a location that the shipping rate applies to as defined in the AdWords API. */ + locationId?: string; + /** + * The postal code range that the shipping rate applies to, represented by a postal code, a postal code prefix followed by a * wildcard, a range between + * two postal codes or two postal code prefixes of equal length. + */ + postalCode?: string; + /** Fixed shipping price, represented as a number. */ + price?: Price; + /** The geographic region to which a shipping rate applies. */ + region?: string; + /** A free-form description of the service class or delivery speed. */ + service?: string; + } + interface ProductShippingDimension { + /** + * The unit of value. + * + * Acceptable values are: + * - "cm" + * - "in" + */ + unit?: string; + /** The dimension of the product used to calculate the shipping cost of the item. */ + value?: number; + } + interface ProductShippingWeight { + /** The unit of value. */ + unit?: string; + /** The weight of the product used to calculate the shipping cost of the item. */ + value?: number; + } + interface ProductStatus { + /** Date on which the item has been created, in ISO 8601 format. */ + creationDate?: string; + /** A list of data quality issues associated with the product. */ + dataQualityIssues?: ProductStatusDataQualityIssue[]; + /** The intended destinations for the product. */ + destinationStatuses?: ProductStatusDestinationStatus[]; + /** Date on which the item expires in Google Shopping, in ISO 8601 format. */ + googleExpirationDate?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#productStatus". */ + kind?: string; + /** Date on which the item has been last updated, in ISO 8601 format. */ + lastUpdateDate?: string; + /** The link to the product. */ + link?: string; + /** Product data after applying all the join inputs. */ + product?: Product; + /** The id of the product for which status is reported. */ + productId?: string; + /** The title of the product. */ + title?: string; + } + interface ProductStatusDataQualityIssue { + /** A more detailed error string. */ + detail?: string; + /** The fetch status for landing_page_errors. */ + fetchStatus?: string; + /** The id of the data quality issue. */ + id?: string; + /** The attribute name that is relevant for the issue. */ + location?: string; + /** The severity of the data quality issue. */ + severity?: string; + /** The time stamp of the data quality issue. */ + timestamp?: string; + /** The value of that attribute that was found on the landing page */ + valueOnLandingPage?: string; + /** The value the attribute had at time of evaluation. */ + valueProvided?: string; + } + interface ProductStatusDestinationStatus { + /** The destination's approval status. */ + approvalStatus?: string; + /** The name of the destination */ + destination?: string; + /** Whether the destination is required, excluded, selected by default or should be validated. */ + intention?: string; + } + interface ProductTax { + /** The country within which the item is taxed, specified as a CLDR territory code. */ + country?: string; + /** The numeric id of a location that the tax rate applies to as defined in the AdWords API. */ + locationId?: string; + /** + * The postal code range that the tax rate applies to, represented by a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP codes or two + * ZIP code prefixes of equal length. Examples: 94114, 94*, 94002-95460, 94*-95*. + */ + postalCode?: string; + /** The percentage of tax rate that applies to the item price. */ + rate?: number; + /** The geographic region to which the tax rate applies. */ + region?: string; + /** Set to true if tax is charged on shipping. */ + taxShip?: boolean; + } + interface ProductUnitPricingBaseMeasure { + /** The unit of the denominator. */ + unit?: string; + /** The denominator of the unit price. */ + value?: string; + } + interface ProductUnitPricingMeasure { + /** The unit of the measure. */ + unit?: string; + /** The measure of an item. */ + value?: number; + } + interface ProductsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: ProductsCustomBatchRequestEntry[]; + } + interface ProductsCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** The product to insert. Only required if the method is insert. */ + product?: Product; + /** The ID of the product to get or delete. Only defined if the method is get or delete. */ + productId?: string; + } + interface ProductsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: ProductsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#productsCustomBatchResponse". */ + kind?: string; + } + interface ProductsCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#productsCustomBatchResponseEntry". */ + kind?: string; + /** The inserted product. Only defined if the method is insert and if the request was successful. */ + product?: Product; + } + interface ProductsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#productsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of products. */ + nextPageToken?: string; + resources?: Product[]; + } + interface ProductstatusesCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: ProductstatusesCustomBatchRequestEntry[]; + } + interface ProductstatusesCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + includeAttributes?: boolean; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** The ID of the product whose status to get. */ + productId?: string; + } + interface ProductstatusesCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: ProductstatusesCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#productstatusesCustomBatchResponse". */ + kind?: string; + } + interface ProductstatusesCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors, if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#productstatusesCustomBatchResponseEntry". */ + kind?: string; + /** The requested product status. Only defined if the request was successful. */ + productStatus?: ProductStatus; + } + interface ProductstatusesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#productstatusesListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of products statuses. */ + nextPageToken?: string; + resources?: ProductStatus[]; + } + interface RateGroup { + /** + * A list of shipping labels defining the products to which this rate group applies to. This is a disjunction: only one of the labels has to match for the + * rate group to apply. May only be empty for the last rate group of a service. Required. + */ + applicableShippingLabels?: string[]; + /** A list of carrier rates that can be referred to by mainTable or singleValue. */ + carrierRates?: CarrierRate[]; + /** A table defining the rate group, when singleValue is not expressive enough. Can only be set if singleValue is not set. */ + mainTable?: Table; + /** The value of the rate group (e.g. flat rate $10). Can only be set if mainTable and subtables are not set. */ + singleValue?: Value; + /** A list of subtables referred to by mainTable. Can only be set if mainTable is set. */ + subtables?: Table[]; + } + interface Row { + /** + * The list of cells that constitute the row. Must have the same length as columnHeaders for two-dimensional tables, a length of 1 for one-dimensional + * tables. Required. + */ + cells?: Value[]; + } + interface Service { + /** A boolean exposing the active status of the shipping service. Required. */ + active?: boolean; + /** The CLDR code of the currency to which this service applies. Must match that of the prices in rate groups. */ + currency?: string; + /** The CLDR territory code of the country to which the service applies. Required. */ + deliveryCountry?: string; + /** Time spent in various aspects from order to the delivery of the product. Required. */ + deliveryTime?: DeliveryTime; + /** + * Minimum order value for this service. If set, indicates that customers will have to spend at least this amount. All prices within a service must have + * the same currency. + */ + minimumOrderValue?: Price; + /** Free-form name of the service. Must be unique within target account. Required. */ + name?: string; + /** + * Shipping rate group definitions. Only the last one is allowed to have an empty applicableShippingLabels, which means "everything else". The other + * applicableShippingLabels must not overlap. + */ + rateGroups?: RateGroup[]; + } + interface ShippingSettings { + /** The ID of the account to which these account shipping settings belong. Ignored upon update, always present in get request responses. */ + accountId?: string; + /** A list of postal code groups that can be referred to in services. Optional. */ + postalCodeGroups?: PostalCodeGroup[]; + /** The target account's list of services. Optional. */ + services?: Service[]; + } + interface ShippingsettingsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: ShippingsettingsCustomBatchRequestEntry[]; + } + interface ShippingsettingsCustomBatchRequestEntry { + /** The ID of the account for which to get/update account shipping settings. */ + accountId?: string; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** The account shipping settings to update. Only defined if the method is update. */ + shippingSettings?: ShippingSettings; + } + interface ShippingsettingsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: ShippingsettingsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsCustomBatchResponse". */ + kind?: string; + } + interface ShippingsettingsCustomBatchResponseEntry { + /** The ID of the request entry to which this entry responds. */ + batchId?: number; + /** A list of errors defined if, and only if, the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsCustomBatchResponseEntry". */ + kind?: string; + /** The retrieved or updated account shipping settings. */ + shippingSettings?: ShippingSettings; + } + interface ShippingsettingsGetSupportedCarriersResponse { + /** A list of supported carriers. May be empty. */ + carriers?: CarriersCarrier[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsGetSupportedCarriersResponse". */ + kind?: string; + } + interface ShippingsettingsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of shipping settings. */ + nextPageToken?: string; + resources?: ShippingSettings[]; + } + interface Table { + /** Headers of the table's columns. Optional: if not set then the table has only one dimension. */ + columnHeaders?: Headers; + /** Name of the table. Required for subtables, ignored for the main table. */ + name?: string; + /** Headers of the table's rows. Required. */ + rowHeaders?: Headers; + /** The list of rows that constitute the table. Must have the same length as rowHeaders. Required. */ + rows?: Row[]; + } + interface TestOrder { + /** The details of the customer who placed the order. */ + customer?: TestOrderCustomer; + /** Identifies what kind of resource this is. Value: the fixed string "content#testOrder". */ + kind?: string; + /** Line items that are ordered. At least one line item must be provided. */ + lineItems?: TestOrderLineItem[]; + /** The details of the payment method. */ + paymentMethod?: TestOrderPaymentMethod; + /** Identifier of one of the predefined delivery addresses for the delivery. */ + predefinedDeliveryAddress?: string; + /** The details of the merchant provided promotions applied to the order. More details about the program are here. */ + promotions?: OrderPromotion[]; + /** The total cost of shipping for all items. */ + shippingCost?: Price; + /** The tax for the total shipping cost. */ + shippingCostTax?: Price; + /** The requested shipping option. */ + shippingOption?: string; + } + interface TestOrderCustomer { + /** Email address of the customer. */ + email?: string; + /** + * If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has + * already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. Optional. + */ + explicitMarketingPreference?: boolean; + /** Full name of the customer. */ + fullName?: string; + } + interface TestOrderLineItem { + /** Product data from the time of the order placement. */ + product?: TestOrderLineItemProduct; + /** Number of items ordered. */ + quantityOrdered?: number; + /** Details of the return policy for the line item. */ + returnInfo?: OrderLineItemReturnInfo; + /** Details of the requested shipping for the line item. */ + shippingDetails?: OrderLineItemShippingDetails; + /** Unit tax for the line item. */ + unitTax?: Price; + } + interface TestOrderLineItemProduct { + /** Brand of the item. */ + brand?: string; + /** The item's channel. */ + channel?: string; + /** Condition or state of the item. */ + condition?: string; + /** The two-letter ISO 639-1 language code for the item. */ + contentLanguage?: string; + /** Global Trade Item Number (GTIN) of the item. Optional. */ + gtin?: string; + /** URL of an image of the item. */ + imageLink?: string; + /** Shared identifier for all variants of the same product. Optional. */ + itemGroupId?: string; + /** Manufacturer Part Number (MPN) of the item. Optional. */ + mpn?: string; + /** An identifier of the item. */ + offerId?: string; + /** The price for the product. */ + price?: Price; + /** The CLDR territory code of the target country of the product. */ + targetCountry?: string; + /** The title of the product. */ + title?: string; + /** Variant attributes for the item. Optional. */ + variantAttributes?: OrderLineItemProductVariantAttribute[]; + } + interface TestOrderPaymentMethod { + /** The card expiration month (January = 1, February = 2 etc.). */ + expirationMonth?: number; + /** The card expiration year (4-digit, e.g. 2015). */ + expirationYear?: number; + /** The last four digits of the card number. */ + lastFourDigits?: string; + /** The billing address. */ + predefinedBillingAddress?: string; + /** The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder. */ + type?: string; + } + interface Value { + /** The name of a carrier rate referring to a carrier rate defined in the same rate group. Can only be set if all other fields are not set. */ + carrierRateName?: string; + /** A flat rate. Can only be set if all other fields are not set. */ + flatRate?: Price; + /** If true, then the product can't ship. Must be true when set, can only be set if all other fields are not set. */ + noShipping?: boolean; + /** A percentage of the price represented as a number in decimal notation (e.g., "5.4"). Can only be set if all other fields are not set. */ + pricePercentage?: string; + /** The name of a subtable. Can only be set in table cells (i.e., not for single values), and only if all other fields are not set. */ + subtableName?: string; + } + interface Weight { + /** The weight unit. */ + unit?: string; + /** The weight represented as a number. */ + value?: string; + } + interface AccountsResource { + /** Returns information about the authenticated user. */ + authinfo(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + claimwebsite(request: { + /** The ID of the account whose website is claimed. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Only available to selected merchants. When set to True, this flag removes any existing claim on the requested website by another account and replaces + * it with a claim from this account. + */ + overwrite?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + delete(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to delete sub-accounts with products. The default value is false. */ + force?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + */ + patch(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + update(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountstatusesResource { + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of account statuses to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccounttaxResource { + /** Retrieves and updates tax settings of multiple accounts in a single request. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account for which to get/update account tax settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of tax settings to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + patch(request: { + /** The ID of the account for which to get/update account tax settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + update(request: { + /** The ID of the account for which to get/update account tax settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DatafeedsResource { + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of products to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports + * patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. */ + update(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DatafeedstatusesResource { + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is + * required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + */ + country?: string; + datafeedId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is + * required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + */ + language?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of products to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InventoryResource { + /** + * Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. + * This method can only be called for non-multi-client accounts. + */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This + * method can only be called for non-multi-client accounts. + */ + set(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product for which to update price and availability. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The code of the store for which to update price and availability. Use online to update price and availability of an online product. */ + storeCode: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OrdersResource { + /** Marks an order as acknowledged. This method can only be called for non-multi-client accounts. */ + acknowledge(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. */ + advancetestorder(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the test order to modify. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. */ + cancel(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order to cancel. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. */ + cancellineitem(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. */ + createtestorder(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. */ + getbymerchantorderid(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** The merchant order id to be looked for. */ + merchantOrderId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for + * non-multi-client accounts. + */ + gettestordertemplate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The name of the template to retrieve. */ + templateName: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** + * Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that + * have not been acknowledged. + * We recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned. + */ + acknowledged?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 + * orders per page. + * Known issue: All List calls will return all Orders without limit regardless of the value of this field. + */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement + * date. "placedDate desc" stands for listing orders by placement date, from oldest to most recent. "placedDate asc" stands for listing orders by + * placement date, from most recent to oldest. In future releases we'll support other sorting criteria. + */ + orderBy?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Obtains orders placed before this date (exclusively), in ISO 8601 format. */ + placedDateEnd?: string; + /** Obtains orders placed after this date (inclusively), in ISO 8601 format. */ + placedDateStart?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active + * is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, + * returned, and canceled. + */ + statuses?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. */ + refund(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order to refund. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a line item. This method can only be called for non-multi-client accounts. */ + returnlineitem(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. */ + shiplineitems(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. */ + updatemerchantorderid(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. */ + updateshipment(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this + * method updates that entry. This method can only be called for non-multi-client accounts. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). */ + includeInvalidInsertedItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of products to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductstatusesResource { + /** Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include full product data in the results of this request. The default value is false. */ + includeAttributes?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include full product data in the result of this get request. The default value is false. */ + includeAttributes?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include full product data in the results of the list request. The default value is false. */ + includeAttributes?: boolean; + /** Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). */ + includeInvalidInsertedItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of product statuses to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ShippingsettingsResource { + /** Retrieves and updates the shipping settings of multiple accounts in a single request. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account for which to get/update shipping settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves supported carriers and carrier services for an account. */ + getsupportedcarriers(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the account for which to retrieve the supported carriers. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of shipping settings to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + patch(request: { + /** The ID of the account for which to get/update shipping settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + update(request: { + /** The ID of the account for which to get/update shipping settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.content/readme.md b/types/gapi.client.content/readme.md new file mode 100644 index 0000000000..043429370a --- /dev/null +++ b/types/gapi.client.content/readme.md @@ -0,0 +1,344 @@ +# TypeScript typings for Content API for Shopping v2 +Manages product items, inventory, and Merchant Center accounts for Google Shopping. +For detailed description please check [documentation](https://developers.google.com/shopping-content). + +## Installing + +Install typings for Content API for Shopping: +``` +npm install @types/gapi.client.content@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('content', 'v2', () => { + // now we can use gapi.client.content + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your product listings and accounts for Google Shopping + 'https://www.googleapis.com/auth/content', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Content API for Shopping resources: + +```typescript + +/* +Returns information about the authenticated user. +*/ +await gapi.client.accounts.authinfo({ }); + +/* +Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounts.claimwebsite({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. +*/ +await gapi.client.accounts.custombatch({ }); + +/* +Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounts.delete({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounts.insert({ merchantId: "merchantId", }); + +/* +Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounts.list({ merchantId: "merchantId", }); + +/* +Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +*/ +await gapi.client.accounts.patch({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounts.update({ accountId: "accountId", merchantId: "merchantId", }); + +/* +undefined +*/ +await gapi.client.accountstatuses.custombatch({ }); + +/* +Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accountstatuses.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accountstatuses.list({ merchantId: "merchantId", }); + +/* +Retrieves and updates tax settings of multiple accounts in a single request. +*/ +await gapi.client.accounttax.custombatch({ }); + +/* +Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounttax.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounttax.list({ merchantId: "merchantId", }); + +/* +Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +*/ +await gapi.client.accounttax.patch({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounttax.update({ accountId: "accountId", merchantId: "merchantId", }); + +/* +undefined +*/ +await gapi.client.datafeeds.custombatch({ }); + +/* +Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.delete({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.get({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.insert({ merchantId: "merchantId", }); + +/* +Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.list({ merchantId: "merchantId", }); + +/* +Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics. +*/ +await gapi.client.datafeeds.patch({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.update({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +undefined +*/ +await gapi.client.datafeedstatuses.custombatch({ }); + +/* +Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeedstatuses.get({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeedstatuses.list({ merchantId: "merchantId", }); + +/* +Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.inventory.custombatch({ }); + +/* +Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.inventory.set({ merchantId: "merchantId", productId: "productId", storeCode: "storeCode", }); + +/* +Marks an order as acknowledged. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.acknowledge({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.advancetestorder({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.cancel({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.cancellineitem({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.createtestorder({ merchantId: "merchantId", }); + +/* +Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.custombatch({ }); + +/* +Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.get({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.getbymerchantorderid({ merchantId: "merchantId", merchantOrderId: "merchantOrderId", }); + +/* +Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.gettestordertemplate({ merchantId: "merchantId", templateName: "templateName", }); + +/* +Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.list({ merchantId: "merchantId", }); + +/* +Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.refund({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Returns a line item. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.returnlineitem({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.shiplineitems({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.updatemerchantorderid({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.updateshipment({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.custombatch({ }); + +/* +Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.delete({ merchantId: "merchantId", productId: "productId", }); + +/* +Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.get({ merchantId: "merchantId", productId: "productId", }); + +/* +Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.insert({ merchantId: "merchantId", }); + +/* +Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.list({ merchantId: "merchantId", }); + +/* +Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.productstatuses.custombatch({ }); + +/* +Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.productstatuses.get({ merchantId: "merchantId", productId: "productId", }); + +/* +Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.productstatuses.list({ merchantId: "merchantId", }); + +/* +Retrieves and updates the shipping settings of multiple accounts in a single request. +*/ +await gapi.client.shippingsettings.custombatch({ }); + +/* +Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.shippingsettings.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Retrieves supported carriers and carrier services for an account. +*/ +await gapi.client.shippingsettings.getsupportedcarriers({ merchantId: "merchantId", }); + +/* +Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.shippingsettings.list({ merchantId: "merchantId", }); + +/* +Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +*/ +await gapi.client.shippingsettings.patch({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.shippingsettings.update({ accountId: "accountId", merchantId: "merchantId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.content/tsconfig.json b/types/gapi.client.content/tsconfig.json new file mode 100644 index 0000000000..566c98a224 --- /dev/null +++ b/types/gapi.client.content/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.content-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.content/tslint.json b/types/gapi.client.content/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.content/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.customsearch/gapi.client.customsearch-tests.ts b/types/gapi.client.customsearch/gapi.client.customsearch-tests.ts new file mode 100644 index 0000000000..6fc523681f --- /dev/null +++ b/types/gapi.client.customsearch/gapi.client.customsearch-tests.ts @@ -0,0 +1,50 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('customsearch', 'v1', () => { + /** now we can use gapi.client.customsearch */ + + run(); + }); + + async function run() { + /** Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. */ + await gapi.client.cse.list({ + c2coff: "c2coff", + cr: "cr", + cx: "cx", + dateRestrict: "dateRestrict", + exactTerms: "exactTerms", + excludeTerms: "excludeTerms", + fileType: "fileType", + filter: "filter", + gl: "gl", + googlehost: "googlehost", + highRange: "highRange", + hl: "hl", + hq: "hq", + imgColorType: "imgColorType", + imgDominantColor: "imgDominantColor", + imgSize: "imgSize", + imgType: "imgType", + linkSite: "linkSite", + lowRange: "lowRange", + lr: "lr", + num: 21, + orTerms: "orTerms", + q: "q", + relatedSite: "relatedSite", + rights: "rights", + safe: "safe", + searchType: "searchType", + siteSearch: "siteSearch", + siteSearchFilter: "siteSearchFilter", + sort: "sort", + start: 31, + }); + } +}); diff --git a/types/gapi.client.customsearch/index.d.ts b/types/gapi.client.customsearch/index.d.ts new file mode 100644 index 0000000000..1722767845 --- /dev/null +++ b/types/gapi.client.customsearch/index.d.ts @@ -0,0 +1,226 @@ +// Type definitions for Google CustomSearch API v1 1.0 +// Project: https://developers.google.com/custom-search/v1/using_rest +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/customsearch/v1/rest + +/// + +declare namespace gapi.client { + /** Load CustomSearch API v1 */ + function load(name: "customsearch", version: "v1"): PromiseLike; + function load(name: "customsearch", version: "v1", callback: () => any): void; + + const cse: customsearch.CseResource; + + namespace customsearch { + interface Context { + facets?: Array>; + title?: string; + } + interface Promotion { + bodyLines?: Array<{ + htmlTitle?: string; + link?: string; + title?: string; + url?: string; + }>; + displayLink?: string; + htmlTitle?: string; + image?: { + height?: number; + source?: string; + width?: number; + }; + link?: string; + title?: string; + } + interface Query { + count?: number; + cr?: string; + cx?: string; + dateRestrict?: string; + disableCnTwTranslation?: string; + exactTerms?: string; + excludeTerms?: string; + fileType?: string; + filter?: string; + gl?: string; + googleHost?: string; + highRange?: string; + hl?: string; + hq?: string; + imgColorType?: string; + imgDominantColor?: string; + imgSize?: string; + imgType?: string; + inputEncoding?: string; + language?: string; + linkSite?: string; + lowRange?: string; + orTerms?: string; + outputEncoding?: string; + relatedSite?: string; + rights?: string; + safe?: string; + searchTerms?: string; + searchType?: string; + siteSearch?: string; + siteSearchFilter?: string; + sort?: string; + startIndex?: number; + startPage?: number; + title?: string; + totalResults?: string; + } + interface Result { + cacheId?: string; + displayLink?: string; + fileFormat?: string; + formattedUrl?: string; + htmlFormattedUrl?: string; + htmlSnippet?: string; + htmlTitle?: string; + image?: { + byteSize?: number; + contextLink?: string; + height?: number; + thumbnailHeight?: number; + thumbnailLink?: string; + thumbnailWidth?: number; + width?: number; + }; + kind?: string; + labels?: Array<{ + displayName?: string; + label_with_op?: string; + name?: string; + }>; + link?: string; + mime?: string; + pagemap?: Record>>; + snippet?: string; + title?: string; + } + interface Search { + context?: Context; + items?: Result[]; + kind?: string; + promotions?: Promotion[]; + queries?: Record; + searchInformation?: { + formattedSearchTime?: string; + formattedTotalResults?: string; + searchTime?: number; + totalResults?: string; + }; + spelling?: { + correctedQuery?: string; + htmlCorrectedQuery?: string; + }; + url?: { + template?: string; + type?: string; + }; + } + interface CseResource { + /** Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Turns off the translation between zh-CN and zh-TW. */ + c2coff?: string; + /** Country restrict(s). */ + cr?: string; + /** The custom search engine ID to scope this search query */ + cx?: string; + /** Specifies all search results are from a time period */ + dateRestrict?: string; + /** Identifies a phrase that all documents in the search results must contain */ + exactTerms?: string; + /** Identifies a word or phrase that should not appear in any documents in the search results */ + excludeTerms?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... */ + fileType?: string; + /** Controls turning on or off the duplicate content filter. */ + filter?: string; + /** Geolocation of end user. */ + gl?: string; + /** The local Google domain to use to perform the search. */ + googlehost?: string; + /** Creates a range in form as_nlo value..as_nhi value and attempts to append it to query */ + highRange?: string; + /** Sets the user interface language. */ + hl?: string; + /** Appends the extra query terms to the query. */ + hq?: string; + /** Returns black and white, grayscale, or color images: mono, gray, and color. */ + imgColorType?: string; + /** Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown. */ + imgDominantColor?: string; + /** Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. */ + imgSize?: string; + /** Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. */ + imgType?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Specifies that all search results should contain a link to a particular URL */ + linkSite?: string; + /** Creates a range in form as_nlo value..as_nhi value and attempts to append it to query */ + lowRange?: string; + /** The language restriction for the search results */ + lr?: string; + /** Number of search results to return */ + num?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional + * search terms + */ + orTerms?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query */ + q: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Specifies that all search results should be pages that are related to the specified URL */ + relatedSite?: string; + /** + * Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of + * these. + */ + rights?: string; + /** Search safety level */ + safe?: string; + /** Specifies the search type: image. */ + searchType?: string; + /** Specifies all search results should be pages from a given site */ + siteSearch?: string; + /** Controls whether to include or exclude results from the site named in the as_sitesearch parameter */ + siteSearchFilter?: string; + /** The sort expression to apply to the results */ + sort?: string; + /** The index of the first result to return */ + start?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.customsearch/readme.md b/types/gapi.client.customsearch/readme.md new file mode 100644 index 0000000000..836af575ac --- /dev/null +++ b/types/gapi.client.customsearch/readme.md @@ -0,0 +1,40 @@ +# TypeScript typings for CustomSearch API v1 +Searches over a website or collection of websites +For detailed description please check [documentation](https://developers.google.com/custom-search/v1/using_rest). + +## Installing + +Install typings for CustomSearch API: +``` +npm install @types/gapi.client.customsearch@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('customsearch', 'v1', () => { + // now we can use gapi.client.customsearch + // ... +}); +``` + + + +After that you can use CustomSearch API resources: + +```typescript + +/* +Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. +*/ +await gapi.client.cse.list({ q: "q", }); +``` \ No newline at end of file diff --git a/types/gapi.client.customsearch/tsconfig.json b/types/gapi.client.customsearch/tsconfig.json new file mode 100644 index 0000000000..9b5c4f447d --- /dev/null +++ b/types/gapi.client.customsearch/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.customsearch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.customsearch/tslint.json b/types/gapi.client.customsearch/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.customsearch/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dataflow/gapi.client.dataflow-tests.ts b/types/gapi.client.dataflow/gapi.client.dataflow-tests.ts new file mode 100644 index 0000000000..8223d7e49f --- /dev/null +++ b/types/gapi.client.dataflow/gapi.client.dataflow-tests.ts @@ -0,0 +1,42 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dataflow', 'v1b3', () => { + /** now we can use gapi.client.dataflow */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute', + /** View your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute.readonly', + /** View your email address */ + 'https://www.googleapis.com/auth/userinfo.email', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Send a worker_message to the service. */ + await gapi.client.projects.workerMessages({ + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.dataflow/index.d.ts b/types/gapi.client.dataflow/index.d.ts new file mode 100644 index 0000000000..6c04dad9ea --- /dev/null +++ b/types/gapi.client.dataflow/index.d.ts @@ -0,0 +1,3245 @@ +// Type definitions for Google Google Dataflow API v1b3 1.0 +// Project: https://cloud.google.com/dataflow +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://dataflow.googleapis.com/$discovery/rest?version=v1b3 + +/// + +declare namespace gapi.client { + /** Load Google Dataflow API v1b3 */ + function load(name: "dataflow", version: "v1b3"): PromiseLike; + function load(name: "dataflow", version: "v1b3", callback: () => any): void; + + const projects: dataflow.ProjectsResource; + + namespace dataflow { + interface ApproximateProgress { + /** Obsolete. */ + percentComplete?: number; + /** Obsolete. */ + position?: Position; + /** Obsolete. */ + remainingTime?: string; + } + interface ApproximateReportedProgress { + /** + * Total amount of parallelism in the portion of input of this task that has + * already been consumed and is no longer active. In the first two examples + * above (see remaining_parallelism), the value should be 29 or 2 + * respectively. The sum of remaining_parallelism and consumed_parallelism + * should equal the total amount of parallelism in this work item. If + * specified, must be finite. + */ + consumedParallelism?: ReportedParallelism; + /** + * Completion as fraction of the input consumed, from 0.0 (beginning, nothing + * consumed), to 1.0 (end of the input, entire input consumed). + */ + fractionConsumed?: number; + /** A Position within the work to represent a progress. */ + position?: Position; + /** + * Total amount of parallelism in the input of this task that remains, + * (i.e. can be delegated to this task and any new tasks via dynamic + * splitting). Always at least 1 for non-finished work items and 0 for + * finished. + * + * "Amount of parallelism" refers to how many non-empty parts of the input + * can be read in parallel. This does not necessarily equal number + * of records. An input that can be read in parallel down to the + * individual records is called "perfectly splittable". + * An example of non-perfectly parallelizable input is a block-compressed + * file format where a block of records has to be read as a whole, + * but different blocks can be read in parallel. + * + * Examples: + * * If we are processing record #30 (starting at 1) out of 50 in a perfectly + * splittable 50-record input, this value should be 21 (20 remaining + 1 + * current). + * * If we are reading through block 3 in a block-compressed file consisting + * of 5 blocks, this value should be 3 (since blocks 4 and 5 can be + * processed in parallel by new tasks via dynamic splitting and the current + * task remains processing block 3). + * * If we are reading through the last block in a block-compressed file, + * or reading or processing the last record in a perfectly splittable + * input, this value should be 1, because apart from the current task, no + * additional remainder can be split off. + */ + remainingParallelism?: ReportedParallelism; + } + interface ApproximateSplitRequest { + /** + * A fraction at which to split the work item, from 0.0 (beginning of the + * input) to 1.0 (end of the input). + */ + fractionConsumed?: number; + /** A Position at which to split the work item. */ + position?: Position; + } + interface AutoscalingEvent { + /** The current number of workers the job has. */ + currentNumWorkers?: string; + /** + * A message describing why the system decided to adjust the current + * number of workers, why it failed, or why the system decided to + * not make any changes to the number of workers. + */ + description?: StructuredMessage; + /** The type of autoscaling event to report. */ + eventType?: string; + /** The target number of workers the worker pool wants to resize to use. */ + targetNumWorkers?: string; + /** + * The time this event was emitted to indicate a new target or current + * num_workers value. + */ + time?: string; + } + interface AutoscalingSettings { + /** The algorithm to use for autoscaling. */ + algorithm?: string; + /** The maximum number of workers to cap scaling at. */ + maxNumWorkers?: number; + } + interface CPUTime { + /** + * Average CPU utilization rate (% non-idle cpu / second) since previous + * sample. + */ + rate?: number; + /** Timestamp of the measurement. */ + timestamp?: string; + /** + * Total active CPU time across all cores (ie., non-idle) in milliseconds + * since start-up. + */ + totalMs?: string; + } + interface ComponentSource { + /** Dataflow service generated name for this source. */ + name?: string; + /** + * User name for the original user transform or collection with which this + * source is most closely associated. + */ + originalTransformOrCollection?: string; + /** Human-readable name for this transform; may be user or system generated. */ + userName?: string; + } + interface ComponentTransform { + /** Dataflow service generated name for this source. */ + name?: string; + /** + * User name for the original user transform with which this transform is + * most closely associated. + */ + originalTransform?: string; + /** Human-readable name for this transform; may be user or system generated. */ + userName?: string; + } + interface ComputationTopology { + /** The ID of the computation. */ + computationId?: string; + /** The inputs to the computation. */ + inputs?: StreamLocation[]; + /** The key ranges processed by the computation. */ + keyRanges?: KeyRangeLocation[]; + /** The outputs from the computation. */ + outputs?: StreamLocation[]; + /** The state family values. */ + stateFamilies?: StateFamilyConfig[]; + /** The system stage name. */ + systemStageName?: string; + } + interface ConcatPosition { + /** Index of the inner source. */ + index?: number; + /** Position within the inner source. */ + position?: Position; + } + interface CounterMetadata { + /** Human-readable description of the counter semantics. */ + description?: string; + /** Counter aggregation kind. */ + kind?: string; + /** A string referring to the unit type. */ + otherUnits?: string; + /** System defined Units, see above enum. */ + standardUnits?: string; + } + interface CounterStructuredName { + /** Name of the optimized step being executed by the workers. */ + componentStepName?: string; + /** Name of the stage. An execution step contains multiple component steps. */ + executionStepName?: string; + /** + * Counter name. Not necessarily globally-unique, but unique within the + * context of the other fields. + * Required. + */ + name?: string; + /** One of the standard Origins defined above. */ + origin?: string; + /** A string containing a more specific namespace of the counter's origin. */ + originNamespace?: string; + /** The GroupByKey step name from the original graph. */ + originalShuffleStepName?: string; + /** + * System generated name of the original step in the user's graph, before + * optimization. + */ + originalStepName?: string; + /** Portion of this counter, either key or value. */ + portion?: string; + /** + * ID of a side input being read from/written to. Side inputs are identified + * by a pair of (reader, input_index). The reader is usually equal to the + * original name, but it may be different, if a ParDo emits it's Iterator / + * Map side input object. + */ + sideInput?: SideInputId; + /** ID of a particular worker. */ + workerId?: string; + } + interface CounterStructuredNameAndMetadata { + /** Metadata associated with a counter */ + metadata?: CounterMetadata; + /** Structured name of the counter. */ + name?: CounterStructuredName; + } + interface CounterUpdate { + /** Boolean value for And, Or. */ + boolean?: boolean; + /** + * True if this counter is reported as the total cumulative aggregate + * value accumulated since the worker started working on this WorkItem. + * By default this is false, indicating that this counter is reported + * as a delta. + */ + cumulative?: boolean; + /** Distribution data */ + distribution?: DistributionUpdate; + /** Floating point value for Sum, Max, Min. */ + floatingPoint?: number; + /** List of floating point numbers, for Set. */ + floatingPointList?: FloatingPointList; + /** Floating point mean aggregation value for Mean. */ + floatingPointMean?: FloatingPointMean; + /** Integer value for Sum, Max, Min. */ + integer?: SplitInt64; + /** List of integers, for Set. */ + integerList?: IntegerList; + /** Integer mean aggregation value for Mean. */ + integerMean?: IntegerMean; + /** Value for internally-defined counters used by the Dataflow service. */ + internal?: any; + /** Counter name and aggregation type. */ + nameAndKind?: NameAndKind; + /** + * The service-generated short identifier for this counter. + * The short_id -> (name, metadata) mapping is constant for the lifetime of + * a job. + */ + shortId?: string; + /** List of strings, for Set. */ + stringList?: StringList; + /** Counter structured name and metadata. */ + structuredNameAndMetadata?: CounterStructuredNameAndMetadata; + } + interface CreateJobFromTemplateRequest { + /** The runtime environment for the job. */ + environment?: RuntimeEnvironment; + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath?: string; + /** Required. The job name to use for the created job. */ + jobName?: string; + /** The location to which to direct the request. */ + location?: string; + /** The runtime parameters to pass to the job. */ + parameters?: Record; + } + interface CustomSourceLocation { + /** Whether this source is stateful. */ + stateful?: boolean; + } + interface DataDiskAssignment { + /** + * Mounted data disks. The order is important a data disk's 0-based index in + * this list defines which persistent directory the disk is mounted to, for + * example the list of { "myproject-1014-104817-4c2-harness-0-disk-0" }, + * { "myproject-1014-104817-4c2-harness-0-disk-1" }. + */ + dataDisks?: string[]; + /** + * VM instance name the data disks mounted to, for example + * "myproject-1014-104817-4c2-harness-0". + */ + vmInstance?: string; + } + interface DerivedSource { + /** What source to base the produced source on (if any). */ + derivationMode?: string; + /** Specification of the source. */ + source?: Source; + } + interface Disk { + /** + * Disk storage type, as defined by Google Compute Engine. This + * must be a disk type appropriate to the project and zone in which + * the workers will run. If unknown or unspecified, the service + * will attempt to choose a reasonable default. + * + * For example, the standard persistent disk type is a resource name + * typically ending in "pd-standard". If SSD persistent disks are + * available, the resource name typically ends with "pd-ssd". The + * actual valid values are defined the Google Compute Engine API, + * not by the Cloud Dataflow API; consult the Google Compute Engine + * documentation for more information about determining the set of + * available disk types for a particular project and zone. + * + * Google Compute Engine Disk types are local to a particular + * project in a particular zone, and so the resource name will + * typically look something like this: + * + * compute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard + */ + diskType?: string; + /** Directory in a VM where disk is mounted. */ + mountPoint?: string; + /** + * Size of disk in GB. If zero or unspecified, the service will + * attempt to choose a reasonable default. + */ + sizeGb?: number; + } + interface DisplayData { + /** Contains value if the data is of a boolean type. */ + boolValue?: boolean; + /** Contains value if the data is of duration type. */ + durationValue?: string; + /** Contains value if the data is of float type. */ + floatValue?: number; + /** Contains value if the data is of int64 type. */ + int64Value?: string; + /** Contains value if the data is of java class type. */ + javaClassValue?: string; + /** + * The key identifying the display data. + * This is intended to be used as a label for the display data + * when viewed in a dax monitoring system. + */ + key?: string; + /** An optional label to display in a dax UI for the element. */ + label?: string; + /** + * The namespace for the key. This is usually a class name or programming + * language namespace (i.e. python module) which defines the display data. + * This allows a dax monitoring system to specially handle the data + * and perform custom rendering. + */ + namespace?: string; + /** + * A possible additional shorter value to display. + * For example a java_class_name_value of com.mypackage.MyDoFn + * will be stored with MyDoFn as the short_str_value and + * com.mypackage.MyDoFn as the java_class_name value. + * short_str_value can be displayed and java_class_name_value + * will be displayed as a tooltip. + */ + shortStrValue?: string; + /** Contains value if the data is of string type. */ + strValue?: string; + /** Contains value if the data is of timestamp type. */ + timestampValue?: string; + /** An optional full URL. */ + url?: string; + } + interface DistributionUpdate { + /** The count of the number of elements present in the distribution. */ + count?: SplitInt64; + /** (Optional) Histogram of value counts for the distribution. */ + histogram?: Histogram; + /** The maximum value present in the distribution. */ + max?: SplitInt64; + /** The minimum value present in the distribution. */ + min?: SplitInt64; + /** + * Use an int64 since we'd prefer the added precision. If overflow is a common + * problem we can detect it and use an additional int64 or a double. + */ + sum?: SplitInt64; + /** Use a double since the sum of squares is likely to overflow int64. */ + sumOfSquares?: number; + } + interface DynamicSourceSplit { + /** + * Primary part (continued to be processed by worker). + * Specified relative to the previously-current source. + * Becomes current. + */ + primary?: DerivedSource; + /** + * Residual part (returned to the pool of work). + * Specified relative to the previously-current source. + */ + residual?: DerivedSource; + } + interface Environment { + /** + * The type of cluster manager API to use. If unknown or + * unspecified, the service will attempt to choose a reasonable + * default. This should be in the form of the API service name, + * e.g. "compute.googleapis.com". + */ + clusterManagerApiService?: string; + /** + * The dataset for the current project where various workflow + * related tables are stored. + * + * The supported resource type is: + * + * Google BigQuery: + * bigquery.googleapis.com/{dataset} + */ + dataset?: string; + /** The list of experiments to enable. */ + experiments?: string[]; + /** Experimental settings. */ + internalExperiments?: Record; + /** + * The Cloud Dataflow SDK pipeline options specified by the user. These + * options are passed through the service and are used to recreate the + * SDK pipeline options on the worker in a language agnostic and platform + * independent way. + */ + sdkPipelineOptions?: Record; + /** Identity to run virtual machines as. Defaults to the default account. */ + serviceAccountEmail?: string; + /** + * The prefix of the resources the system should use for temporary + * storage. The system will append the suffix "/temp-{JOBNAME} to + * this resource prefix, where {JOBNAME} is the value of the + * job_name field. The resulting bucket and object prefix is used + * as the prefix of the resources used to store temporary data + * needed during the job execution. NOTE: This will override the + * value in taskrunner_settings. + * The supported resource type is: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix?: string; + /** A description of the process that generated the request. */ + userAgent?: Record; + /** + * A structure describing which components and their versions of the service + * are required in order to run the job. + */ + version?: Record; + /** + * The worker pools. At least one "harness" worker pool must be + * specified in order for the job to have workers. + */ + workerPools?: WorkerPool[]; + } + interface ExecutionStageState { + /** The time at which the stage transitioned to this state. */ + currentStateTime?: string; + /** The name of the execution stage. */ + executionStageName?: string; + /** Executions stage states allow the same set of values as JobState. */ + executionStageState?: string; + } + interface ExecutionStageSummary { + /** Collections produced and consumed by component transforms of this stage. */ + componentSource?: ComponentSource[]; + /** Transforms that comprise this execution stage. */ + componentTransform?: ComponentTransform[]; + /** Dataflow service generated id for this stage. */ + id?: string; + /** Input sources for this stage. */ + inputSource?: StageSource[]; + /** Type of tranform this stage is executing. */ + kind?: string; + /** Dataflow service generated name for this stage. */ + name?: string; + /** Output sources for this stage. */ + outputSource?: StageSource[]; + } + interface FailedLocation { + /** The name of the failed location. */ + name?: string; + } + interface FlattenInstruction { + /** Describes the inputs to the flatten instruction. */ + inputs?: InstructionInput[]; + } + interface FloatingPointList { + /** Elements of the list. */ + elements?: number[]; + } + interface FloatingPointMean { + /** The number of values being aggregated. */ + count?: SplitInt64; + /** The sum of all values being aggregated. */ + sum?: number; + } + interface GetDebugConfigRequest { + /** + * The internal component id for which debug configuration is + * requested. + */ + componentId?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** The worker id, i.e., VM hostname. */ + workerId?: string; + } + interface GetDebugConfigResponse { + /** The encoded debug configuration for the requested component. */ + config?: string; + } + interface GetTemplateResponse { + /** + * The template metadata describing the template name, available + * parameters, etc. + */ + metadata?: TemplateMetadata; + /** + * The status of the get template request. Any problems with the + * request will be indicated in the error_details. + */ + status?: Status; + } + interface Histogram { + /** + * Counts of values in each bucket. For efficiency, prefix and trailing + * buckets with count = 0 are elided. Buckets can store the full range of + * values of an unsigned long, with ULLONG_MAX falling into the 59th bucket + * with range [1e19, 2e19). + */ + bucketCounts?: string[]; + /** + * Starting index of first stored bucket. The non-inclusive upper-bound of + * the ith bucket is given by: + * pow(10,(i-first_bucket_offset)/3) * (1,2,5)[(i-first_bucket_offset)%3] + */ + firstBucketOffset?: number; + } + interface InstructionInput { + /** The output index (origin zero) within the producer. */ + outputNum?: number; + /** + * The index (origin zero) of the parallel instruction that produces + * the output to be consumed by this input. This index is relative + * to the list of instructions in this input's instruction's + * containing MapTask. + */ + producerInstructionIndex?: number; + } + interface InstructionOutput { + /** The codec to use to encode data being written via this output. */ + codec?: Record; + /** The user-provided name of this output. */ + name?: string; + /** + * For system-generated byte and mean byte metrics, certain instructions + * should only report the key size. + */ + onlyCountKeyBytes?: boolean; + /** + * For system-generated byte and mean byte metrics, certain instructions + * should only report the value size. + */ + onlyCountValueBytes?: boolean; + /** + * System-defined name for this output in the original workflow graph. + * Outputs that do not contribute to an original instruction do not set this. + */ + originalName?: string; + /** + * System-defined name of this output. + * Unique across the workflow. + */ + systemName?: string; + } + interface IntegerList { + /** Elements of the list. */ + elements?: SplitInt64[]; + } + interface IntegerMean { + /** The number of values being aggregated. */ + count?: SplitInt64; + /** The sum of all values being aggregated. */ + sum?: SplitInt64; + } + interface Job { + /** + * The client's unique identifier of the job, re-used across retried attempts. + * If this field is set, the service will ensure its uniqueness. + * The request to create a job will fail if the service has knowledge of a + * previously submitted job with the same client's ID and job name. + * The caller may use this field to ensure idempotence of job + * creation across retried attempts to create a job. + * By default, the field is empty and, in that case, the service ignores it. + */ + clientRequestId?: string; + /** + * The timestamp when the job was initially created. Immutable and set by the + * Cloud Dataflow service. + */ + createTime?: string; + /** + * The current state of the job. + * + * Jobs are created in the `JOB_STATE_STOPPED` state unless otherwise + * specified. + * + * A job in the `JOB_STATE_RUNNING` state may asynchronously enter a + * terminal state. After a job has reached a terminal state, no + * further state updates may be made. + * + * This field may be mutated by the Cloud Dataflow service; + * callers cannot mutate it. + */ + currentState?: string; + /** The timestamp associated with the current state. */ + currentStateTime?: string; + /** The environment for the job. */ + environment?: Environment; + /** Deprecated. */ + executionInfo?: JobExecutionInfo; + /** + * The unique ID of this job. + * + * This field is set by the Cloud Dataflow service when the Job is + * created, and is immutable for the life of the job. + */ + id?: string; + /** + * User-defined labels for this job. + * + * The labels map can contain no more than 64 entries. Entries of the labels + * map are UTF8 strings that comply with the following restrictions: + * + * * Keys must conform to regexp: \p{Ll}\p{Lo}{0,62} + * * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + * * Both keys and values are additionally constrained to be <= 128 bytes in + * size. + */ + labels?: Record; + /** The location that contains this job. */ + location?: string; + /** + * The user-specified Cloud Dataflow job name. + * + * Only one Job with a given name may exist in a project at any + * given time. If a caller attempts to create a Job with the same + * name as an already-existing Job, the attempt returns the + * existing Job. + * + * The name must match the regular expression + * `[a-z]([-a-z0-9]{0,38}[a-z0-9])?` + */ + name?: string; + /** + * Preliminary field: The format of this data may change at any time. + * A description of the user pipeline and stages through which it is executed. + * Created by Cloud Dataflow service. Only retrieved with + * JOB_VIEW_DESCRIPTION or JOB_VIEW_ALL. + */ + pipelineDescription?: PipelineDescription; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId?: string; + /** + * If this job is an update of an existing job, this field is the job ID + * of the job it replaced. + * + * When sending a `CreateJobRequest`, you can update a job by specifying it + * here. The job named here is stopped, and its intermediate state is + * transferred to this job. + */ + replaceJobId?: string; + /** + * If another job is an update of this job (and thus, this job is in + * `JOB_STATE_UPDATED`), this field contains the ID of that job. + */ + replacedByJobId?: string; + /** + * The job's requested state. + * + * `UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and + * `JOB_STATE_RUNNING` states, by setting requested_state. `UpdateJob` may + * also be used to directly set a job's requested state to + * `JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably terminating the + * job if it has not already reached a terminal state. + */ + requestedState?: string; + /** + * This field may be mutated by the Cloud Dataflow service; + * callers cannot mutate it. + */ + stageStates?: ExecutionStageState[]; + /** The top-level steps that constitute the entire job. */ + steps?: Step[]; + /** + * A set of files the system should be aware of that are used + * for temporary storage. These temporary files will be + * removed on job completion. + * No duplicates are allowed. + * No file patterns are supported. + * + * The supported files are: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempFiles?: string[]; + /** + * The map of transform name prefixes of the job to be replaced to the + * corresponding name prefixes of the new job. + */ + transformNameMapping?: Record; + /** The type of Cloud Dataflow job. */ + type?: string; + } + interface JobExecutionInfo { + /** A mapping from each stage to the information about that stage. */ + stages?: Record; + } + interface JobExecutionStageInfo { + /** + * The steps associated with the execution stage. + * Note that stages may have several steps, and that a given step + * might be run by more than one stage. + */ + stepName?: string[]; + } + interface JobMessage { + /** Deprecated. */ + id?: string; + /** Importance level of the message. */ + messageImportance?: string; + /** The text of the message. */ + messageText?: string; + /** The timestamp of the message. */ + time?: string; + } + interface JobMetrics { + /** Timestamp as of which metric values are current. */ + metricTime?: string; + /** All metrics for this job. */ + metrics?: MetricUpdate[]; + } + interface KeyRangeDataDiskAssignment { + /** + * The name of the data disk where data for this range is stored. + * This name is local to the Google Cloud Platform project and uniquely + * identifies the disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk?: string; + /** The end (exclusive) of the key range. */ + end?: string; + /** The start (inclusive) of the key range. */ + start?: string; + } + interface KeyRangeLocation { + /** + * The name of the data disk where data for this range is stored. + * This name is local to the Google Cloud Platform project and uniquely + * identifies the disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk?: string; + /** + * The physical location of this range assignment to be used for + * streaming computation cross-worker message delivery. + */ + deliveryEndpoint?: string; + /** + * DEPRECATED. The location of the persistent state for this range, as a + * persistent directory in the worker local filesystem. + */ + deprecatedPersistentDirectory?: string; + /** The end (exclusive) of the key range. */ + end?: string; + /** The start (inclusive) of the key range. */ + start?: string; + } + interface LaunchTemplateParameters { + /** The runtime environment for the job. */ + environment?: RuntimeEnvironment; + /** Required. The job name to use for the created job. */ + jobName?: string; + /** The runtime parameters to pass to the job. */ + parameters?: Record; + } + interface LaunchTemplateResponse { + /** + * The job that was launched, if the request was not a dry run and + * the job was successfully launched. + */ + job?: Job; + } + interface LeaseWorkItemRequest { + /** The current timestamp at the worker. */ + currentWorkerTime?: string; + /** The location which contains the WorkItem's job. */ + location?: string; + /** The initial lease period. */ + requestedLeaseDuration?: string; + /** Filter for WorkItem type. */ + workItemTypes?: string[]; + /** + * Worker capabilities. WorkItems might be limited to workers with specific + * capabilities. + */ + workerCapabilities?: string[]; + /** + * Identifies the worker leasing work -- typically the ID of the + * virtual machine running the worker. + */ + workerId?: string; + } + interface LeaseWorkItemResponse { + /** A list of the leased WorkItems. */ + workItems?: WorkItem[]; + } + interface ListJobMessagesResponse { + /** Autoscaling events in ascending timestamp order. */ + autoscalingEvents?: AutoscalingEvent[]; + /** Messages in ascending timestamp order. */ + jobMessages?: JobMessage[]; + /** The token to obtain the next page of results if there are more. */ + nextPageToken?: string; + } + interface ListJobsResponse { + /** Zero or more messages describing locations that failed to respond. */ + failedLocation?: FailedLocation[]; + /** A subset of the requested job information. */ + jobs?: Job[]; + /** Set if there may be more results than fit in this response. */ + nextPageToken?: string; + } + interface MapTask { + /** The instructions in the MapTask. */ + instructions?: ParallelInstruction[]; + /** + * System-defined name of the stage containing this MapTask. + * Unique across the workflow. + */ + stageName?: string; + /** + * System-defined name of this MapTask. + * Unique across the workflow. + */ + systemName?: string; + } + interface MetricShortId { + /** + * The index of the corresponding metric in + * the ReportWorkItemStatusRequest. Required. + */ + metricIndex?: number; + /** The service-generated short identifier for the metric. */ + shortId?: string; + } + interface MetricStructuredName { + /** + * Zero or more labeled fields which identify the part of the job this + * metric is associated with, such as the name of a step or collection. + * + * For example, built-in counters associated with steps will have + * context['step'] = . Counters associated with PCollections + * in the SDK will have context['pcollection'] = . + */ + context?: Record; + /** Worker-defined metric name. */ + name?: string; + /** + * Origin (namespace) of metric name. May be blank for user-define metrics; + * will be "dataflow" for metrics defined by the Dataflow service or SDK. + */ + origin?: string; + } + interface MetricUpdate { + /** + * True if this metric is reported as the total cumulative aggregate + * value accumulated since the worker started working on this WorkItem. + * By default this is false, indicating that this metric is reported + * as a delta that is not associated with any WorkItem. + */ + cumulative?: boolean; + /** A struct value describing properties of a distribution of numeric values. */ + distribution?: any; + /** + * Worker-computed aggregate value for internal use by the Dataflow + * service. + */ + internal?: any; + /** + * Metric aggregation kind. The possible metric aggregation kinds are + * "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution". + * The specified aggregation kind is case-insensitive. + * + * If omitted, this is not an aggregated value but instead + * a single metric sample value. + */ + kind?: string; + /** + * Worker-computed aggregate value for the "Mean" aggregation kind. + * This holds the count of the aggregated values and is used in combination + * with mean_sum above to obtain the actual mean aggregate value. + * The only possible value type is Long. + */ + meanCount?: any; + /** + * Worker-computed aggregate value for the "Mean" aggregation kind. + * This holds the sum of the aggregated values and is used in combination + * with mean_count below to obtain the actual mean aggregate value. + * The only possible value types are Long and Double. + */ + meanSum?: any; + /** Name of the metric. */ + name?: MetricStructuredName; + /** + * Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min", + * "And", and "Or". The possible value types are Long, Double, and Boolean. + */ + scalar?: any; + /** + * Worker-computed aggregate value for the "Set" aggregation kind. The only + * possible value type is a list of Values whose type can be Long, Double, + * or String, according to the metric's type. All Values in the list must + * be of the same type. + */ + set?: any; + /** + * Timestamp associated with the metric value. Optional when workers are + * reporting work progress; it will be filled in responses from the + * metrics API. + */ + updateTime?: string; + } + interface MountedDataDisk { + /** + * The name of the data disk. + * This name is local to the Google Cloud Platform project and uniquely + * identifies the disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk?: string; + } + interface MultiOutputInfo { + /** + * The id of the tag the user code will emit to this output by; this + * should correspond to the tag of some SideInputInfo. + */ + tag?: string; + } + interface NameAndKind { + /** Counter aggregation kind. */ + kind?: string; + /** Name of the counter. */ + name?: string; + } + interface Package { + /** + * The resource to read the package from. The supported resource type is: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket} + * bucket.storage.googleapis.com/ + */ + location?: string; + /** The name of the package. */ + name?: string; + } + interface ParDoInstruction { + /** The input. */ + input?: InstructionInput; + /** Information about each of the outputs, if user_fn is a MultiDoFn. */ + multiOutputInfos?: MultiOutputInfo[]; + /** The number of outputs. */ + numOutputs?: number; + /** Zero or more side inputs. */ + sideInputs?: SideInputInfo[]; + /** The user function to invoke. */ + userFn?: Record; + } + interface ParallelInstruction { + /** Additional information for Flatten instructions. */ + flatten?: FlattenInstruction; + /** User-provided name of this operation. */ + name?: string; + /** System-defined name for the operation in the original workflow graph. */ + originalName?: string; + /** Describes the outputs of the instruction. */ + outputs?: InstructionOutput[]; + /** Additional information for ParDo instructions. */ + parDo?: ParDoInstruction; + /** Additional information for PartialGroupByKey instructions. */ + partialGroupByKey?: PartialGroupByKeyInstruction; + /** Additional information for Read instructions. */ + read?: ReadInstruction; + /** + * System-defined name of this operation. + * Unique across the workflow. + */ + systemName?: string; + /** Additional information for Write instructions. */ + write?: WriteInstruction; + } + interface Parameter { + /** Key or name for this parameter. */ + key?: string; + /** Value for this parameter. */ + value?: any; + } + interface ParameterMetadata { + /** Required. The help text to display for the parameter. */ + helpText?: string; + /** Optional. Whether the parameter is optional. Defaults to false. */ + isOptional?: boolean; + /** Required. The label to display for the parameter. */ + label?: string; + /** Required. The name of the parameter. */ + name?: string; + /** Optional. Regexes that the parameter must match. */ + regexes?: string[]; + } + interface PartialGroupByKeyInstruction { + /** Describes the input to the partial group-by-key instruction. */ + input?: InstructionInput; + /** The codec to use for interpreting an element in the input PTable. */ + inputElementCodec?: Record; + /** + * If this instruction includes a combining function this is the name of the + * intermediate store between the GBK and the CombineValues. + */ + originalCombineValuesInputStoreName?: string; + /** + * If this instruction includes a combining function, this is the name of the + * CombineValues instruction lifted into this instruction. + */ + originalCombineValuesStepName?: string; + /** Zero or more side inputs. */ + sideInputs?: SideInputInfo[]; + /** The value combining function to invoke. */ + valueCombiningFn?: Record; + } + interface PipelineDescription { + /** Pipeline level display data. */ + displayData?: DisplayData[]; + /** Description of each stage of execution of the pipeline. */ + executionPipelineStage?: ExecutionStageSummary[]; + /** Description of each transform in the pipeline and collections between them. */ + originalPipelineTransform?: TransformSummary[]; + } + interface Position { + /** Position is a byte offset. */ + byteOffset?: string; + /** CloudPosition is a concat position. */ + concatPosition?: ConcatPosition; + /** + * Position is past all other positions. Also useful for the end + * position of an unbounded range. + */ + end?: boolean; + /** Position is a string key, ordered lexicographically. */ + key?: string; + /** Position is a record index. */ + recordIndex?: string; + /** + * CloudPosition is a base64 encoded BatchShufflePosition (with FIXED + * sharding). + */ + shufflePosition?: string; + } + interface PubsubLocation { + /** Indicates whether the pipeline allows late-arriving data. */ + dropLateData?: boolean; + /** + * If set, contains a pubsub label from which to extract record ids. + * If left empty, record deduplication will be strictly best effort. + */ + idLabel?: string; + /** + * A pubsub subscription, in the form of + * "pubsub.googleapis.com/subscriptions//" + */ + subscription?: string; + /** + * If set, contains a pubsub label from which to extract record timestamps. + * If left empty, record timestamps will be generated upon arrival. + */ + timestampLabel?: string; + /** + * A pubsub topic, in the form of + * "pubsub.googleapis.com/topics//" + */ + topic?: string; + /** + * If set, specifies the pubsub subscription that will be used for tracking + * custom time timestamps for watermark estimation. + */ + trackingSubscription?: string; + /** If true, then the client has requested to get pubsub attributes. */ + withAttributes?: boolean; + } + interface ReadInstruction { + /** The source to read from. */ + source?: Source; + } + interface ReportWorkItemStatusRequest { + /** The current timestamp at the worker. */ + currentWorkerTime?: string; + /** The location which contains the WorkItem's job. */ + location?: string; + /** + * The order is unimportant, except that the order of the + * WorkItemServiceState messages in the ReportWorkItemStatusResponse + * corresponds to the order of WorkItemStatus messages here. + */ + workItemStatuses?: WorkItemStatus[]; + /** + * The ID of the worker reporting the WorkItem status. If this + * does not match the ID of the worker which the Dataflow service + * believes currently has the lease on the WorkItem, the report + * will be dropped (with an error response). + */ + workerId?: string; + } + interface ReportWorkItemStatusResponse { + /** + * A set of messages indicating the service-side state for each + * WorkItem whose status was reported, in the same order as the + * WorkItemStatus messages in the ReportWorkItemStatusRequest which + * resulting in this response. + */ + workItemServiceStates?: WorkItemServiceState[]; + } + interface ReportedParallelism { + /** + * Specifies whether the parallelism is infinite. If true, "value" is + * ignored. + * Infinite parallelism means the service will assume that the work item + * can always be split into more non-empty work items by dynamic splitting. + * This is a work-around for lack of support for infinity by the current + * JSON-based Java RPC stack. + */ + isInfinite?: boolean; + /** Specifies the level of parallelism in case it is finite. */ + value?: number; + } + interface ResourceUtilizationReport { + /** CPU utilization samples. */ + cpuTime?: CPUTime[]; + } + interface RuntimeEnvironment { + /** + * Whether to bypass the safety checks for the job's temporary directory. + * Use with caution. + */ + bypassTempDirValidation?: boolean; + /** + * The machine type to use for the job. Defaults to the value from the + * template if not specified. + */ + machineType?: string; + /** + * The maximum number of Google Compute Engine instances to be made + * available to your pipeline during execution, from 1 to 1000. + */ + maxWorkers?: number; + /** The email address of the service account to run the job as. */ + serviceAccountEmail?: string; + /** + * The Cloud Storage path to use for temporary files. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + tempLocation?: string; + /** + * The Compute Engine [availability + * zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) + * for launching worker instances to run your pipeline. + */ + zone?: string; + } + interface SendDebugCaptureRequest { + /** The internal component id for which debug information is sent. */ + componentId?: string; + /** The encoded debug information. */ + data?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** The worker id, i.e., VM hostname. */ + workerId?: string; + } + interface SendWorkerMessagesRequest { + /** The location which contains the job */ + location?: string; + /** The WorkerMessages to send. */ + workerMessages?: WorkerMessage[]; + } + interface SendWorkerMessagesResponse { + /** The servers response to the worker messages. */ + workerMessageResponses?: WorkerMessageResponse[]; + } + interface SeqMapTask { + /** Information about each of the inputs. */ + inputs?: SideInputInfo[]; + /** The user-provided name of the SeqDo operation. */ + name?: string; + /** Information about each of the outputs. */ + outputInfos?: SeqMapTaskOutputInfo[]; + /** + * System-defined name of the stage containing the SeqDo operation. + * Unique across the workflow. + */ + stageName?: string; + /** + * System-defined name of the SeqDo operation. + * Unique across the workflow. + */ + systemName?: string; + /** The user function to invoke. */ + userFn?: Record; + } + interface SeqMapTaskOutputInfo { + /** The sink to write the output value to. */ + sink?: Sink; + /** The id of the TupleTag the user code will tag the output value by. */ + tag?: string; + } + interface ShellTask { + /** The shell command to run. */ + command?: string; + /** Exit code for the task. */ + exitCode?: number; + } + interface SideInputId { + /** The step that receives and usually consumes this side input. */ + declaringStepName?: string; + /** The index of the side input, from the list of non_parallel_inputs. */ + inputIndex?: number; + } + interface SideInputInfo { + /** How to interpret the source element(s) as a side input value. */ + kind?: Record; + /** + * The source(s) to read element(s) from to get the value of this side input. + * If more than one source, then the elements are taken from the + * sources, in the specified order if order matters. + * At least one source is required. + */ + sources?: Source[]; + /** + * The id of the tag the user code will access this side input by; + * this should correspond to the tag of some MultiOutputInfo. + */ + tag?: string; + } + interface Sink { + /** The codec to use to encode data written to the sink. */ + codec?: Record; + /** The sink to write to, plus its parameters. */ + spec?: Record; + } + interface Source { + /** + * While splitting, sources may specify the produced bundles + * as differences against another source, in order to save backend-side + * memory and allow bigger jobs. For details, see SourceSplitRequest. + * To support this use case, the full set of parameters of the source + * is logically obtained by taking the latest explicitly specified value + * of each parameter in the order: + * base_specs (later items win), spec (overrides anything in base_specs). + */ + baseSpecs?: Array>; + /** The codec to use to decode data read from the source. */ + codec?: Record; + /** + * Setting this value to true hints to the framework that the source + * doesn't need splitting, and using SourceSplitRequest on it would + * yield SOURCE_SPLIT_OUTCOME_USE_CURRENT. + * + * E.g. a file splitter may set this to true when splitting a single file + * into a set of byte ranges of appropriate size, and set this + * to false when splitting a filepattern into individual files. + * However, for efficiency, a file splitter may decide to produce + * file subranges directly from the filepattern to avoid a splitting + * round-trip. + * + * See SourceSplitRequest for an overview of the splitting process. + * + * This field is meaningful only in the Source objects populated + * by the user (e.g. when filling in a DerivedSource). + * Source objects supplied by the framework to the user don't have + * this field populated. + */ + doesNotNeedSplitting?: boolean; + /** + * Optionally, metadata for this source can be supplied right away, + * avoiding a SourceGetMetadataOperation roundtrip + * (see SourceOperationRequest). + * + * This field is meaningful only in the Source objects populated + * by the user (e.g. when filling in a DerivedSource). + * Source objects supplied by the framework to the user don't have + * this field populated. + */ + metadata?: SourceMetadata; + /** The source to read from, plus its parameters. */ + spec?: Record; + } + interface SourceFork { + /** DEPRECATED */ + primary?: SourceSplitShard; + /** DEPRECATED */ + primarySource?: DerivedSource; + /** DEPRECATED */ + residual?: SourceSplitShard; + /** DEPRECATED */ + residualSource?: DerivedSource; + } + interface SourceGetMetadataRequest { + /** Specification of the source whose metadata should be computed. */ + source?: Source; + } + interface SourceGetMetadataResponse { + /** The computed metadata. */ + metadata?: SourceMetadata; + } + interface SourceMetadata { + /** + * An estimate of the total size (in bytes) of the data that would be + * read from this source. This estimate is in terms of external storage + * size, before any decompression or other processing done by the reader. + */ + estimatedSizeBytes?: string; + /** + * Specifies that the size of this source is known to be infinite + * (this is a streaming source). + */ + infinite?: boolean; + /** + * Whether this source is known to produce key/value pairs with + * the (encoded) keys in lexicographically sorted order. + */ + producesSortedKeys?: boolean; + } + interface SourceOperationRequest { + /** Information about a request to get metadata about a source. */ + getMetadata?: SourceGetMetadataRequest; + /** Information about a request to split a source. */ + split?: SourceSplitRequest; + } + interface SourceOperationResponse { + /** A response to a request to get metadata about a source. */ + getMetadata?: SourceGetMetadataResponse; + /** A response to a request to split a source. */ + split?: SourceSplitResponse; + } + interface SourceSplitOptions { + /** + * The source should be split into a set of bundles where the estimated size + * of each is approximately this many bytes. + */ + desiredBundleSizeBytes?: string; + /** DEPRECATED in favor of desired_bundle_size_bytes. */ + desiredShardSizeBytes?: string; + } + interface SourceSplitRequest { + /** Hints for tuning the splitting process. */ + options?: SourceSplitOptions; + /** Specification of the source to be split. */ + source?: Source; + } + interface SourceSplitResponse { + /** + * If outcome is SPLITTING_HAPPENED, then this is a list of bundles + * into which the source was split. Otherwise this field is ignored. + * This list can be empty, which means the source represents an empty input. + */ + bundles?: DerivedSource[]; + /** + * Indicates whether splitting happened and produced a list of bundles. + * If this is USE_CURRENT_SOURCE_AS_IS, the current source should + * be processed "as is" without splitting. "bundles" is ignored in this case. + * If this is SPLITTING_HAPPENED, then "bundles" contains a list of + * bundles into which the source was split. + */ + outcome?: string; + /** DEPRECATED in favor of bundles. */ + shards?: SourceSplitShard[]; + } + interface SourceSplitShard { + /** DEPRECATED */ + derivationMode?: string; + /** DEPRECATED */ + source?: Source; + } + interface SplitInt64 { + /** The high order bits, including the sign: n >> 32. */ + highBits?: number; + /** The low order bits: n & 0xffffffff. */ + lowBits?: number; + } + interface StageSource { + /** Dataflow service generated name for this source. */ + name?: string; + /** + * User name for the original user transform or collection with which this + * source is most closely associated. + */ + originalTransformOrCollection?: string; + /** Size of the source, if measurable. */ + sizeBytes?: string; + /** Human-readable name for this source; may be user or system generated. */ + userName?: string; + } + interface StateFamilyConfig { + /** If true, this family corresponds to a read operation. */ + isRead?: boolean; + /** The state family value. */ + stateFamily?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface Step { + /** The kind of step in the Cloud Dataflow job. */ + kind?: string; + /** + * The name that identifies the step. This must be unique for each + * step with respect to all other steps in the Cloud Dataflow job. + */ + name?: string; + /** + * Named properties associated with the step. Each kind of + * predefined step has its own required set of properties. + * Must be provided on Create. Only retrieved with JOB_VIEW_ALL. + */ + properties?: Record; + } + interface StreamLocation { + /** The stream is a custom source. */ + customSourceLocation?: CustomSourceLocation; + /** The stream is a pubsub stream. */ + pubsubLocation?: PubsubLocation; + /** The stream is a streaming side input. */ + sideInputLocation?: StreamingSideInputLocation; + /** + * The stream is part of another computation within the current + * streaming Dataflow job. + */ + streamingStageLocation?: StreamingStageLocation; + } + interface StreamingComputationConfig { + /** Unique identifier for this computation. */ + computationId?: string; + /** Instructions that comprise the computation. */ + instructions?: ParallelInstruction[]; + /** Stage name of this computation. */ + stageName?: string; + /** System defined name for this computation. */ + systemName?: string; + } + interface StreamingComputationRanges { + /** The ID of the computation. */ + computationId?: string; + /** Data disk assignments for ranges from this computation. */ + rangeAssignments?: KeyRangeDataDiskAssignment[]; + } + interface StreamingComputationTask { + /** Contains ranges of a streaming computation this task should apply to. */ + computationRanges?: StreamingComputationRanges[]; + /** Describes the set of data disks this task should apply to. */ + dataDisks?: MountedDataDisk[]; + /** A type of streaming computation task. */ + taskType?: string; + } + interface StreamingConfigTask { + /** Set of computation configuration information. */ + streamingComputationConfigs?: StreamingComputationConfig[]; + /** Map from user step names to state families. */ + userStepToStateFamilyNameMap?: Record; + /** + * If present, the worker must use this endpoint to communicate with Windmill + * Service dispatchers, otherwise the worker must continue to use whatever + * endpoint it had been using. + */ + windmillServiceEndpoint?: string; + /** + * If present, the worker must use this port to communicate with Windmill + * Service dispatchers. Only applicable when windmill_service_endpoint is + * specified. + */ + windmillServicePort?: string; + } + interface StreamingSetupTask { + /** The user has requested drain. */ + drain?: boolean; + /** + * The TCP port on which the worker should listen for messages from + * other streaming computation workers. + */ + receiveWorkPort?: number; + /** The global topology of the streaming Dataflow job. */ + streamingComputationTopology?: TopologyConfig; + /** + * The TCP port used by the worker to communicate with the Dataflow + * worker harness. + */ + workerHarnessPort?: number; + } + interface StreamingSideInputLocation { + /** Identifies the state family where this side input is stored. */ + stateFamily?: string; + /** Identifies the particular side input within the streaming Dataflow job. */ + tag?: string; + } + interface StreamingStageLocation { + /** + * Identifies the particular stream within the streaming Dataflow + * job. + */ + streamId?: string; + } + interface StringList { + /** Elements of the list. */ + elements?: string[]; + } + interface StructuredMessage { + /** + * Idenfier for this message type. Used by external systems to + * internationalize or personalize message. + */ + messageKey?: string; + /** Human-readable version of message. */ + messageText?: string; + /** The structured data associated with this message. */ + parameters?: Parameter[]; + } + interface TaskRunnerSettings { + /** Whether to also send taskrunner log info to stderr. */ + alsologtostderr?: boolean; + /** The location on the worker for task-specific subdirectories. */ + baseTaskDir?: string; + /** + * The base URL for the taskrunner to use when accessing Google Cloud APIs. + * + * When workers access Google Cloud APIs, they logically do so via + * relative URLs. If this field is specified, it supplies the base + * URL to use for resolving these relative URLs. The normative + * algorithm used is defined by RFC 1808, "Relative Uniform Resource + * Locators". + * + * If not specified, the default value is "http://www.googleapis.com/" + */ + baseUrl?: string; + /** The file to store preprocessing commands in. */ + commandlinesFileName?: string; + /** Whether to continue taskrunner if an exception is hit. */ + continueOnException?: boolean; + /** The API version of endpoint, e.g. "v1b3" */ + dataflowApiVersion?: string; + /** The command to launch the worker harness. */ + harnessCommand?: string; + /** The suggested backend language. */ + languageHint?: string; + /** The directory on the VM to store logs. */ + logDir?: string; + /** + * Whether to send taskrunner log info to Google Compute Engine VM serial + * console. + */ + logToSerialconsole?: boolean; + /** + * Indicates where to put logs. If this is not specified, the logs + * will not be uploaded. + * + * The supported resource type is: + * + * Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + logUploadLocation?: string; + /** + * The OAuth2 scopes to be requested by the taskrunner in order to + * access the Cloud Dataflow API. + */ + oauthScopes?: string[]; + /** The settings to pass to the parallel worker harness. */ + parallelWorkerSettings?: WorkerSettings; + /** The streaming worker main class name. */ + streamingWorkerMainClass?: string; + /** + * The UNIX group ID on the worker VM to use for tasks launched by + * taskrunner; e.g. "wheel". + */ + taskGroup?: string; + /** + * The UNIX user ID on the worker VM to use for tasks launched by + * taskrunner; e.g. "root". + */ + taskUser?: string; + /** + * The prefix of the resources the taskrunner should use for + * temporary storage. + * + * The supported resource type is: + * + * Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix?: string; + /** The ID string of the VM. */ + vmId?: string; + /** The file to store the workflow in. */ + workflowFileName?: string; + } + interface TemplateMetadata { + /** Optional. A description of the template. */ + description?: string; + /** Required. The name of the template. */ + name?: string; + /** The parameters for the template. */ + parameters?: ParameterMetadata[]; + } + interface TopologyConfig { + /** The computations associated with a streaming Dataflow job. */ + computations?: ComputationTopology[]; + /** The disks assigned to a streaming Dataflow job. */ + dataDiskAssignments?: DataDiskAssignment[]; + /** The size (in bits) of keys that will be assigned to source messages. */ + forwardingKeyBits?: number; + /** Version number for persistent state. */ + persistentStateVersion?: number; + /** Maps user stage names to stable computation names. */ + userStageToComputationNameMap?: Record; + } + interface TransformSummary { + /** Transform-specific display data. */ + displayData?: DisplayData[]; + /** SDK generated id of this transform instance. */ + id?: string; + /** User names for all collection inputs to this transform. */ + inputCollectionName?: string[]; + /** Type of transform. */ + kind?: string; + /** User provided name for this transform instance. */ + name?: string; + /** User names for all collection outputs to this transform. */ + outputCollectionName?: string[]; + } + interface WorkItem { + /** Work item-specific configuration as an opaque blob. */ + configuration?: string; + /** Identifies this WorkItem. */ + id?: string; + /** The initial index to use when reporting the status of the WorkItem. */ + initialReportIndex?: string; + /** Identifies the workflow job this WorkItem belongs to. */ + jobId?: string; + /** Time when the lease on this Work will expire. */ + leaseExpireTime?: string; + /** Additional information for MapTask WorkItems. */ + mapTask?: MapTask; + /** + * Any required packages that need to be fetched in order to execute + * this WorkItem. + */ + packages?: Package[]; + /** Identifies the cloud project this WorkItem belongs to. */ + projectId?: string; + /** Recommended reporting interval. */ + reportStatusInterval?: string; + /** Additional information for SeqMapTask WorkItems. */ + seqMapTask?: SeqMapTask; + /** Additional information for ShellTask WorkItems. */ + shellTask?: ShellTask; + /** Additional information for source operation WorkItems. */ + sourceOperationTask?: SourceOperationRequest; + /** Additional information for StreamingComputationTask WorkItems. */ + streamingComputationTask?: StreamingComputationTask; + /** Additional information for StreamingConfigTask WorkItems. */ + streamingConfigTask?: StreamingConfigTask; + /** Additional information for StreamingSetupTask WorkItems. */ + streamingSetupTask?: StreamingSetupTask; + } + interface WorkItemServiceState { + /** + * Other data returned by the service, specific to the particular + * worker harness. + */ + harnessData?: Record; + /** Time at which the current lease will expire. */ + leaseExpireTime?: string; + /** + * The short ids that workers should use in subsequent metric updates. + * Workers should strive to use short ids whenever possible, but it is ok + * to request the short_id again if a worker lost track of it + * (e.g. if the worker is recovering from a crash). + * NOTE: it is possible that the response may have short ids for a subset + * of the metrics. + */ + metricShortId?: MetricShortId[]; + /** + * The index value to use for the next report sent by the worker. + * Note: If the report call fails for whatever reason, the worker should + * reuse this index for subsequent report attempts. + */ + nextReportIndex?: string; + /** New recommended reporting interval. */ + reportStatusInterval?: string; + /** + * The progress point in the WorkItem where the Dataflow service + * suggests that the worker truncate the task. + */ + splitRequest?: ApproximateSplitRequest; + /** DEPRECATED in favor of split_request. */ + suggestedStopPoint?: ApproximateProgress; + /** Obsolete, always empty. */ + suggestedStopPosition?: Position; + } + interface WorkItemStatus { + /** True if the WorkItem was completed (successfully or unsuccessfully). */ + completed?: boolean; + /** Worker output counters for this WorkItem. */ + counterUpdates?: CounterUpdate[]; + /** See documentation of stop_position. */ + dynamicSourceSplit?: DynamicSourceSplit; + /** + * Specifies errors which occurred during processing. If errors are + * provided, and completed = true, then the WorkItem is considered + * to have failed. + */ + errors?: Status[]; + /** DEPRECATED in favor of counter_updates. */ + metricUpdates?: MetricUpdate[]; + /** DEPRECATED in favor of reported_progress. */ + progress?: ApproximateProgress; + /** + * The report index. When a WorkItem is leased, the lease will + * contain an initial report index. When a WorkItem's status is + * reported to the system, the report should be sent with + * that report index, and the response will contain the index the + * worker should use for the next report. Reports received with + * unexpected index values will be rejected by the service. + * + * In order to preserve idempotency, the worker should not alter the + * contents of a report, even if the worker must submit the same + * report multiple times before getting back a response. The worker + * should not submit a subsequent report until the response for the + * previous report had been received from the service. + */ + reportIndex?: string; + /** The worker's progress through this WorkItem. */ + reportedProgress?: ApproximateReportedProgress; + /** Amount of time the worker requests for its lease. */ + requestedLeaseDuration?: string; + /** DEPRECATED in favor of dynamic_source_split. */ + sourceFork?: SourceFork; + /** + * If the work item represented a SourceOperationRequest, and the work + * is completed, contains the result of the operation. + */ + sourceOperationResponse?: SourceOperationResponse; + /** + * A worker may split an active map task in two parts, "primary" and + * "residual", continuing to process the primary part and returning the + * residual part into the pool of available work. + * This event is called a "dynamic split" and is critical to the dynamic + * work rebalancing feature. The two obtained sub-tasks are called + * "parts" of the split. + * The parts, if concatenated, must represent the same input as would + * be read by the current task if the split did not happen. + * The exact way in which the original task is decomposed into the two + * parts is specified either as a position demarcating them + * (stop_position), or explicitly as two DerivedSources, if this + * task consumes a user-defined source type (dynamic_source_split). + * + * The "current" task is adjusted as a result of the split: after a task + * with range [A, B) sends a stop_position update at C, its range is + * considered to be [A, C), e.g.: + * * Progress should be interpreted relative to the new range, e.g. + * "75% completed" means "75% of [A, C) completed" + * * The worker should interpret proposed_stop_position relative to the + * new range, e.g. "split at 68%" should be interpreted as + * "split at 68% of [A, C)". + * * If the worker chooses to split again using stop_position, only + * stop_positions in [A, C) will be accepted. + * * Etc. + * dynamic_source_split has similar semantics: e.g., if a task with + * source S splits using dynamic_source_split into {P, R} + * (where P and R must be together equivalent to S), then subsequent + * progress and proposed_stop_position should be interpreted relative + * to P, and in a potential subsequent dynamic_source_split into {P', R'}, + * P' and R' must be together equivalent to P, etc. + */ + stopPosition?: Position; + /** Total time the worker spent being throttled by external systems. */ + totalThrottlerWaitTimeSeconds?: number; + /** Identifies the WorkItem. */ + workItemId?: string; + } + interface WorkerHealthReport { + /** + * The pods running on the worker. See: + * http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod + * + * This field is used by the worker to send the status of the indvidual + * containers running on each worker. + */ + pods?: Array>; + /** + * The interval at which the worker is sending health reports. + * The default value of 0 should be interpreted as the field is not being + * explicitly set by the worker. + */ + reportInterval?: string; + /** Whether the VM is healthy. */ + vmIsHealthy?: boolean; + /** The time the VM was booted. */ + vmStartupTime?: string; + } + interface WorkerHealthReportResponse { + /** + * A positive value indicates the worker should change its reporting interval + * to the specified value. + * + * The default value of zero means no change in report rate is requested by + * the server. + */ + reportInterval?: string; + } + interface WorkerMessage { + /** + * Labels are used to group WorkerMessages. + * For example, a worker_message about a particular container + * might have the labels: + * { "JOB_ID": "2015-04-22", + * "WORKER_ID": "wordcount-vm-2015…" + * "CONTAINER_TYPE": "worker", + * "CONTAINER_ID": "ac1234def"} + * Label tags typically correspond to Label enum values. However, for ease + * of development other strings can be used as tags. LABEL_UNSPECIFIED should + * not be used here. + */ + labels?: Record; + /** The timestamp of the worker_message. */ + time?: string; + /** The health of a worker. */ + workerHealthReport?: WorkerHealthReport; + /** A worker message code. */ + workerMessageCode?: WorkerMessageCode; + /** Resource metrics reported by workers. */ + workerMetrics?: ResourceUtilizationReport; + /** Shutdown notice by workers. */ + workerShutdownNotice?: WorkerShutdownNotice; + } + interface WorkerMessageCode { + /** + * The code is a string intended for consumption by a machine that identifies + * the type of message being sent. + * Examples: + * 1. "HARNESS_STARTED" might be used to indicate the worker harness has + * started. + * 2. "GCS_DOWNLOAD_ERROR" might be used to indicate an error downloading + * a GCS file as part of the boot process of one of the worker containers. + * + * This is a string and not an enum to make it easy to add new codes without + * waiting for an API change. + */ + code?: string; + /** + * Parameters contains specific information about the code. + * + * This is a struct to allow parameters of different types. + * + * Examples: + * 1. For a "HARNESS_STARTED" message parameters might provide the name + * of the worker and additional data like timing information. + * 2. For a "GCS_DOWNLOAD_ERROR" parameters might contain fields listing + * the GCS objects being downloaded and fields containing errors. + * + * In general complex data structures should be avoided. If a worker + * needs to send a specific and complicated data structure then please + * consider defining a new proto and adding it to the data oneof in + * WorkerMessageResponse. + * + * Conventions: + * Parameters should only be used for information that isn't typically passed + * as a label. + * hostname and other worker identifiers should almost always be passed + * as labels since they will be included on most messages. + */ + parameters?: Record; + } + interface WorkerMessageResponse { + /** The service's response to a worker's health report. */ + workerHealthReportResponse?: WorkerHealthReportResponse; + /** Service's response to reporting worker metrics (currently empty). */ + workerMetricsResponse?: any; + /** Service's response to shutdown notice (currently empty). */ + workerShutdownNoticeResponse?: any; + } + interface WorkerPool { + /** Settings for autoscaling of this WorkerPool. */ + autoscalingSettings?: AutoscalingSettings; + /** Data disks that are used by a VM in this workflow. */ + dataDisks?: Disk[]; + /** + * The default package set to install. This allows the service to + * select a default set of packages which are useful to worker + * harnesses written in a particular language. + */ + defaultPackageSet?: string; + /** + * Size of root disk for VMs, in GB. If zero or unspecified, the service will + * attempt to choose a reasonable default. + */ + diskSizeGb?: number; + /** Fully qualified source image for disks. */ + diskSourceImage?: string; + /** + * Type of root disk for VMs. If empty or unspecified, the service will + * attempt to choose a reasonable default. + */ + diskType?: string; + /** Configuration for VM IPs. */ + ipConfiguration?: string; + /** + * The kind of the worker pool; currently only `harness` and `shuffle` + * are supported. + */ + kind?: string; + /** + * Machine type (e.g. "n1-standard-1"). If empty or unspecified, the + * service will attempt to choose a reasonable default. + */ + machineType?: string; + /** Metadata to set on the Google Compute Engine VMs. */ + metadata?: Record; + /** + * Network to which VMs will be assigned. If empty or unspecified, + * the service will use the network "default". + */ + network?: string; + /** + * The number of threads per worker harness. If empty or unspecified, the + * service will choose a number of threads (according to the number of cores + * on the selected machine type for batch, or 1 by convention for streaming). + */ + numThreadsPerWorker?: number; + /** + * Number of Google Compute Engine workers in this pool needed to + * execute the job. If zero or unspecified, the service will + * attempt to choose a reasonable default. + */ + numWorkers?: number; + /** + * The action to take on host maintenance, as defined by the Google + * Compute Engine API. + */ + onHostMaintenance?: string; + /** Packages to be installed on workers. */ + packages?: Package[]; + /** Extra arguments for this worker pool. */ + poolArgs?: Record; + /** + * Subnetwork to which VMs will be assigned, if desired. Expected to be of + * the form "regions/REGION/subnetworks/SUBNETWORK". + */ + subnetwork?: string; + /** + * Settings passed through to Google Compute Engine workers when + * using the standard Dataflow task runner. Users should ignore + * this field. + */ + taskrunnerSettings?: TaskRunnerSettings; + /** + * Sets the policy for determining when to turndown worker pool. + * Allowed values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and + * `TEARDOWN_NEVER`. + * `TEARDOWN_ALWAYS` means workers are always torn down regardless of whether + * the job succeeds. `TEARDOWN_ON_SUCCESS` means workers are torn down + * if the job succeeds. `TEARDOWN_NEVER` means the workers are never torn + * down. + * + * If the workers are not torn down by the service, they will + * continue to run and use Google Compute Engine VM resources in the + * user's project until they are explicitly terminated by the user. + * Because of this, Google recommends using the `TEARDOWN_ALWAYS` + * policy except for small, manually supervised test jobs. + * + * If unknown or unspecified, the service will attempt to choose a reasonable + * default. + */ + teardownPolicy?: string; + /** + * Required. Docker container image that executes the Cloud Dataflow worker + * harness, residing in Google Container Registry. + */ + workerHarnessContainerImage?: string; + /** + * Zone to run the worker pools in. If empty or unspecified, the service + * will attempt to choose a reasonable default. + */ + zone?: string; + } + interface WorkerSettings { + /** + * The base URL for accessing Google Cloud APIs. + * + * When workers access Google Cloud APIs, they logically do so via + * relative URLs. If this field is specified, it supplies the base + * URL to use for resolving these relative URLs. The normative + * algorithm used is defined by RFC 1808, "Relative Uniform Resource + * Locators". + * + * If not specified, the default value is "http://www.googleapis.com/" + */ + baseUrl?: string; + /** Whether to send work progress updates to the service. */ + reportingEnabled?: boolean; + /** + * The Cloud Dataflow service path relative to the root URL, for example, + * "dataflow/v1b3/projects". + */ + servicePath?: string; + /** + * The Shuffle service path relative to the root URL, for example, + * "shuffle/v1beta1". + */ + shuffleServicePath?: string; + /** + * The prefix of the resources the system should use for temporary + * storage. + * + * The supported resource type is: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix?: string; + /** The ID of the worker running this pipeline. */ + workerId?: string; + } + interface WorkerShutdownNotice { + /** + * The reason for the worker shutdown. + * Current possible values are: + * "UNKNOWN": shutdown reason is unknown. + * "PREEMPTION": shutdown reason is preemption. + * Other possible reasons may be added in the future. + */ + reason?: string; + } + interface WriteInstruction { + /** The input. */ + input?: InstructionInput; + /** The sink to write to. */ + sink?: Sink; + } + interface DebugResource { + /** Get encoded debug configuration for component. Not cacheable. */ + getConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Send encoded debug capture data for component. */ + sendCapture(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface MessagesResource { + /** Request the job status. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages about. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** Filter to only get messages with importance >= level */ + minimumImportance?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + pageSize?: number; + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface WorkItemsResource { + /** Leases a dataflow WorkItem to run. */ + lease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifies the workflow job this worker belongs to. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project this worker belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Reports the status of dataflow WorkItems leased by a worker. */ + reportStatus(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job which the WorkItem is part of. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the WorkItem's job. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface JobsResource { + /** List the jobs of a project across all regions. */ + aggregated(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The kind of filter to use. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + pageSize?: number; + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the jobs. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. */ + view?: string; + }): Request; + /** Creates a Cloud Dataflow job. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Deprecated. This field is now in the Job message. */ + replaceJobId?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Gets the state of the specified Cloud Dataflow job. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Request the job status. */ + getMetrics(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages for. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Return only metric data that has changed since this time. + * Default is to return all information about all metrics for the job. + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** List the jobs of a project in a given region. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The kind of filter to use. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + pageSize?: number; + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the jobs. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. */ + view?: string; + }): Request; + /** Updates the state of an existing Cloud Dataflow job. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + debug: DebugResource; + messages: MessagesResource; + workItems: WorkItemsResource; + } + interface DebugResource { + /** Get encoded debug configuration for component. Not cacheable. */ + getConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Send encoded debug capture data for component. */ + sendCapture(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface MessagesResource { + /** Request the job status. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages about. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** Filter to only get messages with importance >= level */ + minimumImportance?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + pageSize?: number; + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface WorkItemsResource { + /** Leases a dataflow WorkItem to run. */ + lease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifies the workflow job this worker belongs to. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the WorkItem's job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project this worker belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Reports the status of dataflow WorkItems leased by a worker. */ + reportStatus(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job which the WorkItem is part of. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the WorkItem's job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the WorkItem's job. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface JobsResource { + /** Creates a Cloud Dataflow job. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Deprecated. This field is now in the Job message. */ + replaceJobId?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Gets the state of the specified Cloud Dataflow job. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Request the job status. */ + getMetrics(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages for. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Return only metric data that has changed since this time. + * Default is to return all information about all metrics for the job. + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** List the jobs of a project in a given region. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The kind of filter to use. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + pageSize?: number; + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the jobs. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. */ + view?: string; + }): Request; + /** Updates the state of an existing Cloud Dataflow job. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + debug: DebugResource; + messages: MessagesResource; + workItems: WorkItemsResource; + } + interface TemplatesResource { + /** Creates a Cloud Dataflow job from a template. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get the template associated with a template. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The view to retrieve. Defaults to METADATA_ONLY. */ + view?: string; + }): Request; + /** Launch a template. */ + launch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to create + * the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * If true, the request is validated but not actually executed. + * Defaults to false. + */ + validateOnly?: boolean; + }): Request; + } + interface LocationsResource { + /** Send a worker_message to the service. */ + workerMessages(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project to send the WorkerMessages to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + jobs: JobsResource; + templates: TemplatesResource; + } + interface TemplatesResource { + /** Creates a Cloud Dataflow job from a template. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get the template associated with a template. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The view to retrieve. Defaults to METADATA_ONLY. */ + view?: string; + }): Request; + /** Launch a template. */ + launch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to create + * the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * If true, the request is validated but not actually executed. + * Defaults to false. + */ + validateOnly?: boolean; + }): Request; + } + interface ProjectsResource { + /** Send a worker_message to the service. */ + workerMessages(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project to send the WorkerMessages to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + jobs: JobsResource; + locations: LocationsResource; + templates: TemplatesResource; + } + } +} diff --git a/types/gapi.client.dataflow/readme.md b/types/gapi.client.dataflow/readme.md new file mode 100644 index 0000000000..d91dd9868b --- /dev/null +++ b/types/gapi.client.dataflow/readme.md @@ -0,0 +1,68 @@ +# TypeScript typings for Google Dataflow API v1b3 +Manages Google Cloud Dataflow projects on Google Cloud Platform. +For detailed description please check [documentation](https://cloud.google.com/dataflow). + +## Installing + +Install typings for Google Dataflow API: +``` +npm install @types/gapi.client.dataflow@v1b3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dataflow', 'v1b3', () => { + // now we can use gapi.client.dataflow + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute', + + // View your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute.readonly', + + // View your email address + 'https://www.googleapis.com/auth/userinfo.email', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Dataflow API resources: + +```typescript + +/* +Send a worker_message to the service. +*/ +await gapi.client.projects.workerMessages({ projectId: "projectId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.dataflow/tsconfig.json b/types/gapi.client.dataflow/tsconfig.json new file mode 100644 index 0000000000..08c1fced14 --- /dev/null +++ b/types/gapi.client.dataflow/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dataflow-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dataflow/tslint.json b/types/gapi.client.dataflow/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dataflow/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dataproc/gapi.client.dataproc-tests.ts b/types/gapi.client.dataproc/gapi.client.dataproc-tests.ts new file mode 100644 index 0000000000..b5408509e6 --- /dev/null +++ b/types/gapi.client.dataproc/gapi.client.dataproc-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dataproc', 'v1', () => { + /** now we can use gapi.client.dataproc */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.dataproc/index.d.ts b/types/gapi.client.dataproc/index.d.ts new file mode 100644 index 0000000000..cc9f6fcb8f --- /dev/null +++ b/types/gapi.client.dataproc/index.d.ts @@ -0,0 +1,1225 @@ +// Type definitions for Google Google Cloud Dataproc API v1 1.0 +// Project: https://cloud.google.com/dataproc/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://dataproc.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Dataproc API v1 */ + function load(name: "dataproc", version: "v1"): PromiseLike; + function load(name: "dataproc", version: "v1", callback: () => any): void; + + const projects: dataproc.ProjectsResource; + + namespace dataproc { + interface AcceleratorConfig { + /** The number of the accelerator cards of this type exposed to this instance. */ + acceleratorCount?: number; + /** + * Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( + * /compute/docs/reference/beta/acceleratorTypes)Examples * + * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * + * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80 + */ + acceleratorTypeUri?: string; + } + interface Cluster { + /** Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused. */ + clusterName?: string; + /** Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster. */ + clusterUuid?: string; + /** Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated. */ + config?: ClusterConfig; + /** + * Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. + */ + labels?: Record; + /** + * Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before + * final release. + */ + metrics?: ClusterMetrics; + /** Required. The Google Cloud Platform project ID that the cluster belongs to. */ + projectId?: string; + /** Output-only. Cluster status. */ + status?: ClusterStatus; + /** Output-only. The previous cluster status. */ + statusHistory?: ClusterStatus[]; + } + interface ClusterConfig { + /** + * Optional. A Google Cloud Storage staging bucket used for sharing generated SSH keys and config. If you do not specify a staging bucket, Cloud Dataproc + * will determine an appropriate Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone + * where your cluster is deployed, and then it will create and manage this project-level, per-location bucket for you. + */ + configBucket?: string; + /** Required. The shared Google Compute Engine config settings for all instances in a cluster. */ + gceClusterConfig?: GceClusterConfig; + /** + * Optional. Commands to execute on each node after config is completed. By default, executables are run on master and all worker nodes. You can test a + * node's role metadata to run an executable on a master or worker node, as shown below using curl (you can also use wget): + * ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) + * if [[ "${ROLE}" == 'Master' ]]; then + * ... master specific actions ... + * else + * ... worker specific actions ... + * fi + */ + initializationActions?: NodeInitializationAction[]; + /** Optional. The Google Compute Engine config settings for the master instance in a cluster. */ + masterConfig?: InstanceGroupConfig; + /** Optional. The Google Compute Engine config settings for additional worker instances in a cluster. */ + secondaryWorkerConfig?: InstanceGroupConfig; + /** Optional. The config settings for software inside the cluster. */ + softwareConfig?: SoftwareConfig; + /** Optional. The Google Compute Engine config settings for worker instances in a cluster. */ + workerConfig?: InstanceGroupConfig; + } + interface ClusterMetrics { + /** The HDFS metrics. */ + hdfsMetrics?: Record; + /** The YARN metrics. */ + yarnMetrics?: Record; + } + interface ClusterOperationMetadata { + /** Output-only. Name of the cluster for the operation. */ + clusterName?: string; + /** Output-only. Cluster UUID for the operation. */ + clusterUuid?: string; + /** Output-only. Short description of operation. */ + description?: string; + /** Output-only. Labels associated with the operation */ + labels?: Record; + /** Output-only. The operation type. */ + operationType?: string; + /** Output-only. Current operation status. */ + status?: ClusterOperationStatus; + /** Output-only. The previous operation status. */ + statusHistory?: ClusterOperationStatus[]; + /** Output-only. Errors encountered during operation execution. */ + warnings?: string[]; + } + interface ClusterOperationStatus { + /** Output-only.A message containing any operation metadata details. */ + details?: string; + /** Output-only. A message containing the detailed operation state. */ + innerState?: string; + /** Output-only. A message containing the operation state. */ + state?: string; + /** Output-only. The time this state was entered. */ + stateStartTime?: string; + } + interface ClusterStatus { + /** Output-only. Optional details of cluster's state. */ + detail?: string; + /** Output-only. The cluster's state. */ + state?: string; + /** Output-only. Time when this state was entered. */ + stateStartTime?: string; + /** Output-only. Additional state information that includes status reported by the agent. */ + substate?: string; + } + interface DiagnoseClusterResults { + /** Output-only. The Google Cloud Storage URI of the diagnostic output. The output report is a plain text file with a summary of collected diagnostics. */ + outputUri?: string; + } + interface DiskConfig { + /** Optional. Size in GB of the boot disk (default is 500GB). */ + bootDiskSizeGb?: number; + /** + * Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS + * (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and + * the boot disk contains only basic config and installed binaries. + */ + numLocalSsds?: number; + } + interface GceClusterConfig { + /** + * Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, + * and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled + * networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses. + */ + internalIpOnly?: boolean; + /** + * The Google Compute Engine metadata entries to add to all instances (see Project and instance metadata + * (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + */ + metadata?: Record; + /** + * Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor + * subnetwork_uri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see Using Subnetworks for + * more information).A full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default + * projects/[project_id]/regions/global/default + * default + */ + networkUri?: string; + /** + * Optional. The service account of the instances. Defaults to the default Google Compute Engine service account. Custom service accounts need permissions + * equivalent to the folloing IAM roles: + * roles/logging.logWriter + * roles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: + * [account_id]@[project_id].iam.gserviceaccount.com + */ + serviceAccount?: string; + /** + * Optional. The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included: + * https://www.googleapis.com/auth/cloud.useraccounts.readonly + * https://www.googleapis.com/auth/devstorage.read_write + * https://www.googleapis.com/auth/logging.writeIf no scopes are specified, the following defaults are also provided: + * https://www.googleapis.com/auth/bigquery + * https://www.googleapis.com/auth/bigtable.admin.table + * https://www.googleapis.com/auth/bigtable.data + * https://www.googleapis.com/auth/devstorage.full_control + */ + serviceAccountScopes?: string[]; + /** + * Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri.A full URL, partial URI, or + * short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 + * projects/[project_id]/regions/us-east1/sub0 + * sub0 + */ + subnetworkUri?: string; + /** The Google Compute Engine tags to add to all instances (see Tagging instances). */ + tags?: string[]; + /** + * Optional. The zone where the Google Compute Engine cluster will be located. On a create request, it is required in the "global" region. If omitted in a + * non-global Cloud Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be + * present.A full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] + * projects/[project_id]/zones/[zone] + * us-central1-f + */ + zoneUri?: string; + } + interface HadoopJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, + * or .zip. + */ + archiveUris?: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a + * collision may occur that causes an incorrect job submission. + */ + args?: string[]; + /** + * Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for + * naively parallel tasks. + */ + fileUris?: string[]; + /** Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris. */ + mainClass?: string; + /** + * The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' + * 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + */ + mainJarFileUri?: string; + /** + * Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code. + */ + properties?: Record; + } + interface HiveJob { + /** + * Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent + * parallel queries. + */ + continueOnFailure?: boolean; + /** Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. */ + jarFileUris?: string[]; + /** + * Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code. + */ + properties?: Record; + /** The HCFS URI of the script that contains Hive queries. */ + queryFileUri?: string; + /** A list of queries. */ + queryList?: QueryList; + /** Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name="value";). */ + scriptVariables?: Record; + } + interface InstanceGroupConfig { + /** + * Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be + * changed before final release. + */ + accelerators?: AcceleratorConfig[]; + /** Optional. Disk option config settings. */ + diskConfig?: DiskConfig; + /** Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version. */ + imageUri?: string; + /** + * Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user + * (recommended practice is to let Cloud Dataproc derive the name). + */ + instanceNames?: string[]; + /** Optional. Specifies that this instance group contains preemptible instances. */ + isPreemptible?: boolean; + /** + * Optional. The Google Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * n1-standard-2 + */ + machineTypeUri?: string; + /** Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. */ + managedGroupConfig?: ManagedGroupConfig; + /** Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1. */ + numInstances?: number; + } + interface Job { + /** + * Output-only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files + * may be placed in the same location as driver_output_uri. + */ + driverControlFilesUri?: string; + /** Output-only. A URI pointing to the location of the stdout of the job's driver program. */ + driverOutputResourceUri?: string; + /** Job is a Hadoop job. */ + hadoopJob?: HadoopJob; + /** Job is a Hive job. */ + hiveJob?: HiveJob; + /** + * Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job. + */ + labels?: Record; + /** Job is a Pig job. */ + pigJob?: PigJob; + /** Required. Job information, including how, when, and where to run the job. */ + placement?: JobPlacement; + /** Job is a Pyspark job. */ + pysparkJob?: PySparkJob; + /** + * Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not + * specified when a job is created, the server generates a job_id. + */ + reference?: JobReference; + /** Optional. Job scheduling configuration. */ + scheduling?: JobScheduling; + /** Job is a Spark job. */ + sparkJob?: SparkJob; + /** Job is a SparkSql job. */ + sparkSqlJob?: SparkSqlJob; + /** + * Output-only. The job status. Additional application-specific status information may be contained in the type_job and + * yarn_applications fields. + */ + status?: JobStatus; + /** Output-only. The previous job status. */ + statusHistory?: JobStatus[]; + /** + * Output-only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It may be + * changed before final release. + */ + yarnApplications?: YarnApplication[]; + } + interface JobPlacement { + /** Required. The name of the cluster where the job will be submitted. */ + clusterName?: string; + /** Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted. */ + clusterUuid?: string; + } + interface JobReference { + /** + * Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a + * means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). + * The maximum length is 100 characters. + */ + jobId?: string; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId?: string; + } + interface JobScheduling { + /** + * Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported + * failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10. + */ + maxFailuresPerHour?: number; + } + interface JobStatus { + /** Output-only. Optional job state details, such as an error description if the state is ERROR. */ + details?: string; + /** Output-only. A state message specifying the overall job state. */ + state?: string; + /** Output-only. The time when this state was entered. */ + stateStartTime?: string; + /** Output-only. Additional state information, which includes status reported by the agent. */ + substate?: string; + } + interface ListClustersResponse { + /** Output-only. The clusters in the project. */ + clusters?: Cluster[]; + /** + * Output-only. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent ListClustersRequest. + */ + nextPageToken?: string; + } + interface ListJobsResponse { + /** Output-only. Jobs list. */ + jobs?: Job[]; + /** + * Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token + * in a subsequent ListJobsRequest. + */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface LoggingConfig { + /** + * The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = + * INFO', 'org.apache = DEBUG' + */ + driverLogLevels?: Record; + } + interface ManagedGroupConfig { + /** Output-only. The name of the Instance Group Manager for this group. */ + instanceGroupManagerName?: string; + /** Output-only. The name of the Instance Template used for the Managed Instance Group. */ + instanceTemplateName?: string; + } + interface NodeInitializationAction { + /** Required. Google Cloud Storage URI of executable file. */ + executableFile?: string; + /** + * Optional. Amount of time executable has to complete. Default is 10 minutes. Cluster creation fails with an explanatory error message (the name of the + * executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period. + */ + executionTimeout?: string; + } + interface Operation { + /** If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some + * services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should + * have the format of operations/some/unique/name. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response + * should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred + * response type is TakeSnapshotResponse. + */ + response?: Record; + } + interface PigJob { + /** + * Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent + * parallel queries. + */ + continueOnFailure?: boolean; + /** Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code. + */ + properties?: Record; + /** The HCFS URI of the script that contains the Pig queries. */ + queryFileUri?: string; + /** A list of queries. */ + queryList?: QueryList; + /** Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]). */ + scriptVariables?: Record; + } + interface PySparkJob { + /** Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip. */ + archiveUris?: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur + * that causes an incorrect job submission. + */ + args?: string[]; + /** Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks. */ + fileUris?: string[]; + /** Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file. */ + mainPythonFileUri?: string; + /** + * Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties?: Record; + /** Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip. */ + pythonFileUris?: string[]; + } + interface QueryList { + /** + * Required. The queries to execute. You do not need to terminate a query with a semicolon. Multiple queries can be specified in one string by separating + * each with a semicolon. Here is an example of an Cloud Dataproc API snippet that uses a QueryList to specify a HiveJob: + * "hiveJob": { + * "queryList": { + * "queries": [ + * "query1", + * "query2", + * "query3;query4", + * ] + * } + * } + */ + queries?: string[]; + } + interface SoftwareConfig { + /** + * Optional. The version of software inside the cluster. It must match the regular expression [0-9]+\.[0-9]+. If unspecified, it defaults to the latest + * version (see Cloud Dataproc Versioning). + */ + imageVersion?: string; + /** + * Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, such as core:fs.defaultFS. The following + * are supported prefixes and their mappings: + * capacity-scheduler: capacity-scheduler.xml + * core: core-site.xml + * distcp: distcp-default.xml + * hdfs: hdfs-site.xml + * hive: hive-site.xml + * mapred: mapred-site.xml + * pig: pig.properties + * spark: spark-defaults.conf + * yarn: yarn-site.xmlFor more information, see Cluster properties. + */ + properties?: Record; + } + interface SparkJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, + * and .zip. + */ + archiveUris?: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur + * that causes an incorrect job submission. + */ + args?: string[]; + /** Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks. */ + fileUris?: string[]; + /** Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris. */ + mainClass?: string; + /** The HCFS URI of the jar file that contains the main class. */ + mainJarFileUri?: string; + /** + * Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties?: Record; + } + interface SparkSqlJob { + /** Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Cloud + * Dataproc API may be overwritten. + */ + properties?: Record; + /** The HCFS URI of the script that contains SQL queries. */ + queryFileUri?: string; + /** A list of queries. */ + queryList?: QueryList; + /** Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name="value";). */ + scriptVariables?: Record; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface SubmitJobRequest { + /** Required. The job resource. */ + job?: Job; + } + interface YarnApplication { + /** Required. The application name. */ + name?: string; + /** Required. The numerical progress of the application, from 1 to 100. */ + progress?: number; + /** Required. The application state. */ + state?: string; + /** + * Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the + * internal hostname, and requires a proxy server for resolution and, possibly, access. + */ + trackingUrl?: string; + } + interface ClustersResource { + /** Creates a cluster in a project. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a cluster in a project. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation. */ + diagnose(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets the resource representation for a cluster in a project. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all regions/{region}/clusters in a project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where + * field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of + * the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE + * contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; + * space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = + * staging AND labels.starred = * + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. The standard List page size. */ + pageSize?: number; + /** Optional. The standard List page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a cluster in a project. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** + * Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the + * update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: + * { + * "config":{ + * "workerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be + * config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: + * { + * "config":{ + * "secondaryWorkerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Note: Currently, only the following fields can be updated:
+ * + * + *
MaskPurpose
labels Update labels
config.worker_config.num_instances Resize primary worker group
config.secondary_worker_config.num_instances Resize secondary worker group
+ */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface JobsResource { + /** Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets the resource representation for a job in a project. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists regions/{region}/jobs in a project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. */ + clusterName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where + * field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or INACTIVE. + * Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE + * AND labels.env = staging AND labels.starred = * + */ + filter?: string; + /** Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs). */ + jobStateMatcher?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. The number of results to return in each response. */ + pageSize?: number; + /** Optional. The page token, returned by a previous call, to request the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a job in a project. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** + * Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the + * update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. + * Note: Currently, labels is the only field that can be updated. + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Submits a job to a cluster. */ + submit(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If + * the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check + * whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; + * instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name + * binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API + * services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name + * includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection + * id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RegionsResource { + clusters: ClustersResource; + jobs: JobsResource; + operations: OperationsResource; + } + interface ProjectsResource { + regions: RegionsResource; + } + } +} diff --git a/types/gapi.client.dataproc/readme.md b/types/gapi.client.dataproc/readme.md new file mode 100644 index 0000000000..1688149759 --- /dev/null +++ b/types/gapi.client.dataproc/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Google Cloud Dataproc API v1 +Manages Hadoop-based clusters and jobs on Google Cloud Platform. +For detailed description please check [documentation](https://cloud.google.com/dataproc/). + +## Installing + +Install typings for Google Cloud Dataproc API: +``` +npm install @types/gapi.client.dataproc@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dataproc', 'v1', () => { + // now we can use gapi.client.dataproc + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Dataproc API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.dataproc/tsconfig.json b/types/gapi.client.dataproc/tsconfig.json new file mode 100644 index 0000000000..83a765706a --- /dev/null +++ b/types/gapi.client.dataproc/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dataproc-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dataproc/tslint.json b/types/gapi.client.dataproc/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dataproc/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.datastore/gapi.client.datastore-tests.ts b/types/gapi.client.datastore/gapi.client.datastore-tests.ts new file mode 100644 index 0000000000..ce0840ae65 --- /dev/null +++ b/types/gapi.client.datastore/gapi.client.datastore-tests.ts @@ -0,0 +1,64 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('datastore', 'v1', () => { + /** now we can use gapi.client.datastore */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Cloud Datastore data */ + 'https://www.googleapis.com/auth/datastore', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + */ + await gapi.client.projects.allocateIds({ + projectId: "projectId", + }); + /** Begins a new transaction. */ + await gapi.client.projects.beginTransaction({ + projectId: "projectId", + }); + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + */ + await gapi.client.projects.commit({ + projectId: "projectId", + }); + /** Looks up entities by key. */ + await gapi.client.projects.lookup({ + projectId: "projectId", + }); + /** Rolls back a transaction. */ + await gapi.client.projects.rollback({ + projectId: "projectId", + }); + /** Queries for entities. */ + await gapi.client.projects.runQuery({ + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.datastore/index.d.ts b/types/gapi.client.datastore/index.d.ts new file mode 100644 index 0000000000..83c124ce52 --- /dev/null +++ b/types/gapi.client.datastore/index.d.ts @@ -0,0 +1,1027 @@ +// Type definitions for Google Google Cloud Datastore API v1 1.0 +// Project: https://cloud.google.com/datastore/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://datastore.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Datastore API v1 */ + function load(name: "datastore", version: "v1"): PromiseLike; + function load(name: "datastore", version: "v1", callback: () => any): void; + + const projects: datastore.ProjectsResource; + + namespace datastore { + interface AllocateIdsRequest { + /** + * A list of keys with incomplete key paths for which to allocate IDs. + * No key may be reserved/read-only. + */ + keys?: Key[]; + } + interface AllocateIdsResponse { + /** + * The keys specified in the request (in the same order), each with + * its key path completed with a newly allocated ID. + */ + keys?: Key[]; + } + interface ArrayValue { + /** + * Values in the array. + * The order of this array may not be preserved if it contains a mix of + * indexed and unindexed values. + */ + values?: Value[]; + } + interface BeginTransactionRequest { + /** Options for a new transaction. */ + transactionOptions?: TransactionOptions; + } + interface BeginTransactionResponse { + /** The transaction identifier (always present). */ + transaction?: string; + } + interface CommitRequest { + /** The type of commit to perform. Defaults to `TRANSACTIONAL`. */ + mode?: string; + /** + * The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + */ + mutations?: Mutation[]; + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction. + */ + transaction?: string; + } + interface CommitResponse { + /** + * The number of index entries updated during the commit, or zero if none were + * updated. + */ + indexUpdates?: number; + /** + * The result of performing the mutations. + * The i-th mutation result corresponds to the i-th mutation in the request. + */ + mutationResults?: MutationResult[]; + } + interface CompositeFilter { + /** + * The list of filters to combine. + * Must contain at least one filter. + */ + filters?: Filter[]; + /** The operator for combining multiple filters. */ + op?: string; + } + interface Entity { + /** + * The entity's key. + * + * An entity must have a key, unless otherwise documented (for example, + * an entity in `Value.entity_value` may have no key). + * An entity's kind is its key path's last element's kind, + * or null if it has no key. + */ + key?: Key; + /** + * The entity's properties. + * The map's keys are property names. + * A property name matching regex `__.*__` is reserved. + * A reserved property name is forbidden in certain documented contexts. + * The name must not contain more than 500 characters. + * The name cannot be `""`. + */ + properties?: Record; + } + interface EntityResult { + /** + * A cursor that points to the position after the result entity. + * Set only when the `EntityResult` is part of a `QueryResultBatch` message. + */ + cursor?: string; + /** The resulting entity. */ + entity?: Entity; + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. + * + * This field is set for `FULL` entity + * results. + * + * For missing entities in `LookupResponse`, this + * is the version of the snapshot that was used to look up the entity, and it + * is always set except for eventually consistent reads. + */ + version?: string; + } + interface Filter { + /** A composite filter. */ + compositeFilter?: CompositeFilter; + /** A filter on a property. */ + propertyFilter?: PropertyFilter; + } + interface GoogleDatastoreAdminV1beta1CommonMetadata { + /** The time the operation ended, either successfully or otherwise. */ + endTime?: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels?: Record; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType?: string; + /** The time that work began on the operation. */ + startTime?: string; + /** The current state of the Operation. */ + state?: string; + } + interface GoogleDatastoreAdminV1beta1EntityFilter { + /** If empty, then this represents all kinds. */ + kinds?: string[]; + /** + * An empty list represents all namespaces. This is the preferred + * usage for projects that don't use namespaces. + * + * An empty string element represents the default namespace. This should be + * used if the project has data in non-default namespaces, but doesn't want to + * include them. + * Each namespace in this list must be unique. + */ + namespaceIds?: string[]; + } + interface GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { + /** Metadata common to all Datastore Admin operations. */ + common?: GoogleDatastoreAdminV1beta1CommonMetadata; + /** Description of which entities are being exported. */ + entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix + * field. The final output location is provided in + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix?: string; + /** An estimate of the number of bytes processed. */ + progressBytes?: GoogleDatastoreAdminV1beta1Progress; + /** An estimate of the number of entities processed. */ + progressEntities?: GoogleDatastoreAdminV1beta1Progress; + } + interface GoogleDatastoreAdminV1beta1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. + * Only present if the operation completed successfully. + */ + outputUrl?: string; + } + interface GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { + /** Metadata common to all Datastore Admin operations. */ + common?: GoogleDatastoreAdminV1beta1CommonMetadata; + /** Description of which entities are being imported. */ + entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url + * field. + */ + inputUrl?: string; + /** An estimate of the number of bytes processed. */ + progressBytes?: GoogleDatastoreAdminV1beta1Progress; + /** An estimate of the number of entities processed. */ + progressEntities?: GoogleDatastoreAdminV1beta1Progress; + } + interface GoogleDatastoreAdminV1beta1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted?: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated?: string; + } + interface GoogleLongrunningListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: GoogleLongrunningOperation[]; + } + interface GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface GqlQuery { + /** + * When false, the query string must not contain any literals and instead must + * bind all values. For example, + * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + * `SELECT * FROM Kind WHERE a = @value` is. + */ + allowLiterals?: boolean; + /** + * For each non-reserved named binding site in the query string, there must be + * a named parameter with that name, but not necessarily the inverse. + * + * Key must match regex `A-Za-z_$*`, must not match regex + * `__.*__`, and must not be `""`. + */ + namedBindings?: Record; + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. + * + * For each binding site numbered i in `query_string`, there must be an i-th + * numbered parameter. The inverse must also be true. + */ + positionalBindings?: GqlQueryParameter[]; + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + */ + queryString?: string; + } + interface GqlQueryParameter { + /** + * A query cursor. Query cursors are returned in query + * result batches. + */ + cursor?: string; + /** A value parameter. */ + value?: Value; + } + interface Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + */ + partitionId?: PartitionId; + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * + * An entity path is always fully complete: *all* of the entity's ancestors + * are required to be in the path along with the entity identifier itself. + * The only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. + * + * A path can never be empty, and a path can have at most 100 elements. + */ + path?: PathElement[]; + } + interface KindExpression { + /** The name of the kind. */ + name?: string; + } + interface LatLng { + /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ + latitude?: number; + /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ + longitude?: number; + } + interface LookupRequest { + /** Keys of entities to look up. */ + keys?: Key[]; + /** The options for this lookup request. */ + readOptions?: ReadOptions; + } + interface LookupResponse { + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + */ + deferred?: Key[]; + /** + * Entities found as `ResultType.FULL` entities. The order of results in this + * field is undefined and has no relation to the order of the keys in the + * input. + */ + found?: EntityResult[]; + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of results + * in this field is undefined and has no relation to the order of the keys + * in the input. + */ + missing?: EntityResult[]; + } + interface Mutation { + /** + * The version of the entity that this mutation is being applied to. If this + * does not match the current version on the server, the mutation conflicts. + */ + baseVersion?: string; + /** + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + */ + delete?: Key; + /** + * The entity to insert. The entity must not already exist. + * The entity key's final path element may be incomplete. + */ + insert?: Entity; + /** + * The entity to update. The entity must already exist. + * Must have a complete key path. + */ + update?: Entity; + /** + * The entity to upsert. The entity may or may not already exist. + * The entity key's final path element may be incomplete. + */ + upsert?: Entity; + } + interface MutationResult { + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + */ + conflictDetected?: boolean; + /** + * The automatically allocated key. + * Set only when the mutation allocated a key. + */ + key?: Key; + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version will + * be the version of the current entity or, if no entity is present, a version + * that is strictly greater than the version of any previous entity and less + * than the version of any possible future entity. + */ + version?: string; + } + interface PartitionId { + /** If not empty, the ID of the namespace to which the entities belong. */ + namespaceId?: string; + /** The ID of the project to which the entities belong. */ + projectId?: string; + } + interface PathElement { + /** + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + */ + id?: string; + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + kind?: string; + /** + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + name?: string; + } + interface Projection { + /** The property to project. */ + property?: PropertyReference; + } + interface PropertyFilter { + /** The operator to filter by. */ + op?: string; + /** The property to filter by. */ + property?: PropertyReference; + /** The value to compare the property to. */ + value?: Value; + } + interface PropertyOrder { + /** The direction to order by. Defaults to `ASCENDING`. */ + direction?: string; + /** The property to order by. */ + property?: PropertyReference; + } + interface PropertyReference { + /** + * The name of the property. + * If name includes "."s, it may be interpreted as a property name path. + */ + name?: string; + } + interface Query { + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + */ + distinctOn?: PropertyReference[]; + /** + * An ending point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + endCursor?: string; + /** The filter to apply. */ + filter?: Filter; + /** + * The kinds to query (if empty, returns entities of all kinds). + * Currently at most 1 kind may be specified. + */ + kind?: KindExpression[]; + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + */ + limit?: number; + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + */ + offset?: number; + /** The order to apply to the query results (if empty, order is unspecified). */ + order?: PropertyOrder[]; + /** The projection to return. Defaults to returning all properties. */ + projection?: Projection[]; + /** + * A starting point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + startCursor?: string; + } + interface QueryResultBatch { + /** A cursor that points to the position after the last result in the batch. */ + endCursor?: string; + /** The result type for every entity in `entity_results`. */ + entityResultType?: string; + /** The results for this batch. */ + entityResults?: EntityResult[]; + /** The state of the query after the current batch. */ + moreResults?: string; + /** + * A cursor that points to the position after the last skipped result. + * Will be set when `skipped_results` != 0. + */ + skippedCursor?: string; + /** The number of results skipped, typically because of an offset. */ + skippedResults?: number; + /** + * The version number of the snapshot this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * + * In a single transaction, subsequent query result batches for the same query + * can have a greater snapshot version number. Each batch's snapshot version + * is valid for all preceding batches. + * The value will be zero for eventually consistent queries. + */ + snapshotVersion?: string; + } + interface ReadOptions { + /** + * The non-transactional read consistency to use. + * Cannot be set to `STRONG` for global queries. + */ + readConsistency?: string; + /** + * The identifier of the transaction in which to read. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction. + */ + transaction?: string; + } + interface ReadWrite { + /** The transaction identifier of the transaction being retried. */ + previousTransaction?: string; + } + interface RollbackRequest { + /** + * The transaction identifier, returned by a call to + * Datastore.BeginTransaction. + */ + transaction?: string; + } + interface RunQueryRequest { + /** The GQL query to run. */ + gqlQuery?: GqlQuery; + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + */ + partitionId?: PartitionId; + /** The query to run. */ + query?: Query; + /** The options for this query. */ + readOptions?: ReadOptions; + } + interface RunQueryResponse { + /** A batch of query results (always present). */ + batch?: QueryResultBatch; + /** The parsed form of the `GqlQuery` from the request, if it was set. */ + query?: Query; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TransactionOptions { + /** The transaction should only allow reads. */ + readOnly?: any; + /** The transaction should allow both reads and writes. */ + readWrite?: ReadWrite; + } + interface Value { + /** + * An array value. + * Cannot contain another array value. + * A `Value` instance that sets field `array_value` must not set fields + * `meaning` or `exclude_from_indexes`. + */ + arrayValue?: ArrayValue; + /** + * A blob value. + * May have at most 1,000,000 bytes. + * When `exclude_from_indexes` is false, may have at most 1500 bytes. + * In JSON requests, must be base64-encoded. + */ + blobValue?: string; + /** A boolean value. */ + booleanValue?: boolean; + /** A double value. */ + doubleValue?: number; + /** + * An entity value. + * + * - May have no key. + * - May have a key with an incomplete key path. + * - May have a reserved/read-only key. + */ + entityValue?: Entity; + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + */ + excludeFromIndexes?: boolean; + /** A geo point value representing a point on the surface of Earth. */ + geoPointValue?: LatLng; + /** An integer value. */ + integerValue?: string; + /** A key value. */ + keyValue?: Key; + /** The `meaning` field should only be populated for backwards compatibility. */ + meaning?: number; + /** A null value. */ + nullValue?: string; + /** + * A UTF-8 encoded string value. + * When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes. + * Otherwise, may be set to at least 1,000,000 bytes. + */ + stringValue?: string; + /** + * A timestamp value. + * When stored in the Datastore, precise only to microseconds; + * any additional precision is rounded down. + */ + timestampValue?: string; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an Operation.error value with a google.rpc.Status.code of 1, + * corresponding to `Code.CANCELLED`. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + */ + allocateIds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Begins a new transaction. */ + beginTransaction(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + */ + commit(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Looks up entities by key. */ + lookup(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Rolls back a transaction. */ + rollback(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Queries for entities. */ + runQuery(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + operations: OperationsResource; + } + } +} diff --git a/types/gapi.client.datastore/readme.md b/types/gapi.client.datastore/readme.md new file mode 100644 index 0000000000..4a9a9bff5d --- /dev/null +++ b/types/gapi.client.datastore/readme.md @@ -0,0 +1,90 @@ +# TypeScript typings for Google Cloud Datastore API v1 +Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. + +For detailed description please check [documentation](https://cloud.google.com/datastore/). + +## Installing + +Install typings for Google Cloud Datastore API: +``` +npm install @types/gapi.client.datastore@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('datastore', 'v1', () => { + // now we can use gapi.client.datastore + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Cloud Datastore data + 'https://www.googleapis.com/auth/datastore', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Datastore API resources: + +```typescript + +/* +Allocates IDs for the given keys, which is useful for referencing an entity +before it is inserted. +*/ +await gapi.client.projects.allocateIds({ projectId: "projectId", }); + +/* +Begins a new transaction. +*/ +await gapi.client.projects.beginTransaction({ projectId: "projectId", }); + +/* +Commits a transaction, optionally creating, deleting or modifying some +entities. +*/ +await gapi.client.projects.commit({ projectId: "projectId", }); + +/* +Looks up entities by key. +*/ +await gapi.client.projects.lookup({ projectId: "projectId", }); + +/* +Rolls back a transaction. +*/ +await gapi.client.projects.rollback({ projectId: "projectId", }); + +/* +Queries for entities. +*/ +await gapi.client.projects.runQuery({ projectId: "projectId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.datastore/tsconfig.json b/types/gapi.client.datastore/tsconfig.json new file mode 100644 index 0000000000..a84cddd73f --- /dev/null +++ b/types/gapi.client.datastore/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.datastore-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.datastore/tslint.json b/types/gapi.client.datastore/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.datastore/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.deploymentmanager/gapi.client.deploymentmanager-tests.ts b/types/gapi.client.deploymentmanager/gapi.client.deploymentmanager-tests.ts new file mode 100644 index 0000000000..e15cf3611e --- /dev/null +++ b/types/gapi.client.deploymentmanager/gapi.client.deploymentmanager-tests.ts @@ -0,0 +1,154 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('deploymentmanager', 'v2', () => { + /** now we can use gapi.client.deploymentmanager */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** View and manage your Google Cloud Platform management resources and deployment status information */ + 'https://www.googleapis.com/auth/ndev.cloudman', + /** View your Google Cloud Platform management resources and deployment status information */ + 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Cancels and removes the preview currently associated with the deployment. */ + await gapi.client.deployments.cancelPreview({ + deployment: "deployment", + project: "project", + }); + /** Deletes a deployment and all of the resources in the deployment. */ + await gapi.client.deployments.delete({ + deletePolicy: "deletePolicy", + deployment: "deployment", + project: "project", + }); + /** Gets information about a specific deployment. */ + await gapi.client.deployments.get({ + deployment: "deployment", + project: "project", + }); + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + await gapi.client.deployments.getIamPolicy({ + project: "project", + resource: "resource", + }); + /** Creates a deployment and all of the resources described by the deployment manifest. */ + await gapi.client.deployments.insert({ + preview: true, + project: "project", + }); + /** Lists all deployments for a given project. */ + await gapi.client.deployments.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. */ + await gapi.client.deployments.patch({ + createPolicy: "createPolicy", + deletePolicy: "deletePolicy", + deployment: "deployment", + preview: true, + project: "project", + }); + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + await gapi.client.deployments.setIamPolicy({ + project: "project", + resource: "resource", + }); + /** Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. */ + await gapi.client.deployments.stop({ + deployment: "deployment", + project: "project", + }); + /** Returns permissions that a caller has on the specified resource. */ + await gapi.client.deployments.testIamPermissions({ + project: "project", + resource: "resource", + }); + /** Updates a deployment and all of the resources described by the deployment manifest. */ + await gapi.client.deployments.update({ + createPolicy: "createPolicy", + deletePolicy: "deletePolicy", + deployment: "deployment", + preview: true, + project: "project", + }); + /** Gets information about a specific manifest. */ + await gapi.client.manifests.get({ + deployment: "deployment", + manifest: "manifest", + project: "project", + }); + /** Lists all manifests for a given deployment. */ + await gapi.client.manifests.list({ + deployment: "deployment", + filter: "filter", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Gets information about a specific operation. */ + await gapi.client.operations.get({ + operation: "operation", + project: "project", + }); + /** Lists all operations for a project. */ + await gapi.client.operations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Gets information about a single resource. */ + await gapi.client.resources.get({ + deployment: "deployment", + project: "project", + resource: "resource", + }); + /** Lists all resources in a given deployment. */ + await gapi.client.resources.list({ + deployment: "deployment", + filter: "filter", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Lists all resource types for Deployment Manager. */ + await gapi.client.types.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + } +}); diff --git a/types/gapi.client.deploymentmanager/index.d.ts b/types/gapi.client.deploymentmanager/index.d.ts new file mode 100644 index 0000000000..2528111b57 --- /dev/null +++ b/types/gapi.client.deploymentmanager/index.d.ts @@ -0,0 +1,1175 @@ +// Type definitions for Google Google Cloud Deployment Manager API v2 2.0 +// Project: https://cloud.google.com/deployment-manager/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/deploymentmanager/v2/rest + +/// + +declare namespace gapi.client { + /** Load Google Cloud Deployment Manager API v2 */ + function load(name: "deploymentmanager", version: "v2"): PromiseLike; + function load(name: "deploymentmanager", version: "v2", callback: () => any): void; + + const deployments: deploymentmanager.DeploymentsResource; + + const manifests: deploymentmanager.ManifestsResource; + + const operations: deploymentmanager.OperationsResource; + + const resources: deploymentmanager.ResourcesResource; + + const types: deploymentmanager.TypesResource; + + namespace deploymentmanager { + interface AuditConfig { + /** The configuration for logging of each type of permission. */ + auditLogConfigs?: AuditLogConfig[]; + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface AuthorizationLoggingOptions { + /** The type of the permission that was checked. */ + permissionType?: string; + } + interface Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, + * including their conditions, are examined independently. This field is GOOGLE_INTERNAL. + */ + condition?: Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. + * + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */ + role?: string; + } + interface Condition { + /** Trusted attributes supplied by the IAM system. */ + iam?: string; + /** An operator to apply the subject with. */ + op?: string; + /** Trusted attributes discharged by the service. */ + svc?: string; + /** Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. */ + sys?: string; + /** DEPRECATED. Use 'values' instead. */ + value?: string; + /** The objects of the condition. This is mutually exclusive with 'value'. */ + values?: string[]; + } + interface ConfigFile { + /** The contents of the file. */ + content?: string; + } + interface Deployment { + /** An optional user-provided description of the deployment. */ + description?: string; + /** + * Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly + * generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic + * concurrency so that only one request happens at a time. + * + * The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, + * perform a get() request to a deployment. + */ + fingerprint?: string; + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. Timestamp when the deployment was created, in RFC3339 text format . */ + insertTime?: string; + /** + * Map of labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and + * must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters long and must conform to + * the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels?: DeploymentLabelEntry[]; + /** Output only. URL of the manifest representing the last manifest that was successfully deployed. */ + manifest?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Output only. The Operation that most recently ran, or is currently running, on this deployment. */ + operation?: Operation; + /** Output only. Self link for the deployment. */ + selfLink?: string; + /** [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates. */ + target?: TargetConfiguration; + /** Output only. If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here. */ + update?: DeploymentUpdate; + } + interface DeploymentLabelEntry { + key?: string; + value?: string; + } + interface DeploymentUpdate { + /** Output only. An optional user-provided description of the deployment after the current update has been applied. */ + description?: string; + /** + * Output only. Map of labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 + * characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters long + * and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels?: DeploymentUpdateLabelEntry[]; + /** Output only. URL of the manifest representing the update configuration of this deployment. */ + manifest?: string; + } + interface DeploymentUpdateLabelEntry { + key?: string; + value?: string; + } + interface DeploymentsCancelPreviewRequest { + /** + * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to + * perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to + * make a new update request while another user attempts to cancel a preview, this would prevent one of the requests). + * + * The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint?: string; + } + interface DeploymentsListResponse { + /** Output only. The deployments contained in this response. */ + deployments?: Deployment[]; + /** Output only. A token used to continue a truncated list request. */ + nextPageToken?: string; + } + interface DeploymentsStopRequest { + /** + * Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic + * locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update + * request while another user attempts to stop an ongoing update request, this would prevent a collision). + * + * The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint?: string; + } + interface Expr { + /** An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */ + description?: string; + /** + * Textual representation of an expression in Common Expression Language syntax. + * + * The application context of the containing message determines which well-known feature set of CEL is supported. + */ + expression?: string; + /** An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */ + location?: string; + /** An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. */ + title?: string; + } + interface ImportFile { + /** The contents of the file. */ + content?: string; + /** The name of the file. */ + name?: string; + } + interface LogConfig { + /** Cloud audit options. */ + cloudAudit?: LogConfigCloudAuditOptions; + /** Counter options. */ + counter?: LogConfigCounterOptions; + /** Data access options. */ + dataAccess?: LogConfigDataAccessOptions; + } + interface LogConfigCloudAuditOptions { + /** Information used by the Cloud Audit Logging pipeline. */ + authorizationLoggingOptions?: AuthorizationLoggingOptions; + /** The log_name to populate in the Cloud Audit Record. */ + logName?: string; + } + interface LogConfigCounterOptions { + /** The field value to attribute. */ + field?: string; + /** The metric to update. */ + metric?: string; + } + interface LogConfigDataAccessOptions { + /** Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. */ + logMode?: string; + } + interface Manifest { + /** Output only. The YAML configuration for this manifest. */ + config?: ConfigFile; + /** Output only. The fully-expanded configuration file, including any templates and references. */ + expandedConfig?: string; + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. The imported files for this manifest. */ + imports?: ImportFile[]; + /** Output only. Timestamp when the manifest was created, in RFC3339 text format. */ + insertTime?: string; + /** Output only. The YAML layout for this manifest. */ + layout?: string; + /** + * Output only. + * + * The name of the manifest. + */ + name?: string; + /** Output only. Self link for the manifest. */ + selfLink?: string; + } + interface ManifestsListResponse { + /** Output only. Manifests contained in this list response. */ + manifests?: Manifest[]; + /** Output only. A token used to continue a truncated list request. */ + nextPageToken?: string; + } + interface Operation { + /** [Output Only] Reserved for future use. */ + clientOperationId?: string; + /** [Deprecated] This field is deprecated. */ + creationTimestamp?: string; + /** [Output Only] A textual description of the operation, which is set when the operation is created. */ + description?: string; + /** [Output Only] The time that this operation was completed. This value is in RFC3339 text format. */ + endTime?: string; + /** [Output Only] If errors are generated during processing of the operation, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. */ + httpErrorMessage?: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not + * found. + */ + httpErrorStatusCode?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The time that this operation was requested. This value is in RFC3339 text format. */ + insertTime?: string; + /** [Output Only] Type of the resource. Always compute#operation for Operation resources. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] The type of operation, such as insert, update, or delete, and so on. */ + operationType?: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation + * progresses. + */ + progress?: number; + /** [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. */ + startTime?: string; + /** [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. */ + status?: string; + /** [Output Only] An optional textual description of the current status of the operation. */ + statusMessage?: string; + /** [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. */ + targetId?: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk + * that the snapshot was created from. + */ + targetLink?: string; + /** [Output Only] User who requested the operation, for example: user@example.com. */ + user?: string; + /** [Output Only] If warning messages are generated during processing of the operation, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + /** [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. */ + zone?: string; + } + interface OperationsListResponse { + /** Output only. A token used to continue a truncated list request. */ + nextPageToken?: string; + /** Output only. Operations contained in this list response. */ + operations?: Operation[]; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** Associates a list of `members` to a `role`. `bindings` with no members will result in an error. */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly + * suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is + * returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will + * be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** + * If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any + * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no + * rule applies, permission is denied. + */ + rules?: Rule[]; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface Resource { + /** The Access Control Policy set on this resource. */ + accessControl?: ResourceAccessControl; + /** Output only. The evaluated properties of the resource with references expanded. Returned as serialized YAML. */ + finalProperties?: string; + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. Timestamp when the resource was created or acquired, in RFC3339 text format . */ + insertTime?: string; + /** Output only. URL of the manifest representing the current configuration of this resource. */ + manifest?: string; + /** Output only. The name of the resource as it appears in the YAML config. */ + name?: string; + /** Output only. The current properties of the resource before any references have been filled in. Returned as serialized YAML. */ + properties?: string; + /** Output only. The type of the resource, for example compute.v1.instance, or cloudfunctions.v1beta1.function. */ + type?: string; + /** Output only. If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here. */ + update?: ResourceUpdate; + /** Output only. Timestamp when the resource was updated, in RFC3339 text format . */ + updateTime?: string; + /** Output only. The URL of the actual resource. */ + url?: string; + /** Output only. If warning messages are generated during processing of this resource, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + } + interface ResourceAccessControl { + /** The GCP IAM Policy to set on the resource. */ + gcpIamPolicy?: string; + } + interface ResourceUpdate { + /** The Access Control Policy to set on this resource after updating the resource itself. */ + accessControl?: ResourceAccessControl; + /** Output only. If errors are generated during update of the resource, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** Output only. The expanded properties of the resource with reference values expanded. Returned as serialized YAML. */ + finalProperties?: string; + /** Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. */ + intent?: string; + /** Output only. URL of the manifest representing the update configuration of this resource. */ + manifest?: string; + /** Output only. The set of updated properties for this resource, before references are expanded. Returned as serialized YAML. */ + properties?: string; + /** Output only. The state of the resource. */ + state?: string; + /** Output only. If warning messages are generated during processing of this resource, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + } + interface ResourcesListResponse { + /** A token used to continue a truncated list request. */ + nextPageToken?: string; + /** Resources contained in this list response. */ + resources?: Resource[]; + } + interface Rule { + /** Required */ + action?: string; + /** Additional restrictions that must be met. All conditions must pass for the rule to match. */ + conditions?: Condition[]; + /** Human-readable description of the rule. */ + description?: string; + /** If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. */ + ins?: string[]; + /** The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. */ + logConfigs?: LogConfig[]; + /** If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. */ + notIns?: string[]; + /** + * A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions?: string[]; + } + interface TargetConfiguration { + /** The configuration to use for this deployment. */ + config?: ConfigFile; + /** + * Specifies any files to import for this configuration. This can be used to import templates or other files. For example, you might import a text file in + * order to use the file in a template. + */ + imports?: ImportFile[]; + } + interface TestPermissionsRequest { + /** The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. */ + permissions?: string[]; + } + interface TestPermissionsResponse { + /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */ + permissions?: string[]; + } + interface Type { + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. Timestamp when the type was created, in RFC3339 text format. */ + insertTime?: string; + /** Name of the type. */ + name?: string; + /** Output only. The Operation that most recently ran, or is currently running, on this type. */ + operation?: Operation; + /** Output only. Self link for the type. */ + selfLink?: string; + } + interface TypesListResponse { + /** A token used to continue a truncated list request. */ + nextPageToken?: string; + /** Output only. A list of resource types supported by Deployment Manager. */ + types?: Type[]; + } + interface DeploymentsResource { + /** Cancels and removes the preview currently associated with the deployment. */ + cancelPreview(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a deployment and all of the resources in the deployment. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Sets the policy to use for deleting resources. */ + deletePolicy?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets information about a specific deployment. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + getIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a deployment and all of the resources described by the deployment manifest. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what + * your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use + * the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must + * separately delete this deployment if you want to remove it. + */ + preview?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all deployments for a given project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Sets the policy to use for creating new resources. */ + createPolicy?: string; + /** Sets the policy to use for deleting resources. */ + deletePolicy?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This + * allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must + * provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request + * with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview + * and you must separately delete this deployment if you want to remove it. + */ + preview?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + setIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns permissions that a caller has on the specified resource. */ + testIamPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a deployment and all of the resources described by the deployment manifest. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Sets the policy to use for creating new resources. */ + createPolicy?: string; + /** Sets the policy to use for deleting resources. */ + deletePolicy?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This + * allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must + * provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request + * with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview + * and you must separately delete this deployment if you want to remove it. + */ + preview?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManifestsResource { + /** Gets information about a specific manifest. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the manifest for this request. */ + manifest: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all manifests for a given deployment. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OperationsResource { + /** Gets information about a specific operation. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The name of the operation for this request. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all operations for a project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ResourcesResource { + /** Gets information about a single resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all resources in a given deployment. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TypesResource { + /** Lists all resource types for Deployment Manager. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.deploymentmanager/readme.md b/types/gapi.client.deploymentmanager/readme.md new file mode 100644 index 0000000000..b14c3e91e7 --- /dev/null +++ b/types/gapi.client.deploymentmanager/readme.md @@ -0,0 +1,153 @@ +# TypeScript typings for Google Cloud Deployment Manager API v2 +Declares, configures, and deploys complex solutions on Google Cloud Platform. +For detailed description please check [documentation](https://cloud.google.com/deployment-manager/). + +## Installing + +Install typings for Google Cloud Deployment Manager API: +``` +npm install @types/gapi.client.deploymentmanager@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('deploymentmanager', 'v2', () => { + // now we can use gapi.client.deploymentmanager + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // View and manage your Google Cloud Platform management resources and deployment status information + 'https://www.googleapis.com/auth/ndev.cloudman', + + // View your Google Cloud Platform management resources and deployment status information + 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Deployment Manager API resources: + +```typescript + +/* +Cancels and removes the preview currently associated with the deployment. +*/ +await gapi.client.deployments.cancelPreview({ deployment: "deployment", project: "project", }); + +/* +Deletes a deployment and all of the resources in the deployment. +*/ +await gapi.client.deployments.delete({ deployment: "deployment", project: "project", }); + +/* +Gets information about a specific deployment. +*/ +await gapi.client.deployments.get({ deployment: "deployment", project: "project", }); + +/* +Gets the access control policy for a resource. May be empty if no such policy or resource exists. +*/ +await gapi.client.deployments.getIamPolicy({ project: "project", resource: "resource", }); + +/* +Creates a deployment and all of the resources described by the deployment manifest. +*/ +await gapi.client.deployments.insert({ project: "project", }); + +/* +Lists all deployments for a given project. +*/ +await gapi.client.deployments.list({ project: "project", }); + +/* +Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. +*/ +await gapi.client.deployments.patch({ deployment: "deployment", project: "project", }); + +/* +Sets the access control policy on the specified resource. Replaces any existing policy. +*/ +await gapi.client.deployments.setIamPolicy({ project: "project", resource: "resource", }); + +/* +Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. +*/ +await gapi.client.deployments.stop({ deployment: "deployment", project: "project", }); + +/* +Returns permissions that a caller has on the specified resource. +*/ +await gapi.client.deployments.testIamPermissions({ project: "project", resource: "resource", }); + +/* +Updates a deployment and all of the resources described by the deployment manifest. +*/ +await gapi.client.deployments.update({ deployment: "deployment", project: "project", }); + +/* +Gets information about a specific manifest. +*/ +await gapi.client.manifests.get({ deployment: "deployment", manifest: "manifest", project: "project", }); + +/* +Lists all manifests for a given deployment. +*/ +await gapi.client.manifests.list({ deployment: "deployment", project: "project", }); + +/* +Gets information about a specific operation. +*/ +await gapi.client.operations.get({ operation: "operation", project: "project", }); + +/* +Lists all operations for a project. +*/ +await gapi.client.operations.list({ project: "project", }); + +/* +Gets information about a single resource. +*/ +await gapi.client.resources.get({ deployment: "deployment", project: "project", resource: "resource", }); + +/* +Lists all resources in a given deployment. +*/ +await gapi.client.resources.list({ deployment: "deployment", project: "project", }); + +/* +Lists all resource types for Deployment Manager. +*/ +await gapi.client.types.list({ project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.deploymentmanager/tsconfig.json b/types/gapi.client.deploymentmanager/tsconfig.json new file mode 100644 index 0000000000..76527cf87c --- /dev/null +++ b/types/gapi.client.deploymentmanager/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.deploymentmanager-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.deploymentmanager/tslint.json b/types/gapi.client.deploymentmanager/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.deploymentmanager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dfareporting/gapi.client.dfareporting-tests.ts b/types/gapi.client.dfareporting/gapi.client.dfareporting-tests.ts new file mode 100644 index 0000000000..eef00757ac --- /dev/null +++ b/types/gapi.client.dfareporting/gapi.client.dfareporting-tests.ts @@ -0,0 +1,1301 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dfareporting', 'v2.8', () => { + /** now we can use gapi.client.dfareporting */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage DoubleClick Digital Marketing conversions */ + 'https://www.googleapis.com/auth/ddmconversions', + /** View and manage DoubleClick for Advertisers reports */ + 'https://www.googleapis.com/auth/dfareporting', + /** View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns */ + 'https://www.googleapis.com/auth/dfatrafficking', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets the account's active ad summary by account ID. */ + await gapi.client.accountActiveAdSummaries.get({ + profileId: "profileId", + summaryAccountId: "summaryAccountId", + }); + /** Gets one account permission group by ID. */ + await gapi.client.accountPermissionGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves the list of account permission groups. */ + await gapi.client.accountPermissionGroups.list({ + profileId: "profileId", + }); + /** Gets one account permission by ID. */ + await gapi.client.accountPermissions.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves the list of account permissions. */ + await gapi.client.accountPermissions.list({ + profileId: "profileId", + }); + /** Gets one account user profile by ID. */ + await gapi.client.accountUserProfiles.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new account user profile. */ + await gapi.client.accountUserProfiles.insert({ + profileId: "profileId", + }); + /** Retrieves a list of account user profiles, possibly filtered. This method supports paging. */ + await gapi.client.accountUserProfiles.list({ + active: true, + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + userRoleId: "userRoleId", + }); + /** Updates an existing account user profile. This method supports patch semantics. */ + await gapi.client.accountUserProfiles.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing account user profile. */ + await gapi.client.accountUserProfiles.update({ + profileId: "profileId", + }); + /** Gets one account by ID. */ + await gapi.client.accounts.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves the list of accounts, possibly filtered. This method supports paging. */ + await gapi.client.accounts.list({ + active: true, + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing account. This method supports patch semantics. */ + await gapi.client.accounts.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing account. */ + await gapi.client.accounts.update({ + profileId: "profileId", + }); + /** Gets one ad by ID. */ + await gapi.client.ads.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new ad. */ + await gapi.client.ads.insert({ + profileId: "profileId", + }); + /** Retrieves a list of ads, possibly filtered. This method supports paging. */ + await gapi.client.ads.list({ + active: true, + advertiserId: "advertiserId", + archived: true, + audienceSegmentIds: "audienceSegmentIds", + campaignIds: "campaignIds", + compatibility: "compatibility", + creativeIds: "creativeIds", + creativeOptimizationConfigurationIds: "creativeOptimizationConfigurationIds", + dynamicClickTracker: true, + ids: "ids", + landingPageIds: "landingPageIds", + maxResults: 12, + overriddenEventTagId: "overriddenEventTagId", + pageToken: "pageToken", + placementIds: "placementIds", + profileId: "profileId", + remarketingListIds: "remarketingListIds", + searchString: "searchString", + sizeIds: "sizeIds", + sortField: "sortField", + sortOrder: "sortOrder", + sslCompliant: true, + sslRequired: true, + type: "type", + }); + /** Updates an existing ad. This method supports patch semantics. */ + await gapi.client.ads.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing ad. */ + await gapi.client.ads.update({ + profileId: "profileId", + }); + /** Deletes an existing advertiser group. */ + await gapi.client.advertiserGroups.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one advertiser group by ID. */ + await gapi.client.advertiserGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new advertiser group. */ + await gapi.client.advertiserGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of advertiser groups, possibly filtered. This method supports paging. */ + await gapi.client.advertiserGroups.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing advertiser group. This method supports patch semantics. */ + await gapi.client.advertiserGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing advertiser group. */ + await gapi.client.advertiserGroups.update({ + profileId: "profileId", + }); + /** Gets one advertiser by ID. */ + await gapi.client.advertisers.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new advertiser. */ + await gapi.client.advertisers.insert({ + profileId: "profileId", + }); + /** Retrieves a list of advertisers, possibly filtered. This method supports paging. */ + await gapi.client.advertisers.list({ + advertiserGroupIds: "advertiserGroupIds", + floodlightConfigurationIds: "floodlightConfigurationIds", + ids: "ids", + includeAdvertisersWithoutGroupsOnly: true, + maxResults: 5, + onlyParent: true, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + status: "status", + subaccountId: "subaccountId", + }); + /** Updates an existing advertiser. This method supports patch semantics. */ + await gapi.client.advertisers.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing advertiser. */ + await gapi.client.advertisers.update({ + profileId: "profileId", + }); + /** Retrieves a list of browsers. */ + await gapi.client.browsers.list({ + profileId: "profileId", + }); + /** + * Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a + * default ad does not exist already. + */ + await gapi.client.campaignCreativeAssociations.insert({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. */ + await gapi.client.campaignCreativeAssociations.list({ + campaignId: "campaignId", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + sortOrder: "sortOrder", + }); + /** Gets one campaign by ID. */ + await gapi.client.campaigns.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new campaign. */ + await gapi.client.campaigns.insert({ + defaultLandingPageName: "defaultLandingPageName", + defaultLandingPageUrl: "defaultLandingPageUrl", + profileId: "profileId", + }); + /** Retrieves a list of campaigns, possibly filtered. This method supports paging. */ + await gapi.client.campaigns.list({ + advertiserGroupIds: "advertiserGroupIds", + advertiserIds: "advertiserIds", + archived: true, + atLeastOneOptimizationActivity: true, + excludedIds: "excludedIds", + ids: "ids", + maxResults: 7, + overriddenEventTagId: "overriddenEventTagId", + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + }); + /** Updates an existing campaign. This method supports patch semantics. */ + await gapi.client.campaigns.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing campaign. */ + await gapi.client.campaigns.update({ + profileId: "profileId", + }); + /** Gets one change log by ID. */ + await gapi.client.changeLogs.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of change logs. This method supports paging. */ + await gapi.client.changeLogs.list({ + action: "action", + ids: "ids", + maxChangeTime: "maxChangeTime", + maxResults: 4, + minChangeTime: "minChangeTime", + objectIds: "objectIds", + objectType: "objectType", + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + userProfileIds: "userProfileIds", + }); + /** Retrieves a list of cities, possibly filtered. */ + await gapi.client.cities.list({ + countryDartIds: "countryDartIds", + dartIds: "dartIds", + namePrefix: "namePrefix", + profileId: "profileId", + regionDartIds: "regionDartIds", + }); + /** Gets one connection type by ID. */ + await gapi.client.connectionTypes.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of connection types. */ + await gapi.client.connectionTypes.list({ + profileId: "profileId", + }); + /** Deletes an existing content category. */ + await gapi.client.contentCategories.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one content category by ID. */ + await gapi.client.contentCategories.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new content category. */ + await gapi.client.contentCategories.insert({ + profileId: "profileId", + }); + /** Retrieves a list of content categories, possibly filtered. This method supports paging. */ + await gapi.client.contentCategories.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing content category. This method supports patch semantics. */ + await gapi.client.contentCategories.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing content category. */ + await gapi.client.contentCategories.update({ + profileId: "profileId", + }); + /** Inserts conversions. */ + await gapi.client.conversions.batchinsert({ + profileId: "profileId", + }); + /** Updates existing conversions. */ + await gapi.client.conversions.batchupdate({ + profileId: "profileId", + }); + /** Gets one country by ID. */ + await gapi.client.countries.get({ + dartId: "dartId", + profileId: "profileId", + }); + /** Retrieves a list of countries. */ + await gapi.client.countries.list({ + profileId: "profileId", + }); + /** Inserts a new creative asset. */ + await gapi.client.creativeAssets.insert({ + advertiserId: "advertiserId", + profileId: "profileId", + }); + /** Deletes an existing creative field value. */ + await gapi.client.creativeFieldValues.delete({ + creativeFieldId: "creativeFieldId", + id: "id", + profileId: "profileId", + }); + /** Gets one creative field value by ID. */ + await gapi.client.creativeFieldValues.get({ + creativeFieldId: "creativeFieldId", + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative field value. */ + await gapi.client.creativeFieldValues.insert({ + creativeFieldId: "creativeFieldId", + profileId: "profileId", + }); + /** Retrieves a list of creative field values, possibly filtered. This method supports paging. */ + await gapi.client.creativeFieldValues.list({ + creativeFieldId: "creativeFieldId", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing creative field value. This method supports patch semantics. */ + await gapi.client.creativeFieldValues.patch({ + creativeFieldId: "creativeFieldId", + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative field value. */ + await gapi.client.creativeFieldValues.update({ + creativeFieldId: "creativeFieldId", + profileId: "profileId", + }); + /** Deletes an existing creative field. */ + await gapi.client.creativeFields.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one creative field by ID. */ + await gapi.client.creativeFields.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative field. */ + await gapi.client.creativeFields.insert({ + profileId: "profileId", + }); + /** Retrieves a list of creative fields, possibly filtered. This method supports paging. */ + await gapi.client.creativeFields.list({ + advertiserIds: "advertiserIds", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing creative field. This method supports patch semantics. */ + await gapi.client.creativeFields.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative field. */ + await gapi.client.creativeFields.update({ + profileId: "profileId", + }); + /** Gets one creative group by ID. */ + await gapi.client.creativeGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative group. */ + await gapi.client.creativeGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of creative groups, possibly filtered. This method supports paging. */ + await gapi.client.creativeGroups.list({ + advertiserIds: "advertiserIds", + groupNumber: 2, + ids: "ids", + maxResults: 4, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing creative group. This method supports patch semantics. */ + await gapi.client.creativeGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative group. */ + await gapi.client.creativeGroups.update({ + profileId: "profileId", + }); + /** Gets one creative by ID. */ + await gapi.client.creatives.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative. */ + await gapi.client.creatives.insert({ + profileId: "profileId", + }); + /** Retrieves a list of creatives, possibly filtered. This method supports paging. */ + await gapi.client.creatives.list({ + active: true, + advertiserId: "advertiserId", + archived: true, + campaignId: "campaignId", + companionCreativeIds: "companionCreativeIds", + creativeFieldIds: "creativeFieldIds", + ids: "ids", + maxResults: 8, + pageToken: "pageToken", + profileId: "profileId", + renderingIds: "renderingIds", + searchString: "searchString", + sizeIds: "sizeIds", + sortField: "sortField", + sortOrder: "sortOrder", + studioCreativeId: "studioCreativeId", + types: "types", + }); + /** Updates an existing creative. This method supports patch semantics. */ + await gapi.client.creatives.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative. */ + await gapi.client.creatives.update({ + profileId: "profileId", + }); + /** Retrieves list of report dimension values for a list of filters. */ + await gapi.client.dimensionValues.query({ + maxResults: 1, + pageToken: "pageToken", + profileId: "profileId", + }); + /** Gets one directory site contact by ID. */ + await gapi.client.directorySiteContacts.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of directory site contacts, possibly filtered. This method supports paging. */ + await gapi.client.directorySiteContacts.list({ + directorySiteIds: "directorySiteIds", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one directory site by ID. */ + await gapi.client.directorySites.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new directory site. */ + await gapi.client.directorySites.insert({ + profileId: "profileId", + }); + /** Retrieves a list of directory sites, possibly filtered. This method supports paging. */ + await gapi.client.directorySites.list({ + acceptsInStreamVideoPlacements: true, + acceptsInterstitialPlacements: true, + acceptsPublisherPaidPlacements: true, + active: true, + countryId: "countryId", + dfpNetworkCode: "dfpNetworkCode", + ids: "ids", + maxResults: 8, + pageToken: "pageToken", + parentId: "parentId", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Deletes an existing dynamic targeting key. */ + await gapi.client.dynamicTargetingKeys.delete({ + name: "name", + objectId: "objectId", + objectType: "objectType", + profileId: "profileId", + }); + /** + * Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or + * placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + */ + await gapi.client.dynamicTargetingKeys.insert({ + profileId: "profileId", + }); + /** Retrieves a list of dynamic targeting keys. */ + await gapi.client.dynamicTargetingKeys.list({ + advertiserId: "advertiserId", + names: "names", + objectId: "objectId", + objectType: "objectType", + profileId: "profileId", + }); + /** Deletes an existing event tag. */ + await gapi.client.eventTags.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one event tag by ID. */ + await gapi.client.eventTags.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new event tag. */ + await gapi.client.eventTags.insert({ + profileId: "profileId", + }); + /** Retrieves a list of event tags, possibly filtered. */ + await gapi.client.eventTags.list({ + adId: "adId", + advertiserId: "advertiserId", + campaignId: "campaignId", + definitionsOnly: true, + enabled: true, + eventTagTypes: "eventTagTypes", + ids: "ids", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing event tag. This method supports patch semantics. */ + await gapi.client.eventTags.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing event tag. */ + await gapi.client.eventTags.update({ + profileId: "profileId", + }); + /** Retrieves a report file by its report ID and file ID. This method supports media download. */ + await gapi.client.files.get({ + fileId: "fileId", + reportId: "reportId", + }); + /** Lists files for a user profile. */ + await gapi.client.files.list({ + maxResults: 1, + pageToken: "pageToken", + profileId: "profileId", + scope: "scope", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Deletes an existing floodlight activity. */ + await gapi.client.floodlightActivities.delete({ + id: "id", + profileId: "profileId", + }); + /** Generates a tag for a floodlight activity. */ + await gapi.client.floodlightActivities.generatetag({ + floodlightActivityId: "floodlightActivityId", + profileId: "profileId", + }); + /** Gets one floodlight activity by ID. */ + await gapi.client.floodlightActivities.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new floodlight activity. */ + await gapi.client.floodlightActivities.insert({ + profileId: "profileId", + }); + /** Retrieves a list of floodlight activities, possibly filtered. This method supports paging. */ + await gapi.client.floodlightActivities.list({ + advertiserId: "advertiserId", + floodlightActivityGroupIds: "floodlightActivityGroupIds", + floodlightActivityGroupName: "floodlightActivityGroupName", + floodlightActivityGroupTagString: "floodlightActivityGroupTagString", + floodlightActivityGroupType: "floodlightActivityGroupType", + floodlightConfigurationId: "floodlightConfigurationId", + ids: "ids", + maxResults: 8, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + tagString: "tagString", + }); + /** Updates an existing floodlight activity. This method supports patch semantics. */ + await gapi.client.floodlightActivities.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing floodlight activity. */ + await gapi.client.floodlightActivities.update({ + profileId: "profileId", + }); + /** Gets one floodlight activity group by ID. */ + await gapi.client.floodlightActivityGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new floodlight activity group. */ + await gapi.client.floodlightActivityGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. */ + await gapi.client.floodlightActivityGroups.list({ + advertiserId: "advertiserId", + floodlightConfigurationId: "floodlightConfigurationId", + ids: "ids", + maxResults: 4, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + type: "type", + }); + /** Updates an existing floodlight activity group. This method supports patch semantics. */ + await gapi.client.floodlightActivityGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing floodlight activity group. */ + await gapi.client.floodlightActivityGroups.update({ + profileId: "profileId", + }); + /** Gets one floodlight configuration by ID. */ + await gapi.client.floodlightConfigurations.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of floodlight configurations, possibly filtered. */ + await gapi.client.floodlightConfigurations.list({ + ids: "ids", + profileId: "profileId", + }); + /** Updates an existing floodlight configuration. This method supports patch semantics. */ + await gapi.client.floodlightConfigurations.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing floodlight configuration. */ + await gapi.client.floodlightConfigurations.update({ + profileId: "profileId", + }); + /** Gets one inventory item by ID. */ + await gapi.client.inventoryItems.get({ + id: "id", + profileId: "profileId", + projectId: "projectId", + }); + /** Retrieves a list of inventory items, possibly filtered. This method supports paging. */ + await gapi.client.inventoryItems.list({ + ids: "ids", + inPlan: true, + maxResults: 3, + orderId: "orderId", + pageToken: "pageToken", + profileId: "profileId", + projectId: "projectId", + siteId: "siteId", + sortField: "sortField", + sortOrder: "sortOrder", + type: "type", + }); + /** Deletes an existing campaign landing page. */ + await gapi.client.landingPages.delete({ + campaignId: "campaignId", + id: "id", + profileId: "profileId", + }); + /** Gets one campaign landing page by ID. */ + await gapi.client.landingPages.get({ + campaignId: "campaignId", + id: "id", + profileId: "profileId", + }); + /** Inserts a new landing page for the specified campaign. */ + await gapi.client.landingPages.insert({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Retrieves the list of landing pages for the specified campaign. */ + await gapi.client.landingPages.list({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Updates an existing campaign landing page. This method supports patch semantics. */ + await gapi.client.landingPages.patch({ + campaignId: "campaignId", + id: "id", + profileId: "profileId", + }); + /** Updates an existing campaign landing page. */ + await gapi.client.landingPages.update({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Retrieves a list of languages. */ + await gapi.client.languages.list({ + profileId: "profileId", + }); + /** Retrieves a list of metros. */ + await gapi.client.metros.list({ + profileId: "profileId", + }); + /** Gets one mobile carrier by ID. */ + await gapi.client.mobileCarriers.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of mobile carriers. */ + await gapi.client.mobileCarriers.list({ + profileId: "profileId", + }); + /** Gets one operating system version by ID. */ + await gapi.client.operatingSystemVersions.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of operating system versions. */ + await gapi.client.operatingSystemVersions.list({ + profileId: "profileId", + }); + /** Gets one operating system by DART ID. */ + await gapi.client.operatingSystems.get({ + dartId: "dartId", + profileId: "profileId", + }); + /** Retrieves a list of operating systems. */ + await gapi.client.operatingSystems.list({ + profileId: "profileId", + }); + /** Gets one order document by ID. */ + await gapi.client.orderDocuments.get({ + id: "id", + profileId: "profileId", + projectId: "projectId", + }); + /** Retrieves a list of order documents, possibly filtered. This method supports paging. */ + await gapi.client.orderDocuments.list({ + approved: true, + ids: "ids", + maxResults: 3, + orderId: "orderId", + pageToken: "pageToken", + profileId: "profileId", + projectId: "projectId", + searchString: "searchString", + siteId: "siteId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one order by ID. */ + await gapi.client.orders.get({ + id: "id", + profileId: "profileId", + projectId: "projectId", + }); + /** Retrieves a list of orders, possibly filtered. This method supports paging. */ + await gapi.client.orders.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + projectId: "projectId", + searchString: "searchString", + siteId: "siteId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one placement group by ID. */ + await gapi.client.placementGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new placement group. */ + await gapi.client.placementGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of placement groups, possibly filtered. This method supports paging. */ + await gapi.client.placementGroups.list({ + advertiserIds: "advertiserIds", + archived: true, + campaignIds: "campaignIds", + contentCategoryIds: "contentCategoryIds", + directorySiteIds: "directorySiteIds", + ids: "ids", + maxEndDate: "maxEndDate", + maxResults: 8, + maxStartDate: "maxStartDate", + minEndDate: "minEndDate", + minStartDate: "minStartDate", + pageToken: "pageToken", + placementGroupType: "placementGroupType", + placementStrategyIds: "placementStrategyIds", + pricingTypes: "pricingTypes", + profileId: "profileId", + searchString: "searchString", + siteIds: "siteIds", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing placement group. This method supports patch semantics. */ + await gapi.client.placementGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing placement group. */ + await gapi.client.placementGroups.update({ + profileId: "profileId", + }); + /** Deletes an existing placement strategy. */ + await gapi.client.placementStrategies.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one placement strategy by ID. */ + await gapi.client.placementStrategies.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new placement strategy. */ + await gapi.client.placementStrategies.insert({ + profileId: "profileId", + }); + /** Retrieves a list of placement strategies, possibly filtered. This method supports paging. */ + await gapi.client.placementStrategies.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing placement strategy. This method supports patch semantics. */ + await gapi.client.placementStrategies.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing placement strategy. */ + await gapi.client.placementStrategies.update({ + profileId: "profileId", + }); + /** Generates tags for a placement. */ + await gapi.client.placements.generatetags({ + campaignId: "campaignId", + placementIds: "placementIds", + profileId: "profileId", + tagFormats: "tagFormats", + }); + /** Gets one placement by ID. */ + await gapi.client.placements.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new placement. */ + await gapi.client.placements.insert({ + profileId: "profileId", + }); + /** Retrieves a list of placements, possibly filtered. This method supports paging. */ + await gapi.client.placements.list({ + advertiserIds: "advertiserIds", + archived: true, + campaignIds: "campaignIds", + compatibilities: "compatibilities", + contentCategoryIds: "contentCategoryIds", + directorySiteIds: "directorySiteIds", + groupIds: "groupIds", + ids: "ids", + maxEndDate: "maxEndDate", + maxResults: 10, + maxStartDate: "maxStartDate", + minEndDate: "minEndDate", + minStartDate: "minStartDate", + pageToken: "pageToken", + paymentSource: "paymentSource", + placementStrategyIds: "placementStrategyIds", + pricingTypes: "pricingTypes", + profileId: "profileId", + searchString: "searchString", + siteIds: "siteIds", + sizeIds: "sizeIds", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing placement. This method supports patch semantics. */ + await gapi.client.placements.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing placement. */ + await gapi.client.placements.update({ + profileId: "profileId", + }); + /** Gets one platform type by ID. */ + await gapi.client.platformTypes.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of platform types. */ + await gapi.client.platformTypes.list({ + profileId: "profileId", + }); + /** Gets one postal code by ID. */ + await gapi.client.postalCodes.get({ + code: "code", + profileId: "profileId", + }); + /** Retrieves a list of postal codes. */ + await gapi.client.postalCodes.list({ + profileId: "profileId", + }); + /** Gets one project by ID. */ + await gapi.client.projects.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of projects, possibly filtered. This method supports paging. */ + await gapi.client.projects.list({ + advertiserIds: "advertiserIds", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Retrieves a list of regions. */ + await gapi.client.regions.list({ + profileId: "profileId", + }); + /** Gets one remarketing list share by remarketing list ID. */ + await gapi.client.remarketingListShares.get({ + profileId: "profileId", + remarketingListId: "remarketingListId", + }); + /** Updates an existing remarketing list share. This method supports patch semantics. */ + await gapi.client.remarketingListShares.patch({ + profileId: "profileId", + remarketingListId: "remarketingListId", + }); + /** Updates an existing remarketing list share. */ + await gapi.client.remarketingListShares.update({ + profileId: "profileId", + }); + /** Gets one remarketing list by ID. */ + await gapi.client.remarketingLists.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new remarketing list. */ + await gapi.client.remarketingLists.insert({ + profileId: "profileId", + }); + /** Retrieves a list of remarketing lists, possibly filtered. This method supports paging. */ + await gapi.client.remarketingLists.list({ + active: true, + advertiserId: "advertiserId", + floodlightActivityId: "floodlightActivityId", + maxResults: 4, + name: "name", + pageToken: "pageToken", + profileId: "profileId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing remarketing list. This method supports patch semantics. */ + await gapi.client.remarketingLists.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing remarketing list. */ + await gapi.client.remarketingLists.update({ + profileId: "profileId", + }); + /** Deletes a report by its ID. */ + await gapi.client.reports.delete({ + profileId: "profileId", + reportId: "reportId", + }); + /** Retrieves a report by its ID. */ + await gapi.client.reports.get({ + profileId: "profileId", + reportId: "reportId", + }); + /** Creates a report. */ + await gapi.client.reports.insert({ + profileId: "profileId", + }); + /** Retrieves list of reports. */ + await gapi.client.reports.list({ + maxResults: 1, + pageToken: "pageToken", + profileId: "profileId", + scope: "scope", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates a report. This method supports patch semantics. */ + await gapi.client.reports.patch({ + profileId: "profileId", + reportId: "reportId", + }); + /** Runs a report. */ + await gapi.client.reports.run({ + profileId: "profileId", + reportId: "reportId", + synchronous: true, + }); + /** Updates a report. */ + await gapi.client.reports.update({ + profileId: "profileId", + reportId: "reportId", + }); + /** Gets one site by ID. */ + await gapi.client.sites.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new site. */ + await gapi.client.sites.insert({ + profileId: "profileId", + }); + /** Retrieves a list of sites, possibly filtered. This method supports paging. */ + await gapi.client.sites.list({ + acceptsInStreamVideoPlacements: true, + acceptsInterstitialPlacements: true, + acceptsPublisherPaidPlacements: true, + adWordsSite: true, + approved: true, + campaignIds: "campaignIds", + directorySiteIds: "directorySiteIds", + ids: "ids", + maxResults: 9, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + unmappedSite: true, + }); + /** Updates an existing site. This method supports patch semantics. */ + await gapi.client.sites.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing site. */ + await gapi.client.sites.update({ + profileId: "profileId", + }); + /** Gets one size by ID. */ + await gapi.client.sizes.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new size. */ + await gapi.client.sizes.insert({ + profileId: "profileId", + }); + /** Retrieves a list of sizes, possibly filtered. */ + await gapi.client.sizes.list({ + height: 1, + iabStandard: true, + ids: "ids", + profileId: "profileId", + width: 5, + }); + /** Gets one subaccount by ID. */ + await gapi.client.subaccounts.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new subaccount. */ + await gapi.client.subaccounts.insert({ + profileId: "profileId", + }); + /** Gets a list of subaccounts, possibly filtered. This method supports paging. */ + await gapi.client.subaccounts.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing subaccount. This method supports patch semantics. */ + await gapi.client.subaccounts.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing subaccount. */ + await gapi.client.subaccounts.update({ + profileId: "profileId", + }); + /** Gets one remarketing list by ID. */ + await gapi.client.targetableRemarketingLists.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. */ + await gapi.client.targetableRemarketingLists.list({ + active: true, + advertiserId: "advertiserId", + maxResults: 3, + name: "name", + pageToken: "pageToken", + profileId: "profileId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one targeting template by ID. */ + await gapi.client.targetingTemplates.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new targeting template. */ + await gapi.client.targetingTemplates.insert({ + profileId: "profileId", + }); + /** Retrieves a list of targeting templates, optionally filtered. This method supports paging. */ + await gapi.client.targetingTemplates.list({ + advertiserId: "advertiserId", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing targeting template. This method supports patch semantics. */ + await gapi.client.targetingTemplates.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing targeting template. */ + await gapi.client.targetingTemplates.update({ + profileId: "profileId", + }); + /** Gets one user profile by ID. */ + await gapi.client.userProfiles.get({ + profileId: "profileId", + }); + /** Retrieves list of user profiles for a user. */ + await gapi.client.userProfiles.list({ + }); + /** Gets one user role permission group by ID. */ + await gapi.client.userRolePermissionGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Gets a list of all supported user role permission groups. */ + await gapi.client.userRolePermissionGroups.list({ + profileId: "profileId", + }); + /** Gets one user role permission by ID. */ + await gapi.client.userRolePermissions.get({ + id: "id", + profileId: "profileId", + }); + /** Gets a list of user role permissions, possibly filtered. */ + await gapi.client.userRolePermissions.list({ + ids: "ids", + profileId: "profileId", + }); + /** Deletes an existing user role. */ + await gapi.client.userRoles.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one user role by ID. */ + await gapi.client.userRoles.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new user role. */ + await gapi.client.userRoles.insert({ + profileId: "profileId", + }); + /** Retrieves a list of user roles, possibly filtered. This method supports paging. */ + await gapi.client.userRoles.list({ + accountUserRoleOnly: true, + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + }); + /** Updates an existing user role. This method supports patch semantics. */ + await gapi.client.userRoles.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing user role. */ + await gapi.client.userRoles.update({ + profileId: "profileId", + }); + /** Gets one video format by ID. */ + await gapi.client.videoFormats.get({ + id: 1, + profileId: "profileId", + }); + /** Lists available video formats. */ + await gapi.client.videoFormats.list({ + profileId: "profileId", + }); + } +}); diff --git a/types/gapi.client.dfareporting/index.d.ts b/types/gapi.client.dfareporting/index.d.ts new file mode 100644 index 0000000000..e8050193e4 --- /dev/null +++ b/types/gapi.client.dfareporting/index.d.ts @@ -0,0 +1,9850 @@ +// Type definitions for Google DCM/DFA Reporting And Trafficking API v2.8 2.8 +// Project: https://developers.google.com/doubleclick-advertisers/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/dfareporting/v2.8/rest + +/// + +declare namespace gapi.client { + /** Load DCM/DFA Reporting And Trafficking API v2.8 */ + function load(name: "dfareporting", version: "v2.8"): PromiseLike; + function load(name: "dfareporting", version: "v2.8", callback: () => any): void; + + const accountActiveAdSummaries: dfareporting.AccountActiveAdSummariesResource; + + const accountPermissionGroups: dfareporting.AccountPermissionGroupsResource; + + const accountPermissions: dfareporting.AccountPermissionsResource; + + const accountUserProfiles: dfareporting.AccountUserProfilesResource; + + const accounts: dfareporting.AccountsResource; + + const ads: dfareporting.AdsResource; + + const advertiserGroups: dfareporting.AdvertiserGroupsResource; + + const advertisers: dfareporting.AdvertisersResource; + + const browsers: dfareporting.BrowsersResource; + + const campaignCreativeAssociations: dfareporting.CampaignCreativeAssociationsResource; + + const campaigns: dfareporting.CampaignsResource; + + const changeLogs: dfareporting.ChangeLogsResource; + + const cities: dfareporting.CitiesResource; + + const connectionTypes: dfareporting.ConnectionTypesResource; + + const contentCategories: dfareporting.ContentCategoriesResource; + + const conversions: dfareporting.ConversionsResource; + + const countries: dfareporting.CountriesResource; + + const creativeAssets: dfareporting.CreativeAssetsResource; + + const creativeFieldValues: dfareporting.CreativeFieldValuesResource; + + const creativeFields: dfareporting.CreativeFieldsResource; + + const creativeGroups: dfareporting.CreativeGroupsResource; + + const creatives: dfareporting.CreativesResource; + + const dimensionValues: dfareporting.DimensionValuesResource; + + const directorySiteContacts: dfareporting.DirectorySiteContactsResource; + + const directorySites: dfareporting.DirectorySitesResource; + + const dynamicTargetingKeys: dfareporting.DynamicTargetingKeysResource; + + const eventTags: dfareporting.EventTagsResource; + + const files: dfareporting.FilesResource; + + const floodlightActivities: dfareporting.FloodlightActivitiesResource; + + const floodlightActivityGroups: dfareporting.FloodlightActivityGroupsResource; + + const floodlightConfigurations: dfareporting.FloodlightConfigurationsResource; + + const inventoryItems: dfareporting.InventoryItemsResource; + + const landingPages: dfareporting.LandingPagesResource; + + const languages: dfareporting.LanguagesResource; + + const metros: dfareporting.MetrosResource; + + const mobileCarriers: dfareporting.MobileCarriersResource; + + const operatingSystemVersions: dfareporting.OperatingSystemVersionsResource; + + const operatingSystems: dfareporting.OperatingSystemsResource; + + const orderDocuments: dfareporting.OrderDocumentsResource; + + const orders: dfareporting.OrdersResource; + + const placementGroups: dfareporting.PlacementGroupsResource; + + const placementStrategies: dfareporting.PlacementStrategiesResource; + + const placements: dfareporting.PlacementsResource; + + const platformTypes: dfareporting.PlatformTypesResource; + + const postalCodes: dfareporting.PostalCodesResource; + + const projects: dfareporting.ProjectsResource; + + const regions: dfareporting.RegionsResource; + + const remarketingListShares: dfareporting.RemarketingListSharesResource; + + const remarketingLists: dfareporting.RemarketingListsResource; + + const reports: dfareporting.ReportsResource; + + const sites: dfareporting.SitesResource; + + const sizes: dfareporting.SizesResource; + + const subaccounts: dfareporting.SubaccountsResource; + + const targetableRemarketingLists: dfareporting.TargetableRemarketingListsResource; + + const targetingTemplates: dfareporting.TargetingTemplatesResource; + + const userProfiles: dfareporting.UserProfilesResource; + + const userRolePermissionGroups: dfareporting.UserRolePermissionGroupsResource; + + const userRolePermissions: dfareporting.UserRolePermissionsResource; + + const userRoles: dfareporting.UserRolesResource; + + const videoFormats: dfareporting.VideoFormatsResource; + + namespace dfareporting { + interface Account { + /** Account permissions assigned to this account. */ + accountPermissionIds?: string[]; + /** Profile for this account. This is a read-only field that can be left blank. */ + accountProfile?: string; + /** Whether this account is active. */ + active?: boolean; + /** Maximum number of active ads allowed for this account. */ + activeAdsLimitTier?: string; + /** Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions. */ + activeViewOptOut?: boolean; + /** User role permissions available to the user roles of this account. */ + availablePermissionIds?: string[]; + /** ID of the country associated with this account. */ + countryId?: string; + /** + * ID of currency associated with this account. This is a required field. + * Acceptable values are: + * - "1" for USD + * - "2" for GBP + * - "3" for ESP + * - "4" for SEK + * - "5" for CAD + * - "6" for JPY + * - "7" for DEM + * - "8" for AUD + * - "9" for FRF + * - "10" for ITL + * - "11" for DKK + * - "12" for NOK + * - "13" for FIM + * - "14" for ZAR + * - "15" for IEP + * - "16" for NLG + * - "17" for EUR + * - "18" for KRW + * - "19" for TWD + * - "20" for SGD + * - "21" for CNY + * - "22" for HKD + * - "23" for NZD + * - "24" for MYR + * - "25" for BRL + * - "26" for PTE + * - "27" for MXP + * - "28" for CLP + * - "29" for TRY + * - "30" for ARS + * - "31" for PEN + * - "32" for ILS + * - "33" for CHF + * - "34" for VEF + * - "35" for COP + * - "36" for GTQ + * - "37" for PLN + * - "39" for INR + * - "40" for THB + * - "41" for IDR + * - "42" for CZK + * - "43" for RON + * - "44" for HUF + * - "45" for RUB + * - "46" for AED + * - "47" for BGN + * - "48" for HRK + * - "49" for MXN + */ + currencyId?: string; + /** Default placement dimensions for this account. */ + defaultCreativeSizeId?: string; + /** Description of this account. */ + description?: string; + /** ID of this account. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#account". */ + kind?: string; + /** + * Locale of this account. + * Acceptable values are: + * - "cs" (Czech) + * - "de" (German) + * - "en" (English) + * - "en-GB" (English United Kingdom) + * - "es" (Spanish) + * - "fr" (French) + * - "it" (Italian) + * - "ja" (Japanese) + * - "ko" (Korean) + * - "pl" (Polish) + * - "pt-BR" (Portuguese Brazil) + * - "ru" (Russian) + * - "sv" (Swedish) + * - "tr" (Turkish) + * - "zh-CN" (Chinese Simplified) + * - "zh-TW" (Chinese Traditional) + */ + locale?: string; + /** Maximum image size allowed for this account, in kilobytes. Value must be greater than or equal to 1. */ + maximumImageSize?: string; + /** Name of this account. This is a required field, and must be less than 128 characters long and be globally unique. */ + name?: string; + /** Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default. */ + nielsenOcrEnabled?: boolean; + /** Reporting configuration of this account. */ + reportsConfiguration?: ReportsConfiguration; + /** Share Path to Conversion reports with Twitter. */ + shareReportsWithTwitter?: boolean; + /** File size limit in kilobytes of Rich Media teaser creatives. Acceptable values are 1 to 10240, inclusive. */ + teaserSizeLimit?: string; + } + interface AccountActiveAdSummary { + /** ID of the account. */ + accountId?: string; + /** Ads that have been activated for the account */ + activeAds?: string; + /** Maximum number of active ads allowed for the account. */ + activeAdsLimitTier?: string; + /** Ads that can be activated for the account. */ + availableAds?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountActiveAdSummary". */ + kind?: string; + } + interface AccountPermission { + /** + * Account profiles associated with this account permission. + * + * Possible values are: + * - "ACCOUNT_PROFILE_BASIC" + * - "ACCOUNT_PROFILE_STANDARD" + */ + accountProfiles?: string[]; + /** ID of this account permission. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermission". */ + kind?: string; + /** Administrative level required to enable this account permission. */ + level?: string; + /** Name of this account permission. */ + name?: string; + /** Permission group of this account permission. */ + permissionGroupId?: string; + } + interface AccountPermissionGroup { + /** ID of this account permission group. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionGroup". */ + kind?: string; + /** Name of this account permission group. */ + name?: string; + } + interface AccountPermissionGroupsListResponse { + /** Account permission group collection. */ + accountPermissionGroups?: AccountPermissionGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionGroupsListResponse". */ + kind?: string; + } + interface AccountPermissionsListResponse { + /** Account permission collection. */ + accountPermissions?: AccountPermission[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionsListResponse". */ + kind?: string; + } + interface AccountUserProfile { + /** Account ID of the user profile. This is a read-only field that can be left blank. */ + accountId?: string; + /** Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable. */ + active?: boolean; + /** Filter that describes which advertisers are visible to the user profile. */ + advertiserFilter?: ObjectFilter; + /** Filter that describes which campaigns are visible to the user profile. */ + campaignFilter?: ObjectFilter; + /** Comments for this user profile. */ + comments?: string; + /** Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion. */ + email?: string; + /** ID of the user profile. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountUserProfile". */ + kind?: string; + /** + * Locale of the user profile. This is a required field. + * Acceptable values are: + * - "cs" (Czech) + * - "de" (German) + * - "en" (English) + * - "en-GB" (English United Kingdom) + * - "es" (Spanish) + * - "fr" (French) + * - "it" (Italian) + * - "ja" (Japanese) + * - "ko" (Korean) + * - "pl" (Polish) + * - "pt-BR" (Portuguese Brazil) + * - "ru" (Russian) + * - "sv" (Swedish) + * - "tr" (Turkish) + * - "zh-CN" (Chinese Simplified) + * - "zh-TW" (Chinese Traditional) + */ + locale?: string; + /** + * Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any + * of the following characters: "&;"#%,". + */ + name?: string; + /** Filter that describes which sites are visible to the user profile. */ + siteFilter?: ObjectFilter; + /** Subaccount ID of the user profile. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Trafficker type of this user profile. */ + traffickerType?: string; + /** User type of the user profile. This is a read-only field that can be left blank. */ + userAccessType?: string; + /** Filter that describes which user roles are visible to the user profile. */ + userRoleFilter?: ObjectFilter; + /** User role ID of the user profile. This is a required field. */ + userRoleId?: string; + } + interface AccountUserProfilesListResponse { + /** Account user profile collection. */ + accountUserProfiles?: AccountUserProfile[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountUserProfilesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface AccountsListResponse { + /** Account collection. */ + accounts?: Account[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface Activities { + /** List of activity filters. The dimension values need to be all either of type "dfa:activity" or "dfa:activityGroup". */ + filters?: DimensionValue[]; + /** The kind of resource this is, in this case dfareporting#activities. */ + kind?: string; + /** List of names of floodlight activity metrics. */ + metricNames?: string[]; + } + interface Ad { + /** Account ID of this ad. This is a read-only field that can be left blank. */ + accountId?: string; + /** Whether this ad is active. When true, archived must be false. */ + active?: boolean; + /** Advertiser ID of this ad. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this ad is archived. When true, active must be false. */ + archived?: boolean; + /** Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD. */ + audienceSegmentId?: string; + /** Campaign ID of this ad. This is a required field on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER. */ + clickThroughUrl?: ClickThroughUrl; + /** Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative. */ + clickThroughUrlSuffixProperties?: ClickThroughUrlSuffixProperties; + /** Comments for this ad. */ + comments?: string; + /** + * Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on + * mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are only used for existing default ads. New + * mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and default ads created for those placements will be limited to those compatibility + * types. IN_STREAM_VIDEO refers to rendering in-stream video ads developed with the VAST standard. + */ + compatibility?: string; + /** Information about the creation of this ad. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** + * Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for + * a maximum of two assignments. + */ + creativeGroupAssignments?: CreativeGroupAssignment[]; + /** + * Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is + * AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment. + */ + creativeRotation?: CreativeRotation; + /** + * Time and day targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + dayPartTargeting?: DayPartTargeting; + /** Default click-through event tag properties for this ad. */ + defaultClickThroughEventTagProperties?: DefaultClickThroughEventTagProperties; + /** + * Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields + * priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD. + */ + deliverySchedule?: DeliverySchedule; + /** + * Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only + * after insert. + */ + dynamicClickTracker?: boolean; + /** Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion. */ + endTime?: string; + /** Event tag overrides for this ad. */ + eventTagOverrides?: EventTagOverride[]; + /** + * Geographical targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + geoTargeting?: GeoTargeting; + /** ID of this ad. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this ad. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** + * Key-value targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + keyValueTargetingExpression?: KeyValueTargetingExpression; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#ad". */ + kind?: string; + /** + * Language targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + languageTargeting?: LanguageTargeting; + /** Information about the most recent modification of this ad. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this ad. This is a required field and must be less than 256 characters long. */ + name?: string; + /** Placement assignments for this ad. */ + placementAssignments?: PlacementAssignment[]; + /** + * Remarketing list targeting expression for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + remarketingListExpression?: ListTargetingExpression; + /** Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. */ + size?: Size; + /** Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslCompliant?: boolean; + /** Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslRequired?: boolean; + /** Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion. */ + startTime?: string; + /** Subaccount ID of this ad. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** + * Targeting template ID, used to apply preconfigured targeting information to this ad. This cannot be set while any of dayPartTargeting, geoTargeting, + * keyValueTargetingExpression, languageTargeting, remarketingListExpression, or technologyTargeting are set. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + targetingTemplateId?: string; + /** + * Technology platform targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + technologyTargeting?: TechnologyTargeting; + /** Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource). */ + type?: string; + } + interface AdBlockingConfiguration { + /** Click-through URL used by brand-neutral ads. This is a required field when overrideClickThroughUrl is set to true. */ + clickThroughUrl?: string; + /** + * ID of a creative bundle to use for this campaign. If set, brand-neutral ads will select creatives from this bundle. Otherwise, a default transparent + * pixel will be used. + */ + creativeBundleId?: string; + /** + * Whether this campaign has enabled ad blocking. When true, ad blocking is enabled for placements in the campaign, but this may be overridden by site and + * placement settings. When false, ad blocking is disabled for all placements under the campaign, regardless of site and placement settings. + */ + enabled?: boolean; + /** + * Whether the brand-neutral ad's click-through URL comes from the campaign's creative bundle or the override URL. Must be set to true if ad blocking is + * enabled and no creative bundle is configured. + */ + overrideClickThroughUrl?: boolean; + } + interface AdSlot { + /** Comment for this ad slot. */ + comment?: string; + /** + * Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile devices or in mobile apps for regular or + * interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads + * developed with the VAST standard. + */ + compatibility?: string; + /** Height of this ad slot. */ + height?: string; + /** ID of the placement from an external platform that is linked to this ad slot. */ + linkedPlacementId?: string; + /** Name of this ad slot. */ + name?: string; + /** Payment source type of this ad slot. */ + paymentSourceType?: string; + /** Primary ad slot of a roadblock inventory item. */ + primary?: boolean; + /** Width of this ad slot. */ + width?: string; + } + interface AdsListResponse { + /** Ad collection. */ + ads?: Ad[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#adsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface Advertiser { + /** Account ID of this advertiser.This is a read-only field that can be left blank. */ + accountId?: string; + /** + * ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for + * all advertisers in each group. + */ + advertiserGroupId?: string; + /** Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long. */ + clickThroughUrlSuffix?: string; + /** ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns. */ + defaultClickThroughEventTagId?: string; + /** Default email address used in sender field for tag emails. */ + defaultEmail?: string; + /** + * Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left + * blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this + * advertiser, so long as: + * - This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. + * - This advertiser's original floodlight configuration is not already shared with another advertiser. + */ + floodlightConfigurationId?: string; + /** Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. */ + floodlightConfigurationIdDimensionValue?: DimensionValue; + /** ID of this advertiser. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this advertiser. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiser". */ + kind?: string; + /** Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account. */ + name?: string; + /** + * Original floodlight configuration before any sharing occurred. Set the floodlightConfigurationId of this advertiser to + * originalFloodlightConfigurationId to unshare the advertiser's current floodlight configuration. You cannot unshare an advertiser's floodlight + * configuration if the shared configuration has activities associated with any campaign or placement. + */ + originalFloodlightConfigurationId?: string; + /** Status of this advertiser. */ + status?: string; + /** Subaccount ID of this advertiser.This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Suspension status of this advertiser. */ + suspended?: boolean; + } + interface AdvertiserGroup { + /** Account ID of this advertiser group. This is a read-only field that can be left blank. */ + accountId?: string; + /** ID of this advertiser group. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiserGroup". */ + kind?: string; + /** + * Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same + * account. + */ + name?: string; + } + interface AdvertiserGroupsListResponse { + /** Advertiser group collection. */ + advertiserGroups?: AdvertiserGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiserGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface AdvertisersListResponse { + /** Advertiser collection. */ + advertisers?: Advertiser[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertisersListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface AudienceSegment { + /** + * Weight allocated to this segment. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment + * group. Acceptable values are 1 to 1000, inclusive. + */ + allocation?: number; + /** ID of this audience segment. This is a read-only, auto-generated field. */ + id?: string; + /** Name of this audience segment. This is a required field and must be less than 65 characters long. */ + name?: string; + } + interface AudienceSegmentGroup { + /** Audience segments assigned to this group. The number of segments must be between 2 and 100. */ + audienceSegments?: AudienceSegment[]; + /** ID of this audience segment group. This is a read-only, auto-generated field. */ + id?: string; + /** Name of this audience segment group. This is a required field and must be less than 65 characters long. */ + name?: string; + } + interface Browser { + /** ID referring to this grouping of browser and version numbers. This is the ID used for targeting. */ + browserVersionId?: string; + /** DART ID of this browser. This is the ID used when generating reports. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#browser". */ + kind?: string; + /** + * Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be + * used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, + * Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where + * the ad server knows the browser is Firefox but can't tell which version it is. + */ + majorVersion?: string; + /** + * Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An + * asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be + * identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox + * ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is. + */ + minorVersion?: string; + /** Name of this browser. */ + name?: string; + } + interface BrowsersListResponse { + /** Browser collection. */ + browsers?: Browser[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#browsersListResponse". */ + kind?: string; + } + interface Campaign { + /** Account ID of this campaign. This is a read-only field that can be left blank. */ + accountId?: string; + /** Ad blocking settings for this campaign. */ + adBlockingConfiguration?: AdBlockingConfiguration; + /** Additional creative optimization configurations for the campaign. */ + additionalCreativeOptimizationConfigurations?: CreativeOptimizationConfiguration[]; + /** Advertiser group ID of the associated advertiser. */ + advertiserGroupId?: string; + /** Advertiser ID of this campaign. This is a required field. */ + advertiserId?: string; + /** Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this campaign has been archived. */ + archived?: boolean; + /** Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups. */ + audienceSegmentGroups?: AudienceSegmentGroup[]; + /** Billing invoice code included in the DCM client billing invoices associated with the campaign. */ + billingInvoiceCode?: string; + /** Click-through URL suffix override properties for this campaign. */ + clickThroughUrlSuffixProperties?: ClickThroughUrlSuffixProperties; + /** Arbitrary comments about this campaign. Must be less than 256 characters long. */ + comment?: string; + /** Information about the creation of this campaign. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** List of creative group IDs that are assigned to the campaign. */ + creativeGroupIds?: string[]; + /** Creative optimization configuration for the campaign. */ + creativeOptimizationConfiguration?: CreativeOptimizationConfiguration; + /** Click-through event tag ID override properties for this campaign. */ + defaultClickThroughEventTagProperties?: DefaultClickThroughEventTagProperties; + /** + * Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as + * the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. + * The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field. + */ + endDate?: string; + /** Overrides that can be used to activate or deactivate advertiser event tags. */ + eventTagOverrides?: EventTagOverride[]; + /** External ID for this campaign. */ + externalId?: string; + /** ID of this campaign. This is a read-only auto-generated field. */ + id?: string; + /** Dimension value for the ID of this campaign. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaign". */ + kind?: string; + /** Information about the most recent modification of this campaign. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Lookback window settings for the campaign. */ + lookbackConfiguration?: LookbackConfiguration; + /** Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser. */ + name?: string; + /** Whether Nielsen reports are enabled for this campaign. */ + nielsenOcrEnabled?: boolean; + /** + * Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as + * doing so will result in an error. This is a required field. + */ + startDate?: string; + /** Subaccount ID of this campaign. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Campaign trafficker contact emails. */ + traffickerEmails?: string[]; + } + interface CampaignCreativeAssociation { + /** ID of the creative associated with the campaign. This is a required field. */ + creativeId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignCreativeAssociation". */ + kind?: string; + } + interface CampaignCreativeAssociationsListResponse { + /** Campaign creative association collection */ + campaignCreativeAssociations?: CampaignCreativeAssociation[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignCreativeAssociationsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CampaignsListResponse { + /** Campaign collection. */ + campaigns?: Campaign[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface ChangeLog { + /** Account ID of the modified object. */ + accountId?: string; + /** Action which caused the change. */ + action?: string; + /** Time when the object was modified. */ + changeTime?: string; + /** Field name of the object which changed. */ + fieldName?: string; + /** ID of this change log. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#changeLog". */ + kind?: string; + /** New value of the object field. */ + newValue?: string; + /** ID of the object of this change log. The object could be a campaign, placement, ad, or other type. */ + objectId?: string; + /** Object type of the change log. */ + objectType?: string; + /** Old value of the object field. */ + oldValue?: string; + /** Subaccount ID of the modified object. */ + subaccountId?: string; + /** + * Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share + * the same transactionId. + */ + transactionId?: string; + /** ID of the user who modified the object. */ + userProfileId?: string; + /** User profile name of the user who modified the object. */ + userProfileName?: string; + } + interface ChangeLogsListResponse { + /** Change log collection. */ + changeLogs?: ChangeLog[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#changeLogsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CitiesListResponse { + /** City collection. */ + cities?: City[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#citiesListResponse". */ + kind?: string; + } + interface City { + /** Country code of the country to which this city belongs. */ + countryCode?: string; + /** DART ID of the country to which this city belongs. */ + countryDartId?: string; + /** DART ID of this city. This is the ID used for targeting and generating reports. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#city". */ + kind?: string; + /** Metro region code of the metro region (DMA) to which this city belongs. */ + metroCode?: string; + /** ID of the metro region (DMA) to which this city belongs. */ + metroDmaId?: string; + /** Name of this city. */ + name?: string; + /** Region code of the region to which this city belongs. */ + regionCode?: string; + /** DART ID of the region to which this city belongs. */ + regionDartId?: string; + } + interface ClickTag { + /** + * Advertiser event name associated with the click tag. This field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to DISPLAY when + * the primary asset type is not HTML_IMAGE. + */ + eventName?: string; + /** + * Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY creative assets, this field must match the value of the creative asset's + * creativeAssetId.name field. + */ + name?: string; + /** Parameter value for the specified click tag. This field contains a click-through url. */ + value?: string; + } + interface ClickThroughUrl { + /** + * Read-only convenience field representing the actual URL that will be used for this click-through. The URL is computed as follows: + * - If defaultLandingPage is enabled then the campaign's default landing page URL is assigned to this field. + * - If defaultLandingPage is not enabled and a landingPageId is specified then that landing page's URL is assigned to this field. + * - If neither of the above cases apply, then the customClickThroughUrl is assigned to this field. + */ + computedClickThroughUrl?: string; + /** Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset. */ + customClickThroughUrl?: string; + /** Whether the campaign default landing page is used. */ + defaultLandingPage?: boolean; + /** ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false. */ + landingPageId?: string; + } + interface ClickThroughUrlSuffixProperties { + /** Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long. */ + clickThroughUrlSuffix?: string; + /** Whether this entity should override the inherited click-through URL suffix with its own defined value. */ + overrideInheritedSuffix?: boolean; + } + interface CompanionClickThroughOverride { + /** Click-through URL of this companion click-through override. */ + clickThroughUrl?: ClickThroughUrl; + /** ID of the creative for this companion click-through override. */ + creativeId?: string; + } + interface CompanionSetting { + /** Whether companions are disabled for this placement. */ + companionsDisabled?: boolean; + /** Whitelist of companion sizes to be served to this placement. Set this list to null or empty to serve all companion sizes. */ + enabledSizes?: Size[]; + /** Whether to serve only static images as companions. */ + imageOnly?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#companionSetting". */ + kind?: string; + } + interface CompatibleFields { + /** Contains items that are compatible to be selected for a report of type "CROSS_DIMENSION_REACH". */ + crossDimensionReachReportCompatibleFields?: CrossDimensionReachReportCompatibleFields; + /** Contains items that are compatible to be selected for a report of type "FLOODLIGHT". */ + floodlightReportCompatibleFields?: FloodlightReportCompatibleFields; + /** The kind of resource this is, in this case dfareporting#compatibleFields. */ + kind?: string; + /** Contains items that are compatible to be selected for a report of type "PATH_TO_CONVERSION". */ + pathToConversionReportCompatibleFields?: PathToConversionReportCompatibleFields; + /** Contains items that are compatible to be selected for a report of type "REACH". */ + reachReportCompatibleFields?: ReachReportCompatibleFields; + /** Contains items that are compatible to be selected for a report of type "STANDARD". */ + reportCompatibleFields?: ReportCompatibleFields; + } + interface ConnectionType { + /** ID of this connection type. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionType". */ + kind?: string; + /** Name of this connection type. */ + name?: string; + } + interface ConnectionTypesListResponse { + /** Collection of connection types such as broadband and mobile. */ + connectionTypes?: ConnectionType[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionTypesListResponse". */ + kind?: string; + } + interface ContentCategoriesListResponse { + /** Content category collection. */ + contentCategories?: ContentCategory[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#contentCategoriesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface ContentCategory { + /** Account ID of this content category. This is a read-only field that can be left blank. */ + accountId?: string; + /** ID of this content category. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#contentCategory". */ + kind?: string; + /** + * Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same + * account. + */ + name?: string; + } + interface Conversion { + /** Whether the conversion was directed toward children. */ + childDirectedTreatment?: boolean; + /** Custom floodlight variables. */ + customVariables?: CustomFloodlightVariable[]; + /** + * The alphanumeric encrypted user ID. When set, encryptionInfo should also be specified. This field is mutually exclusive with + * encryptedUserIdCandidates[], mobileDeviceId and gclid. This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required field. + */ + encryptedUserId?: string; + /** + * A list of the alphanumeric encrypted user IDs. Any user ID with exposure prior to the conversion timestamp will be used in the inserted conversion. If + * no such user ID is found then the conversion will be rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be specified. This + * field may only be used when calling batchinsert; it is not supported by batchupdate. This field is mutually exclusive with encryptedUserId, + * mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId or gclid is a required field. + */ + encryptedUserIdCandidates?: string[]; + /** Floodlight Activity ID of this conversion. This is a required field. */ + floodlightActivityId?: string; + /** Floodlight Configuration ID of this conversion. This is a required field. */ + floodlightConfigurationId?: string; + /** + * The Google click ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This or encryptedUserId or + * encryptedUserIdCandidates[] or mobileDeviceId is a required field. + */ + gclid?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversion". */ + kind?: string; + /** Whether Limit Ad Tracking is enabled. When set to true, the conversion will be used for reporting but not targeting. This will prevent remarketing. */ + limitAdTracking?: boolean; + /** + * The mobile device ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and gclid. This or encryptedUserId or + * encryptedUserIdCandidates[] or gclid is a required field. + */ + mobileDeviceId?: string; + /** The ordinal of the conversion. Use this field to control how conversions of the same user and day are de-duplicated. This is a required field. */ + ordinal?: string; + /** The quantity of the conversion. */ + quantity?: string; + /** The timestamp of conversion, in Unix epoch micros. This is a required field. */ + timestampMicros?: string; + /** The value of the conversion. */ + value?: number; + } + interface ConversionError { + /** The error code. */ + code?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionError". */ + kind?: string; + /** A description of the error. */ + message?: string; + } + interface ConversionStatus { + /** The original conversion that was inserted or updated. */ + conversion?: Conversion; + /** A list of errors related to this conversion. */ + errors?: ConversionError[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionStatus". */ + kind?: string; + } + interface ConversionsBatchInsertRequest { + /** The set of conversions to insert. */ + conversions?: Conversion[]; + /** + * Describes how encryptedUserId or encryptedUserIdCandidates[] is encrypted. This is a required field if encryptedUserId or encryptedUserIdCandidates[] + * is used. + */ + encryptionInfo?: EncryptionInfo; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchInsertRequest". */ + kind?: string; + } + interface ConversionsBatchInsertResponse { + /** Indicates that some or all conversions failed to insert. */ + hasFailures?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchInsertResponse". */ + kind?: string; + /** The insert status of each conversion. Statuses are returned in the same order that conversions are inserted. */ + status?: ConversionStatus[]; + } + interface ConversionsBatchUpdateRequest { + /** The set of conversions to update. */ + conversions?: Conversion[]; + /** Describes how encryptedUserId is encrypted. This is a required field if encryptedUserId is used. */ + encryptionInfo?: EncryptionInfo; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchUpdateRequest". */ + kind?: string; + } + interface ConversionsBatchUpdateResponse { + /** Indicates that some or all conversions failed to update. */ + hasFailures?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchUpdateResponse". */ + kind?: string; + /** The update status of each conversion. Statuses are returned in the same order that conversions are updated. */ + status?: ConversionStatus[]; + } + interface CountriesListResponse { + /** Country collection. */ + countries?: Country[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#countriesListResponse". */ + kind?: string; + } + interface Country { + /** Country code. */ + countryCode?: string; + /** DART ID of this country. This is the ID used for targeting and generating reports. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#country". */ + kind?: string; + /** Name of this country. */ + name?: string; + /** Whether ad serving supports secure servers in this country. */ + sslEnabled?: boolean; + } + interface Creative { + /** Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types. */ + accountId?: string; + /** Whether the creative is active. Applicable to all creative types. */ + active?: boolean; + /** Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID. */ + adParameters?: string; + /** + * Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact + * the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + adTagKeys?: string[]; + /** Advertiser ID of this creative. This is a required field. Applicable to all creative types. */ + advertiserId?: string; + /** + * Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. + * Applicable to the following creative types: FLASH_INPAGE. + */ + allowScriptAccess?: boolean; + /** Whether the creative is archived. Applicable to all creative types. */ + archived?: boolean; + /** Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. */ + artworkType?: string; + /** Source application where creative was authored. Presently, only DBM authored creatives will have this field set. Applicable to all creative types. */ + authoringSource?: string; + /** Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. */ + authoringTool?: string; + /** Whether images are automatically advanced for image gallery creatives. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. */ + autoAdvanceImages?: boolean; + /** + * The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. + * Applicable to the following creative types: FLASH_INPAGE. + */ + backgroundColor?: string; + /** + * Click-through URL for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary + * asset type is not HTML_IMAGE. + */ + backupImageClickThroughUrl?: string; + /** + * List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies + * are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to + * contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the + * creativeAssets' detected features. Applicable to the following creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not + * HTML_IMAGE. + */ + backupImageFeatures?: string[]; + /** Reporting label used for HTML5 banner backup image. Applicable to the following creative types: DISPLAY when the primary asset type is not HTML_IMAGE. */ + backupImageReportingLabel?: string; + /** + * Target window for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset + * type is not HTML_IMAGE. + */ + backupImageTargetWindow?: TargetWindow; + /** + * Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated + * with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, + * populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly one + * entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with + * the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable + * to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + clickTags?: ClickTag[]; + /** Industry standard ID assigned to creative for reach and frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives. */ + commercialId?: string; + /** + * List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to + * the following creative types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection set to false. + */ + companionCreatives?: string[]; + /** + * Compatibilities associated with this creative. This is a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on + * mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. Only + * pre-existing creatives may have these compatibilities since new creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead. + * IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types. + * + * Acceptable values are: + * - "APP" + * - "APP_INTERSTITIAL" + * - "IN_STREAM_VIDEO" + * - "DISPLAY" + * - "DISPLAY_INTERSTITIAL" + */ + compatibility?: string[]; + /** + * Whether Flash assets associated with the creative need to be automatically converted to HTML5. This flag is enabled by default and users can choose to + * disable it if they don't want the system to generate and use HTML5 asset for this creative. Applicable to the following creative type: FLASH_INPAGE. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + convertFlashToHtml5?: boolean; + /** + * List of counter events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. + * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. + */ + counterCustomEvents?: CreativeCustomEvent[]; + /** Required if dynamicAssetSelection is true. */ + creativeAssetSelection?: CreativeAssetSelection; + /** Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT */ + creativeAssets?: CreativeAsset[]; + /** Creative field assignments for this creative. Applicable to all creative types. */ + creativeFieldAssignments?: CreativeFieldAssignment[]; + /** + * Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having + * to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + customKeyValues?: string[]; + /** + * Set this to true to enable the use of rules to target individual assets in this creative. When set to true creativeAssetSelection must be set. This + * also controls asset-level companions. When this is true, companion creatives should be assigned to creative assets. Learn more. Applicable to + * INSTREAM_VIDEO creatives. + */ + dynamicAssetSelection?: boolean; + /** + * List of exit events configured for the creative. For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from + * clickTags, For DISPLAY, an event is also created from the backupImageReportingLabel. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, + * all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + exitCustomEvents?: CreativeCustomEvent[]; + /** + * OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web + * browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE. + */ + fsCommand?: FsCommand; + /** + * HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is true. Applicable to the following + * creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA. + */ + htmlCode?: string; + /** + * Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: + * FLASH_INPAGE and HTML5_BANNER. + */ + htmlCodeLocked?: boolean; + /** ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types. */ + id?: string; + /** Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creative". */ + kind?: string; + /** Creative last modification information. This is a read-only field. Applicable to all creative types. */ + lastModifiedInfo?: LastModifiedInfo; + /** + * Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + latestTraffickedCreativeId?: string; + /** Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types. */ + name?: string; + /** Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA. */ + overrideCss?: string; + /** Amount of time to play the video before counting a view. Applicable to the following creative types: all INSTREAM_VIDEO. */ + progressOffset?: VideoOffset; + /** + * URL of hosted image or hosted video or another ad tag. For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect URL. The standard for + * a VAST (Video Ad Serving Template) ad response allows for a redirect link to another VAST 2.0 or 3.0 call. This is a required field when applicable. + * Applicable to the following creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT + */ + redirectUrl?: string; + /** ID of current rendering version. This is a read-only field. Applicable to all creative types. */ + renderingId?: string; + /** Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types. */ + renderingIdDimensionValue?: DimensionValue; + /** + * The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + requiredFlashPluginVersion?: string; + /** + * The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative + * types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + requiredFlashVersion?: number; + /** + * Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is + * a required field when applicable; however for IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a primary asset of type HTML_IMAGE, if left + * blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: DISPLAY, + * DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. + */ + size?: Size; + /** Amount of time to play the video before the skip button appears. Applicable to the following creative types: all INSTREAM_VIDEO. */ + skipOffset?: VideoOffset; + /** Whether the user can choose to skip the creative. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. */ + skippable?: boolean; + /** Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types. */ + sslCompliant?: boolean; + /** Whether creative should be treated as SSL compliant even if the system scan shows it's not. Applicable to all creative types. */ + sslOverride?: boolean; + /** + * Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioAdvertiserId?: string; + /** + * Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioCreativeId?: string; + /** + * Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: + * all RICH_MEDIA, and all VPAID. + */ + studioTraffickedCreativeId?: string; + /** + * Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative + * types. + */ + subaccountId?: string; + /** Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA. */ + thirdPartyBackupImageImpressionsUrl?: string; + /** Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA. */ + thirdPartyRichMediaImpressionsUrl?: string; + /** Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. */ + thirdPartyUrls?: ThirdPartyTrackingUrl[]; + /** + * List of timer events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. + * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset is not + * HTML_IMAGE. + */ + timerCustomEvents?: CreativeCustomEvent[]; + /** Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. */ + totalFileSize?: string; + /** + * Type of this creative. This is a required field. Applicable to all creative types. + * + * Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for existing creatives. New creatives should use DISPLAY as a replacement for these types. + */ + type?: string; + /** A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following creative types: INSTREAM_VIDEO and VPAID. */ + universalAdId?: UniversalAdId; + /** + * The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during + * insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the + * version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich + * Media creative merging. Applicable to all creative types. + */ + version?: number; + /** Description of the video ad. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. */ + videoDescription?: string; + /** + * Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all + * VPAID. + */ + videoDuration?: number; + } + interface CreativeAsset { + /** + * Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative type: FLASH_INPAGE. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + actionScript3?: boolean; + /** + * Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative types: + * INSTREAM_VIDEO and all VPAID. + */ + active?: boolean; + /** + * Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: + * RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. + */ + alignment?: string; + /** Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + artworkType?: string; + /** + * Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but + * the following creative types: all REDIRECT and TRACKING_TEXT. + */ + assetIdentifier?: CreativeAssetId; + /** Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA. */ + backupImageExit?: CreativeCustomEvent; + /** Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + bitRate?: number; + /** Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID. */ + childAssetType?: string; + /** + * Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, + * applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + collapsedSize?: Size; + /** + * List of companion creatives assigned to an in-stream video creative asset. Acceptable values include IDs of existing flash and image creatives. + * Applicable to INSTREAM_VIDEO creative type with dynamicAssetSelection set to true. + */ + companionCreativeIds?: string[]; + /** + * Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA. Value must be greater than or + * equal to 0. + */ + customStartTimeValue?: number; + /** + * List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support + * in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: HTML5_BANNER. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + detectedFeatures?: string[]; + /** Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + displayType?: string; + /** + * Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must + * be greater than or equal to 1. + */ + duration?: number; + /** Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA. */ + durationType?: string; + /** Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + expandedDimension?: Size; + /** + * File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and + * TRACKING_TEXT. + */ + fileSize?: string; + /** + * Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + flashVersion?: number; + /** Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA. */ + hideFlashObjects?: boolean; + /** Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA. */ + hideSelectionBoxes?: boolean; + /** Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + horizontallyLocked?: boolean; + /** + * Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all + * REDIRECT and TRACKING_TEXT. + */ + id?: string; + /** Dimension value for the ID of the asset. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + mimeType?: string; + /** + * Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. + * Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + offset?: OffsetPosition; + /** Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA. */ + originalBackup?: boolean; + /** Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA. */ + position?: OffsetPosition; + /** Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + positionLeftUnit?: string; + /** + * Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative + * types: all RICH_MEDIA. + */ + positionTopUnit?: string; + /** Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + progressiveServingUrl?: string; + /** + * Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset + * offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. + */ + pushdown?: boolean; + /** + * Pushdown duration in seconds for an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset + * pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. + * Acceptable values are 0 to 9.99, inclusive. + */ + pushdownDuration?: number; + /** + * Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required + * field. + * PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and + * all VPAID creatives. + * BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. Applicable to DISPLAY when the primary asset type is not + * HTML_IMAGE. + * ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. + * OTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives. + * PARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + * TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + * ALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR_VIDEO creatives. These cannot be + * added or removed within DCM. + * For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID + * creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. + */ + role?: string; + /** + * Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, this + * field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, + * FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + size?: Size; + /** Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. */ + sslCompliant?: boolean; + /** Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA. */ + startTimeType?: string; + /** Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + streamingServingUrl?: string; + /** Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. */ + transparency?: boolean; + /** Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + verticallyLocked?: boolean; + /** Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + videoDuration?: number; + /** + * Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, RICH_MEDIA_IM_EXPAND, + * RICH_MEDIA_DISPLAY_BANNER, and RICH_MEDIA_INPAGE_FLOATING. + */ + windowMode?: string; + /** + * zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT + * one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive. + */ + zIndex?: number; + /** File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. */ + zipFilename?: string; + /** Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. */ + zipFilesize?: string; + } + interface CreativeAssetId { + /** + * Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded + * asset. Characters in the name must be alphanumeric or one of the following: ".-_ ". Spaces are allowed. + */ + name?: string; + /** Type of asset to upload. This is a required field. FLASH and IMAGE are no longer supported for new uploads. All image assets should use HTML_IMAGE. */ + type?: string; + } + interface CreativeAssetMetadata { + /** ID of the creative asset. This is a required field. */ + assetIdentifier?: CreativeAssetId; + /** List of detected click tags for assets. This is a read-only auto-generated field. */ + clickTags?: ClickTag[]; + /** + * List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support + * in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. + */ + detectedFeatures?: string[]; + /** Numeric ID of the asset. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the numeric ID of the asset. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeAssetMetadata". */ + kind?: string; + /** + * Rules validated during code generation that generated a warning. This is a read-only, auto-generated field. + * + * Possible values are: + * - "ADMOB_REFERENCED" + * - "ASSET_FORMAT_UNSUPPORTED_DCM" + * - "ASSET_INVALID" + * - "CLICK_TAG_HARD_CODED" + * - "CLICK_TAG_INVALID" + * - "CLICK_TAG_IN_GWD" + * - "CLICK_TAG_MISSING" + * - "CLICK_TAG_MORE_THAN_ONE" + * - "CLICK_TAG_NON_TOP_LEVEL" + * - "COMPONENT_UNSUPPORTED_DCM" + * - "ENABLER_UNSUPPORTED_METHOD_DCM" + * - "EXTERNAL_FILE_REFERENCED" + * - "FILE_DETAIL_EMPTY" + * - "FILE_TYPE_INVALID" + * - "GWD_PROPERTIES_INVALID" + * - "HTML5_FEATURE_UNSUPPORTED" + * - "LINKED_FILE_NOT_FOUND" + * - "MAX_FLASH_VERSION_11" + * - "MRAID_REFERENCED" + * - "NOT_SSL_COMPLIANT" + * - "ORPHANED_ASSET" + * - "PRIMARY_HTML_MISSING" + * - "SVG_INVALID" + * - "ZIP_INVALID" + */ + warnedValidationRules?: string[]; + } + interface CreativeAssetSelection { + /** + * A creativeAssets[].id. This should refer to one of the parent assets in this creative, and will be served if none of the rules match. This is a + * required field. + */ + defaultAssetId?: string; + /** + * Rules determine which asset will be served to a viewer. Rules will be evaluated in the order in which they are stored in this list. This list must + * contain at least one rule. Applicable to INSTREAM_VIDEO creatives. + */ + rules?: Rule[]; + } + interface CreativeAssignment { + /** Whether this creative assignment is active. When true, the creative will be included in the ad's rotation. */ + active?: boolean; + /** + * Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will + * default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. + */ + applyEventTags?: boolean; + /** Click-through URL of the creative assignment. */ + clickThroughUrl?: ClickThroughUrl; + /** Companion creative overrides for this creative assignment. Applicable to video ads. */ + companionCreativeOverrides?: CompanionClickThroughOverride[]; + /** Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments. */ + creativeGroupAssignments?: CreativeGroupAssignment[]; + /** ID of the creative to be assigned. This is a required field. */ + creativeId?: string; + /** Dimension value for the ID of the creative. This is a read-only, auto-generated field. */ + creativeIdDimensionValue?: DimensionValue; + /** Date and time that the assigned creative should stop serving. Must be later than the start time. */ + endTime?: string; + /** + * Rich media exit overrides for this creative assignment. + * Applicable when the creative type is any of the following: + * - DISPLAY + * - RICH_MEDIA_INPAGE + * - RICH_MEDIA_INPAGE_FLOATING + * - RICH_MEDIA_IM_EXPAND + * - RICH_MEDIA_EXPANDING + * - RICH_MEDIA_INTERSTITIAL_FLOAT + * - RICH_MEDIA_MOBILE_IN_APP + * - RICH_MEDIA_MULTI_FLOATING + * - RICH_MEDIA_PEEL_DOWN + * - VPAID_LINEAR + * - VPAID_NON_LINEAR + */ + richMediaExitOverrides?: RichMediaExitOverride[]; + /** + * Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to 65535, + * inclusive. + */ + sequence?: number; + /** Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslCompliant?: boolean; + /** Date and time that the assigned creative should start serving. */ + startTime?: string; + /** Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. */ + weight?: number; + } + interface CreativeCustomEvent { + /** Unique ID of this event used by DDM Reporting and Data Transfer. This is a read-only field. */ + advertiserCustomEventId?: string; + /** User-entered name for the event. */ + advertiserCustomEventName?: string; + /** Type of the event. This is a read-only field. */ + advertiserCustomEventType?: string; + /** Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion. */ + artworkLabel?: string; + /** Artwork type used by the creative.This is a read-only field. */ + artworkType?: string; + /** Exit URL of the event. This field is used only for exit events. */ + exitUrl?: string; + /** ID of this event. This is a required field and should not be modified after insertion. */ + id?: string; + /** Properties for rich media popup windows. This field is used only for exit events. */ + popupWindowProperties?: PopupWindowProperties; + /** Target type used by the event. */ + targetType?: string; + /** Video reporting ID, used to differentiate multiple videos in a single creative. This is a read-only field. */ + videoReportingId?: string; + } + interface CreativeField { + /** Account ID of this creative field. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this creative field. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** ID of this creative field. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeField". */ + kind?: string; + /** + * Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same + * advertiser. + */ + name?: string; + /** Subaccount ID of this creative field. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface CreativeFieldAssignment { + /** ID of the creative field. */ + creativeFieldId?: string; + /** ID of the creative field value. */ + creativeFieldValueId?: string; + } + interface CreativeFieldValue { + /** ID of this creative field value. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldValue". */ + kind?: string; + /** Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field. */ + value?: string; + } + interface CreativeFieldValuesListResponse { + /** Creative field value collection. */ + creativeFieldValues?: CreativeFieldValue[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldValuesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CreativeFieldsListResponse { + /** Creative field collection. */ + creativeFields?: CreativeField[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CreativeGroup { + /** Account ID of this creative group. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this creative group. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** + * Subgroup of the creative group. Assign your creative groups to a subgroup in order to filter or manage them more easily. This field is required on + * insertion and is read-only after insertion. Acceptable values are 1 to 2, inclusive. + */ + groupNumber?: number; + /** ID of this creative group. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeGroup". */ + kind?: string; + /** + * Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same + * advertiser. + */ + name?: string; + /** Subaccount ID of this creative group. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface CreativeGroupAssignment { + /** ID of the creative group to be assigned. */ + creativeGroupId?: string; + /** Creative group number of the creative group assignment. */ + creativeGroupNumber?: string; + } + interface CreativeGroupsListResponse { + /** Creative group collection. */ + creativeGroups?: CreativeGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CreativeOptimizationConfiguration { + /** ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns. */ + id?: string; + /** Name of this creative optimization config. This is a required field and must be less than 129 characters long. */ + name?: string; + /** List of optimization activities associated with this configuration. */ + optimizationActivitys?: OptimizationActivity[]; + /** Optimization model for this configuration. */ + optimizationModel?: string; + } + interface CreativeRotation { + /** Creative assignments in this creative rotation. */ + creativeAssignments?: CreativeAssignment[]; + /** + * Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. + * If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad. + */ + creativeOptimizationConfigurationId?: string; + /** Type of creative rotation. Can be used to specify whether to use sequential or random rotation. */ + type?: string; + /** Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM. */ + weightCalculationStrategy?: string; + } + interface CreativeSettings { + /** Header text for iFrames for this site. Must be less than or equal to 2000 characters long. */ + iFrameFooter?: string; + /** Header text for iFrames for this site. Must be less than or equal to 2000 characters long. */ + iFrameHeader?: string; + } + interface CreativesListResponse { + /** Creative collection. */ + creatives?: Creative[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CrossDimensionReachReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "breakdown" section of the report. */ + breakdown?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#crossDimensionReachReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Metrics which are compatible to be selected in the "overlapMetricNames" section of the report. */ + overlapMetrics?: Metric[]; + } + interface CustomFloodlightVariable { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#customFloodlightVariable". */ + kind?: string; + /** The type of custom floodlight variable to supply a value for. These map to the "u[1-20]=" in the tags. */ + type?: string; + /** The value of the custom floodlight variable. The length of string must not exceed 50 characters. */ + value?: string; + } + interface CustomRichMediaEvents { + /** List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName. */ + filteredEventIds?: DimensionValue[]; + /** The kind of resource this is, in this case dfareporting#customRichMediaEvents. */ + kind?: string; + } + interface DateRange { + /** The end date of the date range, inclusive. A string of the format: "yyyy-MM-dd". */ + endDate?: string; + /** The kind of resource this is, in this case dfareporting#dateRange. */ + kind?: string; + /** The date range relative to the date of when the report is run. */ + relativeDateRange?: string; + /** The start date of the date range, inclusive. A string of the format: "yyyy-MM-dd". */ + startDate?: string; + } + interface DayPartTargeting { + /** + * Days of the week when the ad will serve. + * + * Acceptable values are: + * - "SUNDAY" + * - "MONDAY" + * - "TUESDAY" + * - "WEDNESDAY" + * - "THURSDAY" + * - "FRIDAY" + * - "SATURDAY" + */ + daysOfWeek?: string[]; + /** + * Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with days of week, in which case the + * ad would serve during these hours on the specified days. For example if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm + * (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive. + */ + hoursOfDay?: number[]; + /** Whether or not to use the user's local time. If false, the America/New York time zone applies. */ + userLocalTime?: boolean; + } + interface DefaultClickThroughEventTagProperties { + /** ID of the click-through event tag to apply to all ads in this entity's scope. */ + defaultClickThroughEventTagId?: string; + /** Whether this entity should override the inherited default click-through event tag with its own defined value. */ + overrideInheritedEventTag?: boolean; + } + interface DeliverySchedule { + /** Limit on the number of times an individual user can be served the ad within a specified period of time. */ + frequencyCap?: FrequencyCap; + /** + * Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it + * has reached its delivery goals. + */ + hardCutoff?: boolean; + /** + * Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of + * 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Acceptable values are 1 to 10, inclusive. + */ + impressionRatio?: string; + /** Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served. */ + priority?: string; + } + interface DfpSettings { + /** DFP network code for this directory site. */ + dfpNetworkCode?: string; + /** DFP network name for this directory site. */ + dfpNetworkName?: string; + /** Whether this directory site accepts programmatic placements. */ + programmaticPlacementAccepted?: boolean; + /** Whether this directory site accepts publisher-paid tags. */ + pubPaidPlacementAccepted?: boolean; + /** Whether this directory site is available only via DoubleClick Publisher Portal. */ + publisherPortalOnly?: boolean; + } + interface Dimension { + /** The kind of resource this is, in this case dfareporting#dimension. */ + kind?: string; + /** The dimension name, e.g. dfa:advertiser */ + name?: string; + } + interface DimensionFilter { + /** The name of the dimension to filter. */ + dimensionName?: string; + /** The kind of resource this is, in this case dfareporting#dimensionFilter. */ + kind?: string; + /** The value of the dimension to filter. */ + value?: string; + } + interface DimensionValue { + /** The name of the dimension. */ + dimensionName?: string; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The ID associated with the value if available. */ + id?: string; + /** The kind of resource this is, in this case dfareporting#dimensionValue. */ + kind?: string; + /** + * Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a + * placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') + * allow a matchType other than EXACT. + */ + matchType?: string; + /** The value of the dimension. */ + value?: string; + } + interface DimensionValueList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The dimension values returned in this response. */ + items?: DimensionValue[]; + /** The kind of list this is, in this case dfareporting#dimensionValueList. */ + kind?: string; + /** + * Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's "pageToken" to the value of this + * field. The page token is only valid for a limited amount of time and should not be persisted. + */ + nextPageToken?: string; + } + interface DimensionValueRequest { + /** The name of the dimension for which values should be requested. */ + dimensionName?: string; + /** The end date of the date range for which to retrieve dimension values. A string of the format "yyyy-MM-dd". */ + endDate?: string; + /** The list of filters by which to filter values. The filters are ANDed. */ + filters?: DimensionFilter[]; + /** The kind of request this is, in this case dfareporting#dimensionValueRequest. */ + kind?: string; + /** The start date of the date range for which to retrieve dimension values. A string of the format "yyyy-MM-dd". */ + startDate?: string; + } + interface DirectorySite { + /** Whether this directory site is active. */ + active?: boolean; + /** Directory site contacts. */ + contactAssignments?: DirectorySiteContactAssignment[]; + /** Country ID of this directory site. This is a read-only field. */ + countryId?: string; + /** + * Currency ID of this directory site. This is a read-only field. + * Possible values are: + * - "1" for USD + * - "2" for GBP + * - "3" for ESP + * - "4" for SEK + * - "5" for CAD + * - "6" for JPY + * - "7" for DEM + * - "8" for AUD + * - "9" for FRF + * - "10" for ITL + * - "11" for DKK + * - "12" for NOK + * - "13" for FIM + * - "14" for ZAR + * - "15" for IEP + * - "16" for NLG + * - "17" for EUR + * - "18" for KRW + * - "19" for TWD + * - "20" for SGD + * - "21" for CNY + * - "22" for HKD + * - "23" for NZD + * - "24" for MYR + * - "25" for BRL + * - "26" for PTE + * - "27" for MXP + * - "28" for CLP + * - "29" for TRY + * - "30" for ARS + * - "31" for PEN + * - "32" for ILS + * - "33" for CHF + * - "34" for VEF + * - "35" for COP + * - "36" for GTQ + * - "37" for PLN + * - "39" for INR + * - "40" for THB + * - "41" for IDR + * - "42" for CZK + * - "43" for RON + * - "44" for HUF + * - "45" for RUB + * - "46" for AED + * - "47" for BGN + * - "48" for HRK + * - "49" for MXN + */ + currencyId?: string; + /** Description of this directory site. This is a read-only field. */ + description?: string; + /** ID of this directory site. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this directory site. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** + * Tag types for regular placements. + * + * Acceptable values are: + * - "STANDARD" + * - "IFRAME_JAVASCRIPT_INPAGE" + * - "INTERNAL_REDIRECT_INPAGE" + * - "JAVASCRIPT_INPAGE" + */ + inpageTagFormats?: string[]; + /** + * Tag types for interstitial placements. + * + * Acceptable values are: + * - "IFRAME_JAVASCRIPT_INTERSTITIAL" + * - "INTERNAL_REDIRECT_INTERSTITIAL" + * - "JAVASCRIPT_INTERSTITIAL" + */ + interstitialTagFormats?: string[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySite". */ + kind?: string; + /** Name of this directory site. */ + name?: string; + /** Parent directory site ID. */ + parentId?: string; + /** Directory site settings. */ + settings?: DirectorySiteSettings; + /** URL of this directory site. */ + url?: string; + } + interface DirectorySiteContact { + /** Address of this directory site contact. */ + address?: string; + /** Email address of this directory site contact. */ + email?: string; + /** First name of this directory site contact. */ + firstName?: string; + /** ID of this directory site contact. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySiteContact". */ + kind?: string; + /** Last name of this directory site contact. */ + lastName?: string; + /** Phone number of this directory site contact. */ + phone?: string; + /** Directory site contact role. */ + role?: string; + /** Title or designation of this directory site contact. */ + title?: string; + /** Directory site contact type. */ + type?: string; + } + interface DirectorySiteContactAssignment { + /** ID of this directory site contact. This is a read-only, auto-generated field. */ + contactId?: string; + /** + * Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set + * to PRIVATE it is visible only to the site. + */ + visibility?: string; + } + interface DirectorySiteContactsListResponse { + /** Directory site contact collection */ + directorySiteContacts?: DirectorySiteContact[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySiteContactsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface DirectorySiteSettings { + /** Whether this directory site has disabled active view creatives. */ + activeViewOptOut?: boolean; + /** Directory site DFP settings. */ + dfpSettings?: DfpSettings; + /** Whether this site accepts in-stream video ads. */ + instreamVideoPlacementAccepted?: boolean; + /** Whether this site accepts interstitial ads. */ + interstitialPlacementAccepted?: boolean; + /** Whether this directory site has disabled Nielsen OCR reach ratings. */ + nielsenOcrOptOut?: boolean; + /** Whether this directory site has disabled generation of Verification ins tags. */ + verificationTagOptOut?: boolean; + /** Whether this directory site has disabled active view for in-stream video creatives. This is a read-only field. */ + videoActiveViewOptOut?: boolean; + } + interface DirectorySitesListResponse { + /** Directory site collection. */ + directorySites?: DirectorySite[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySitesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface DynamicTargetingKey { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKey". */ + kind?: string; + /** + * Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are + * converted to lowercase. + */ + name?: string; + /** ID of the object of this dynamic targeting key. This is a required field. */ + objectId?: string; + /** Type of the object of this dynamic targeting key. This is a required field. */ + objectType?: string; + } + interface DynamicTargetingKeysListResponse { + /** Dynamic targeting key collection. */ + dynamicTargetingKeys?: DynamicTargetingKey[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKeysListResponse". */ + kind?: string; + } + interface EncryptionInfo { + /** The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer. */ + encryptionEntityId?: string; + /** The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer. */ + encryptionEntityType?: string; + /** Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer. */ + encryptionSource?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#encryptionInfo". */ + kind?: string; + } + interface EventTag { + /** Account ID of this event tag. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this event tag. This field or the campaignId field is required on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Campaign ID of this event tag. This field or the advertiserId field is required on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads. */ + enabledByDefault?: boolean; + /** + * Whether to remove this event tag from ads that are trafficked through DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag uses + * a pixel that is unapproved for Ad Exchange bids on one or more networks, such as the Google Display Network. + */ + excludeFromAdxRequests?: boolean; + /** ID of this event tag. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTag". */ + kind?: string; + /** Name of this event tag. This is a required field and must be less than 256 characters long. */ + name?: string; + /** Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites. */ + siteFilterType?: string; + /** Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter. */ + siteIds?: string[]; + /** Whether this tag is SSL-compliant or not. This is a read-only field. */ + sslCompliant?: boolean; + /** Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field. */ + status?: string; + /** Subaccount ID of this event tag. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** + * Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either + * impression or click tracking. This is a required field. + */ + type?: string; + /** + * Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required + * on insertion. + */ + url?: string; + /** + * Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through + * event tags as specified by the event tag type. + */ + urlEscapeLevels?: number; + } + interface EventTagOverride { + /** Whether this override is enabled. */ + enabled?: boolean; + /** ID of this event tag override. This is a read-only, auto-generated field. */ + id?: string; + } + interface EventTagsListResponse { + /** Event tag collection. */ + eventTags?: EventTag[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTagsListResponse". */ + kind?: string; + } + interface File { + /** The date range for which the file has report data. The date range will always be the absolute date range for which the report is run. */ + dateRange?: DateRange; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The filename of the file. */ + fileName?: string; + /** The output format of the report. Only available once the file is available. */ + format?: string; + /** The unique ID of this report file. */ + id?: string; + /** The kind of resource this is, in this case dfareporting#file. */ + kind?: string; + /** The timestamp in milliseconds since epoch when this file was last modified. */ + lastModifiedTime?: string; + /** The ID of the report this file was generated from. */ + reportId?: string; + /** The status of the report file. */ + status?: string; + /** The URLs where the completed report file can be downloaded. */ + urls?: { + /** The URL for downloading the report data through the API. */ + apiUrl?: string; + /** The URL for downloading the report data through a browser. */ + browserUrl?: string; + }; + } + interface FileList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The files returned in this response. */ + items?: File[]; + /** The kind of list this is, in this case dfareporting#fileList. */ + kind?: string; + /** + * Continuation token used to page through files. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. The + * page token is only valid for a limited amount of time and should not be persisted. + */ + nextPageToken?: string; + } + interface Flight { + /** Inventory item flight end date. */ + endDate?: string; + /** Rate or cost of this flight. */ + rateOrCost?: string; + /** Inventory item flight start date. */ + startDate?: string; + /** Units of this flight. */ + units?: string; + } + interface FloodlightActivitiesGenerateTagResponse { + /** Generated tag for this floodlight activity. */ + floodlightActivityTag?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesGenerateTagResponse". */ + kind?: string; + } + interface FloodlightActivitiesListResponse { + /** Floodlight activity collection. */ + floodlightActivities?: FloodlightActivity[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface FloodlightActivity { + /** Account ID of this floodlight activity. This is a read-only field that can be left blank. */ + accountId?: string; + /** + * Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or + * the existing activity's advertiser. + */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** + * Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is + * STANDARD_COUNTING or UNIQUE_COUNTING. + */ + cacheBustingType?: string; + /** Counting method for conversions for this floodlight activity. This is a required field. */ + countingMethod?: string; + /** Dynamic floodlight tags. */ + defaultTags?: FloodlightActivityDynamicTag[]; + /** URL where this tag will be deployed. If specified, must be less than 256 characters long. */ + expectedUrl?: string; + /** Floodlight activity group ID of this floodlight activity. This is a required field. */ + floodlightActivityGroupId?: string; + /** Name of the associated floodlight activity group. This is a read-only field. */ + floodlightActivityGroupName?: string; + /** Tag string of the associated floodlight activity group. This is a read-only field. */ + floodlightActivityGroupTagString?: string; + /** Type of the associated floodlight activity group. This is a read-only field. */ + floodlightActivityGroupType?: string; + /** + * Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's + * floodlight configuration or from the existing activity's floodlight configuration. + */ + floodlightConfigurationId?: string; + /** Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. */ + floodlightConfigurationIdDimensionValue?: DimensionValue; + /** Whether this activity is archived. */ + hidden?: boolean; + /** ID of this floodlight activity. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Whether the image tag is enabled for this activity. */ + imageTagEnabled?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivity". */ + kind?: string; + /** Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes. */ + name?: string; + /** General notes or implementation instructions for the tag. */ + notes?: string; + /** Publisher dynamic floodlight tags. */ + publisherTags?: FloodlightActivityPublisherDynamicTag[]; + /** Whether this tag should use SSL. */ + secure?: boolean; + /** Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags. */ + sslCompliant?: boolean; + /** Whether this floodlight activity must be SSL-compliant. */ + sslRequired?: boolean; + /** Subaccount ID of this floodlight activity. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Tag format type for the floodlight activity. If left blank, the tag format will default to HTML. */ + tagFormat?: string; + /** + * Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will + * be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be + * unique among activities of the same activity group. This field is read-only after insertion. + */ + tagString?: string; + /** + * List of the user-defined variables used by this conversion tag. These map to the "u[1-100]=" in the tags. Each of these can have a user defined type. + * Acceptable values are U1 to U100, inclusive. + */ + userDefinedVariableTypes?: string[]; + } + interface FloodlightActivityDynamicTag { + /** ID of this dynamic tag. This is a read-only, auto-generated field. */ + id?: string; + /** Name of this tag. */ + name?: string; + /** Tag code. */ + tag?: string; + } + interface FloodlightActivityGroup { + /** Account ID of this floodlight activity group. This is a read-only field that can be left blank. */ + accountId?: string; + /** + * Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's + * advertiser or from the existing activity group's advertiser. + */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Floodlight configuration ID of this floodlight activity group. This is a required field. */ + floodlightConfigurationId?: string; + /** Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. */ + floodlightConfigurationIdDimensionValue?: DimensionValue; + /** ID of this floodlight activity group. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivityGroup". */ + kind?: string; + /** Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes. */ + name?: string; + /** Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** + * Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is + * optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being + * [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after + * insertion. + */ + tagString?: string; + /** Type of the floodlight activity group. This is a required field that is read-only after insertion. */ + type?: string; + } + interface FloodlightActivityGroupsListResponse { + /** Floodlight activity group collection. */ + floodlightActivityGroups?: FloodlightActivityGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivityGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface FloodlightActivityPublisherDynamicTag { + /** Whether this tag is applicable only for click-throughs. */ + clickThrough?: boolean; + /** + * Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is + * retrieved, only the siteId field will be populated. + */ + directorySiteId?: string; + /** Dynamic floodlight tag. */ + dynamicTag?: FloodlightActivityDynamicTag; + /** Site ID of this dynamic tag. */ + siteId?: string; + /** Dimension value for the ID of the site. This is a read-only, auto-generated field. */ + siteIdDimensionValue?: DimensionValue; + /** Whether this tag is applicable only for view-throughs. */ + viewThrough?: boolean; + } + interface FloodlightConfiguration { + /** Account ID of this floodlight configuration. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of the parent advertiser of this floodlight configuration. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether advertiser data is shared with Google Analytics. */ + analyticsDataSharingEnabled?: boolean; + /** + * Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen + * by a user before converting. + */ + exposureToConversionEnabled?: boolean; + /** Day that will be counted as the first day of the week in reports. This is a required field. */ + firstDayOfWeek?: string; + /** ID of this floodlight configuration. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Whether in-app attribution tracking is enabled. */ + inAppAttributionTrackingEnabled?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightConfiguration". */ + kind?: string; + /** Lookback window settings for this floodlight configuration. */ + lookbackConfiguration?: LookbackConfiguration; + /** Types of attribution options for natural search conversions. */ + naturalSearchConversionAttributionOption?: string; + /** Settings for DCM Omniture integration. */ + omnitureSettings?: OmnitureSettings; + /** Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Configuration settings for dynamic and image floodlight tags. */ + tagSettings?: TagSettings; + /** List of third-party authentication tokens enabled for this configuration. */ + thirdPartyAuthenticationTokens?: ThirdPartyAuthenticationToken[]; + /** List of user defined variables enabled for this configuration. */ + userDefinedVariableConfigurations?: UserDefinedVariableConfiguration[]; + } + interface FloodlightConfigurationsListResponse { + /** Floodlight configuration collection. */ + floodlightConfigurations?: FloodlightConfiguration[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightConfigurationsListResponse". */ + kind?: string; + } + interface FloodlightReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensions" section of the report. */ + dimensions?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#floodlightReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + } + interface FrequencyCap { + /** Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days. Acceptable values are 1 to 7776000, inclusive. */ + duration?: string; + /** Number of times an individual user can be served the ad within the specified duration. Acceptable values are 1 to 15, inclusive. */ + impressions?: string; + } + interface FsCommand { + /** Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. */ + left?: number; + /** Position in the browser where the window will open. */ + positionOption?: string; + /** Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. */ + top?: number; + /** Height of the window. */ + windowHeight?: number; + /** Width of the window. */ + windowWidth?: number; + } + interface GeoTargeting { + /** + * Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If + * targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city. + */ + cities?: City[]; + /** + * Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. + * The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, + * metros, or postal codes in the same country. + */ + countries?: Country[]; + /** + * Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted + * by the ad. + */ + excludeCountries?: boolean; + /** + * Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If + * targeting a metro, do not target or exclude the country of the metro. + */ + metros?: Metro[]; + /** + * Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. + * If targeting a postal code, do not target or exclude the country of the postal code. + */ + postalCodes?: PostalCode[]; + /** + * Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If + * targeting a region, do not target or exclude the country of the region. + */ + regions?: Region[]; + } + interface InventoryItem { + /** Account ID of this inventory item. */ + accountId?: string; + /** + * Ad slots of this inventory item. If this inventory item represents a standalone placement, there will be exactly one ad slot. If this inventory item + * represents a placement group, there will be more than one ad slot, each representing one child placement in that placement group. + */ + adSlots?: AdSlot[]; + /** Advertiser ID of this inventory item. */ + advertiserId?: string; + /** Content category ID of this inventory item. */ + contentCategoryId?: string; + /** Estimated click-through rate of this inventory item. */ + estimatedClickThroughRate?: string; + /** Estimated conversion rate of this inventory item. */ + estimatedConversionRate?: string; + /** ID of this inventory item. */ + id?: string; + /** Whether this inventory item is in plan. */ + inPlan?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#inventoryItem". */ + kind?: string; + /** Information about the most recent modification of this inventory item. */ + lastModifiedInfo?: LastModifiedInfo; + /** + * Name of this inventory item. For standalone inventory items, this is the same name as that of its only ad slot. For group inventory items, this can + * differ from the name of any of its ad slots. + */ + name?: string; + /** Negotiation channel ID of this inventory item. */ + negotiationChannelId?: string; + /** Order ID of this inventory item. */ + orderId?: string; + /** Placement strategy ID of this inventory item. */ + placementStrategyId?: string; + /** Pricing of this inventory item. */ + pricing?: Pricing; + /** Project ID of this inventory item. */ + projectId?: string; + /** RFP ID of this inventory item. */ + rfpId?: string; + /** ID of the site this inventory item is associated with. */ + siteId?: string; + /** Subaccount ID of this inventory item. */ + subaccountId?: string; + /** Type of inventory item. */ + type?: string; + } + interface InventoryItemsListResponse { + /** Inventory item collection */ + inventoryItems?: InventoryItem[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#inventoryItemsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface KeyValueTargetingExpression { + /** Keyword expression being targeted by the ad. */ + expression?: string; + } + interface LandingPage { + /** + * Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing + * page is allowed per campaign. + */ + default?: boolean; + /** ID of this landing page. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#landingPage". */ + kind?: string; + /** + * Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same + * campaign. + */ + name?: string; + /** URL of this landing page. This is a required field. */ + url?: string; + } + interface LandingPagesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#landingPagesListResponse". */ + kind?: string; + /** Landing page collection */ + landingPages?: LandingPage[]; + } + interface Language { + /** Language ID of this language. This is the ID used for targeting and generating reports. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#language". */ + kind?: string; + /** + * Format of language code is an ISO 639 two-letter language code optionally followed by an underscore followed by an ISO 3166 code. Examples are "en" for + * English or "zh_CN" for Simplified Chinese. + */ + languageCode?: string; + /** Name of this language. */ + name?: string; + } + interface LanguageTargeting { + /** + * Languages that this ad targets. For each language only languageId is required. The other fields are populated automatically when the ad is inserted or + * updated. + */ + languages?: Language[]; + } + interface LanguagesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#languagesListResponse". */ + kind?: string; + /** Language collection. */ + languages?: Language[]; + } + interface LastModifiedInfo { + /** Timestamp of the last change in milliseconds since epoch. */ + time?: string; + } + interface ListPopulationClause { + /** Terms of this list population clause. Each clause is made up of list population terms representing constraints and are joined by ORs. */ + terms?: ListPopulationTerm[]; + } + interface ListPopulationRule { + /** Floodlight activity ID associated with this rule. This field can be left blank. */ + floodlightActivityId?: string; + /** Name of floodlight activity associated with this rule. This is a read-only, auto-generated field. */ + floodlightActivityName?: string; + /** + * Clauses that make up this list population rule. Clauses are joined by ANDs, and the clauses themselves are made up of list population terms which are + * joined by ORs. + */ + listPopulationClauses?: ListPopulationClause[]; + } + interface ListPopulationTerm { + /** + * Will be true if the term should check if the user is in the list and false if the term should check if the user is not in the list. This field is only + * relevant when type is set to LIST_MEMBERSHIP_TERM. False by default. + */ + contains?: boolean; + /** + * Whether to negate the comparison result of this term during rule evaluation. This field is only relevant when type is left unset or set to + * CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + negation?: boolean; + /** Comparison operator of this term. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. */ + operator?: string; + /** ID of the list in question. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. */ + remarketingListId?: string; + /** + * List population term type determines the applicable fields in this object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, + * variableFriendlyName, operator, value, and negation are applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. + * If set to REFERRER_TERM then operator, value, and negation are applicable. + */ + type?: string; + /** Literal to compare the variable to. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. */ + value?: string; + /** + * Friendly name of this term's variable. This is a read-only, auto-generated field. This field is only relevant when type is left unset or set to + * CUSTOM_VARIABLE_TERM. + */ + variableFriendlyName?: string; + /** + * Name of the variable (U1, U2, etc.) being compared in this term. This field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or + * REFERRER_TERM. + */ + variableName?: string; + } + interface ListTargetingExpression { + /** Expression describing which lists are being targeted by the ad. */ + expression?: string; + } + interface LookbackConfiguration { + /** + * Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering + * events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, + * inclusive. + */ + clickDuration?: number; + /** + * Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering + * events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, + * inclusive. + */ + postImpressionActivitiesDuration?: number; + } + interface Metric { + /** The kind of resource this is, in this case dfareporting#metric. */ + kind?: string; + /** The metric name, e.g. dfa:impressions */ + name?: string; + } + interface Metro { + /** Country code of the country to which this metro region belongs. */ + countryCode?: string; + /** DART ID of the country to which this metro region belongs. */ + countryDartId?: string; + /** DART ID of this metro region. */ + dartId?: string; + /** DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code. */ + dmaId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#metro". */ + kind?: string; + /** Metro code of this metro region. This is equivalent to dma_id. */ + metroCode?: string; + /** Name of this metro region. */ + name?: string; + } + interface MetrosListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#metrosListResponse". */ + kind?: string; + /** Metro collection. */ + metros?: Metro[]; + } + interface MobileCarrier { + /** Country code of the country to which this mobile carrier belongs. */ + countryCode?: string; + /** DART ID of the country to which this mobile carrier belongs. */ + countryDartId?: string; + /** ID of this mobile carrier. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarrier". */ + kind?: string; + /** Name of this mobile carrier. */ + name?: string; + } + interface MobileCarriersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarriersListResponse". */ + kind?: string; + /** Mobile carrier collection. */ + mobileCarriers?: MobileCarrier[]; + } + interface ObjectFilter { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#objectFilter". */ + kind?: string; + /** Applicable when status is ASSIGNED. The user has access to objects with these object IDs. */ + objectIds?: string[]; + /** + * Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has + * access to the objects with IDs in the objectIds list. + */ + status?: string; + } + interface OffsetPosition { + /** Offset distance from left side of an asset or a window. */ + left?: number; + /** Offset distance from top side of an asset or a window. */ + top?: number; + } + interface OmnitureSettings { + /** Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true. */ + omnitureCostDataEnabled?: boolean; + /** Whether Omniture integration is enabled. This property can be enabled only when the "Advanced Ad Serving" account setting is enabled. */ + omnitureIntegrationEnabled?: boolean; + } + interface OperatingSystem { + /** DART ID of this operating system. This is the ID used for targeting. */ + dartId?: string; + /** Whether this operating system is for desktop. */ + desktop?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystem". */ + kind?: string; + /** Whether this operating system is for mobile. */ + mobile?: boolean; + /** Name of this operating system. */ + name?: string; + } + interface OperatingSystemVersion { + /** ID of this operating system version. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersion". */ + kind?: string; + /** Major version (leftmost number) of this operating system version. */ + majorVersion?: string; + /** Minor version (number after the first dot) of this operating system version. */ + minorVersion?: string; + /** Name of this operating system version. */ + name?: string; + /** Operating system of this operating system version. */ + operatingSystem?: OperatingSystem; + } + interface OperatingSystemVersionsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersionsListResponse". */ + kind?: string; + /** Operating system version collection. */ + operatingSystemVersions?: OperatingSystemVersion[]; + } + interface OperatingSystemsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemsListResponse". */ + kind?: string; + /** Operating system collection. */ + operatingSystems?: OperatingSystem[]; + } + interface OptimizationActivity { + /** Floodlight activity ID of this optimization activity. This is a required field. */ + floodlightActivityId?: string; + /** Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field. */ + floodlightActivityIdDimensionValue?: DimensionValue; + /** + * Weight associated with this optimization. The weight assigned will be understood in proportion to the weights assigned to the other optimization + * activities. Value must be greater than or equal to 1. + */ + weight?: number; + } + interface Order { + /** Account ID of this order. */ + accountId?: string; + /** Advertiser ID of this order. */ + advertiserId?: string; + /** IDs for users that have to approve documents created for this order. */ + approverUserProfileIds?: string[]; + /** Buyer invoice ID associated with this order. */ + buyerInvoiceId?: string; + /** Name of the buyer organization. */ + buyerOrganizationName?: string; + /** Comments in this order. */ + comments?: string; + /** Contacts for this order. */ + contacts?: OrderContact[]; + /** ID of this order. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#order". */ + kind?: string; + /** Information about the most recent modification of this order. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this order. */ + name?: string; + /** Notes of this order. */ + notes?: string; + /** ID of the terms and conditions template used in this order. */ + planningTermId?: string; + /** Project ID of this order. */ + projectId?: string; + /** Seller order ID associated with this order. */ + sellerOrderId?: string; + /** Name of the seller organization. */ + sellerOrganizationName?: string; + /** Site IDs this order is associated with. */ + siteId?: string[]; + /** Free-form site names this order is associated with. */ + siteNames?: string[]; + /** Subaccount ID of this order. */ + subaccountId?: string; + /** Terms and conditions of this order. */ + termsAndConditions?: string; + } + interface OrderContact { + /** + * Free-form information about this contact. It could be any information related to this contact in addition to type, title, name, and signature user + * profile ID. + */ + contactInfo?: string; + /** Name of this contact. */ + contactName?: string; + /** Title of this contact. */ + contactTitle?: string; + /** Type of this contact. */ + contactType?: string; + /** ID of the user profile containing the signature that will be embedded into order documents. */ + signatureUserProfileId?: string; + } + interface OrderDocument { + /** Account ID of this order document. */ + accountId?: string; + /** Advertiser ID of this order document. */ + advertiserId?: string; + /** + * The amended order document ID of this order document. An order document can be created by optionally amending another order document so that the change + * history can be preserved. + */ + amendedOrderDocumentId?: string; + /** IDs of users who have approved this order document. */ + approvedByUserProfileIds?: string[]; + /** Whether this order document is cancelled. */ + cancelled?: boolean; + /** Information about the creation of this order document. */ + createdInfo?: LastModifiedInfo; + /** Effective date of this order document. */ + effectiveDate?: string; + /** ID of this order document. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#orderDocument". */ + kind?: string; + /** List of email addresses that received the last sent document. */ + lastSentRecipients?: string[]; + /** Timestamp of the last email sent with this order document. */ + lastSentTime?: string; + /** ID of the order from which this order document is created. */ + orderId?: string; + /** Project ID of this order document. */ + projectId?: string; + /** Whether this order document has been signed. */ + signed?: boolean; + /** Subaccount ID of this order document. */ + subaccountId?: string; + /** Title of this order document. */ + title?: string; + /** Type of this order document */ + type?: string; + } + interface OrderDocumentsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#orderDocumentsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Order document collection */ + orderDocuments?: OrderDocument[]; + } + interface OrdersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#ordersListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Order collection. */ + orders?: Order[]; + } + interface PathToConversionReportCompatibleFields { + /** Conversion dimensions which are compatible to be selected in the "conversionDimensions" section of the report. */ + conversionDimensions?: Dimension[]; + /** Custom floodlight variables which are compatible to be selected in the "customFloodlightVariables" section of the report. */ + customFloodlightVariables?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#pathToConversionReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Per-interaction dimensions which are compatible to be selected in the "perInteractionDimensions" section of the report. */ + perInteractionDimensions?: Dimension[]; + } + interface Placement { + /** Account ID of this placement. This field can be left blank. */ + accountId?: string; + /** + * Whether this placement opts out of ad blocking. When true, ad blocking is disabled for this placement. When false, the campaign and site settings take + * effect. + */ + adBlockingOptOut?: boolean; + /** Advertiser ID of this placement. This field can be left blank. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this placement is archived. */ + archived?: boolean; + /** Campaign ID of this placement. This field is a required field on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** Comments for this placement. */ + comment?: string; + /** + * Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices or in mobile apps for regular or + * interstitial ads respectively. APP and APP_INTERSTITIAL are no longer allowed for new placement insertions. Instead, use DISPLAY or + * DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion. + */ + compatibility?: string; + /** ID of the content category assigned to this placement. */ + contentCategoryId?: string; + /** Information about the creation of this placement. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** + * Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. + * This is a required field that is read-only after insertion. + */ + directorySiteId?: string; + /** Dimension value for the ID of the directory site. This is a read-only, auto-generated field. */ + directorySiteIdDimensionValue?: DimensionValue; + /** External ID for this placement. */ + externalId?: string; + /** ID of this placement. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this placement. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Key name of this placement. This is a read-only, auto-generated field. */ + keyName?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placement". */ + kind?: string; + /** Information about the most recent modification of this placement. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Lookback window settings for this placement. */ + lookbackConfiguration?: LookbackConfiguration; + /** Name of this placement.This is a required field and must be less than 256 characters long. */ + name?: string; + /** Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements. */ + paymentApproved?: boolean; + /** Payment source for this placement. This is a required field that is read-only after insertion. */ + paymentSource?: string; + /** ID of this placement's group, if applicable. */ + placementGroupId?: string; + /** Dimension value for the ID of the placement group. This is a read-only, auto-generated field. */ + placementGroupIdDimensionValue?: DimensionValue; + /** ID of the placement strategy assigned to this placement. */ + placementStrategyId?: string; + /** Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType. */ + pricingSchedule?: PricingSchedule; + /** + * Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field + * to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the + * roadblock's primaryPlacementId field to the ID of this placement. + */ + primary?: boolean; + /** Information about the last publisher update. This is a read-only field. */ + publisherUpdateInfo?: LastModifiedInfo; + /** + * Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this + * placement. This is a required field that is read-only after insertion. + */ + siteId?: string; + /** Dimension value for the ID of the site. This is a read-only, auto-generated field. */ + siteIdDimensionValue?: DimensionValue; + /** Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion. */ + size?: Size; + /** Whether creatives assigned to this placement must be SSL-compliant. */ + sslRequired?: boolean; + /** Third-party placement status. */ + status?: string; + /** Subaccount ID of this placement. This field can be left blank. */ + subaccountId?: string; + /** + * Tag formats to generate for this placement. This field is required on insertion. + * Acceptable values are: + * - "PLACEMENT_TAG_STANDARD" + * - "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + * - "PLACEMENT_TAG_IFRAME_ILAYER" + * - "PLACEMENT_TAG_INTERNAL_REDIRECT" + * - "PLACEMENT_TAG_JAVASCRIPT" + * - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + * - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + * - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + * - "PLACEMENT_TAG_CLICK_COMMANDS" + * - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + * - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + * - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" + * - "PLACEMENT_TAG_TRACKING" + * - "PLACEMENT_TAG_TRACKING_IFRAME" + * - "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + */ + tagFormats?: string[]; + /** Tag settings for this placement. */ + tagSetting?: TagSetting; + /** + * Whether Verification and ActiveView are disabled for in-stream video creatives for this placement. The same setting videoActiveViewOptOut exists on the + * site level -- the opt out occurs if either of these settings are true. These settings are distinct from DirectorySites.settings.activeViewOptOut or + * Sites.siteSettings.activeViewOptOut which only apply to display ads. However, Accounts.activeViewOptOut opts out both video traffic, as well as display + * ads, from Verification and ActiveView. + */ + videoActiveViewOptOut?: boolean; + /** A collection of settings which affect video creatives served through this placement. Applicable to placements with IN_STREAM_VIDEO compatibility. */ + videoSettings?: VideoSettings; + /** + * VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this + * placement. + * + * Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoice?: string; + } + interface PlacementAssignment { + /** Whether this placement assignment is active. When true, the placement will be included in the ad's rotation. */ + active?: boolean; + /** ID of the placement to be assigned. This is a required field. */ + placementId?: string; + /** Dimension value for the ID of the placement. This is a read-only, auto-generated field. */ + placementIdDimensionValue?: DimensionValue; + /** Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslRequired?: boolean; + } + interface PlacementGroup { + /** Account ID of this placement group. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this placement group. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this placement group is archived. */ + archived?: boolean; + /** Campaign ID of this placement group. This field is required on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field. */ + childPlacementIds?: string[]; + /** Comments for this placement group. */ + comment?: string; + /** ID of the content category assigned to this placement group. */ + contentCategoryId?: string; + /** Information about the creation of this placement group. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** + * Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated + * with this placement group. This is a required field that is read-only after insertion. + */ + directorySiteId?: string; + /** Dimension value for the ID of the directory site. This is a read-only, auto-generated field. */ + directorySiteIdDimensionValue?: DimensionValue; + /** External ID for this placement. */ + externalId?: string; + /** ID of this placement group. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this placement group. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementGroup". */ + kind?: string; + /** Information about the most recent modification of this placement group. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this placement group. This is a required field and must be less than 256 characters long. */ + name?: string; + /** + * Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group + * of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock + * requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion. + */ + placementGroupType?: string; + /** ID of the placement strategy assigned to this placement group. */ + placementStrategyId?: string; + /** Pricing schedule of this placement group. This field is required on insertion. */ + pricingSchedule?: PricingSchedule; + /** + * ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the + * primary field on all affected roadblock child placements. + */ + primaryPlacementId?: string; + /** Dimension value for the ID of the primary placement. This is a read-only, auto-generated field. */ + primaryPlacementIdDimensionValue?: DimensionValue; + /** + * Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated + * with this placement group. This is a required field that is read-only after insertion. + */ + siteId?: string; + /** Dimension value for the ID of the site. This is a read-only, auto-generated field. */ + siteIdDimensionValue?: DimensionValue; + /** Subaccount ID of this placement group. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface PlacementGroupsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Placement group collection. */ + placementGroups?: PlacementGroup[]; + } + interface PlacementStrategiesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementStrategiesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Placement strategy collection. */ + placementStrategies?: PlacementStrategy[]; + } + interface PlacementStrategy { + /** Account ID of this placement strategy.This is a read-only field that can be left blank. */ + accountId?: string; + /** ID of this placement strategy. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementStrategy". */ + kind?: string; + /** + * Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same + * account. + */ + name?: string; + } + interface PlacementTag { + /** Placement ID */ + placementId?: string; + /** Tags generated for this placement. */ + tagDatas?: TagData[]; + } + interface PlacementsGenerateTagsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementsGenerateTagsResponse". */ + kind?: string; + /** Set of generated tags for the specified placements. */ + placementTags?: PlacementTag[]; + } + interface PlacementsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Placement collection. */ + placements?: Placement[]; + } + interface PlatformType { + /** ID of this platform type. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformType". */ + kind?: string; + /** Name of this platform type. */ + name?: string; + } + interface PlatformTypesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformTypesListResponse". */ + kind?: string; + /** Platform type collection. */ + platformTypes?: PlatformType[]; + } + interface PopupWindowProperties { + /** Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID */ + dimension?: Size; + /** Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES. */ + offset?: OffsetPosition; + /** Popup window position either centered or at specific coordinate. */ + positionType?: string; + /** Whether to display the browser address bar. */ + showAddressBar?: boolean; + /** Whether to display the browser menu bar. */ + showMenuBar?: boolean; + /** Whether to display the browser scroll bar. */ + showScrollBar?: boolean; + /** Whether to display the browser status bar. */ + showStatusBar?: boolean; + /** Whether to display the browser tool bar. */ + showToolBar?: boolean; + /** Title of popup window. */ + title?: string; + } + interface PostalCode { + /** Postal code. This is equivalent to the id field. */ + code?: string; + /** Country code of the country to which this postal code belongs. */ + countryCode?: string; + /** DART ID of the country to which this postal code belongs. */ + countryDartId?: string; + /** ID of this postal code. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCode". */ + kind?: string; + } + interface PostalCodesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCodesListResponse". */ + kind?: string; + /** Postal code collection. */ + postalCodes?: PostalCode[]; + } + interface Pricing { + /** Cap cost type of this inventory item. */ + capCostType?: string; + /** End date of this inventory item. */ + endDate?: string; + /** Flights of this inventory item. A flight (a.k.a. pricing period) represents the inventory item pricing information for a specific period of time. */ + flights?: Flight[]; + /** + * Group type of this inventory item if it represents a placement group. Is null otherwise. There are two type of placement groups: + * PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items that acts as a single pricing point for a group of tags. + * PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that not only acts as a single pricing point, but also assumes that all the tags + * in it will be served at the same time. A roadblock requires one of its assigned inventory items to be marked as primary. + */ + groupType?: string; + /** Pricing type of this inventory item. */ + pricingType?: string; + /** Start date of this inventory item. */ + startDate?: string; + } + interface PricingSchedule { + /** Placement cap cost option. */ + capCostOption?: string; + /** Whether cap costs are ignored by ad serving. */ + disregardOverdelivery?: boolean; + /** + * Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for + * example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and + * seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion. + */ + endDate?: string; + /** Whether this placement is flighted. If true, pricing periods will be computed automatically. */ + flighted?: boolean; + /** Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA. */ + floodlightActivityId?: string; + /** Pricing periods for this placement. */ + pricingPeriods?: PricingSchedulePricingPeriod[]; + /** Placement pricing type. This field is required on insertion. */ + pricingType?: string; + /** + * Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date + * should not be set, as doing so will result in an error. This field is required on insertion. + */ + startDate?: string; + /** Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. */ + testingStartDate?: string; + } + interface PricingSchedulePricingPeriod { + /** + * Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. + * The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective + * pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an + * error. + */ + endDate?: string; + /** Comments for this pricing period. */ + pricingComment?: string; + /** Rate or cost of this pricing period in nanos (i.e., multipled by 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. */ + rateOrCostNanos?: string; + /** + * Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start + * date should not be set, as doing so will result in an error. + */ + startDate?: string; + /** Units of this pricing period. Acceptable values are 0 to 10000000000, inclusive. */ + units?: string; + } + interface Project { + /** Account ID of this project. */ + accountId?: string; + /** Advertiser ID of this project. */ + advertiserId?: string; + /** Audience age group of this project. */ + audienceAgeGroup?: string; + /** Audience gender of this project. */ + audienceGender?: string; + /** + * Budget of this project in the currency specified by the current account. The value stored in this field represents only the non-fractional amount. For + * example, for USD, the smallest value that can be represented by this field is 1 US dollar. + */ + budget?: string; + /** Client billing code of this project. */ + clientBillingCode?: string; + /** Name of the project client. */ + clientName?: string; + /** End date of the project. */ + endDate?: string; + /** ID of this project. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#project". */ + kind?: string; + /** Information about the most recent modification of this project. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this project. */ + name?: string; + /** Overview of this project. */ + overview?: string; + /** Start date of the project. */ + startDate?: string; + /** Subaccount ID of this project. */ + subaccountId?: string; + /** Number of clicks that the advertiser is targeting. */ + targetClicks?: string; + /** Number of conversions that the advertiser is targeting. */ + targetConversions?: string; + /** CPA that the advertiser is targeting. */ + targetCpaNanos?: string; + /** CPC that the advertiser is targeting. */ + targetCpcNanos?: string; + /** vCPM from Active View that the advertiser is targeting. */ + targetCpmActiveViewNanos?: string; + /** CPM that the advertiser is targeting. */ + targetCpmNanos?: string; + /** Number of impressions that the advertiser is targeting. */ + targetImpressions?: string; + } + interface ProjectsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#projectsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Project collection. */ + projects?: Project[]; + } + interface ReachReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensions" section of the report. */ + dimensions?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#reachReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Metrics which are compatible to be selected as activity metrics to pivot on in the "activities" section of the report. */ + pivotedActivityMetrics?: Metric[]; + /** Metrics which are compatible to be selected in the "reachByFrequencyMetricNames" section of the report. */ + reachByFrequencyMetrics?: Metric[]; + } + interface Recipient { + /** The delivery type for the recipient. */ + deliveryType?: string; + /** The email address of the recipient. */ + email?: string; + /** The kind of resource this is, in this case dfareporting#recipient. */ + kind?: string; + } + interface Region { + /** Country code of the country to which this region belongs. */ + countryCode?: string; + /** DART ID of the country to which this region belongs. */ + countryDartId?: string; + /** DART ID of this region. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#region". */ + kind?: string; + /** Name of this region. */ + name?: string; + /** Region code. */ + regionCode?: string; + } + interface RegionsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#regionsListResponse". */ + kind?: string; + /** Region collection. */ + regions?: Region[]; + } + interface RemarketingList { + /** Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + accountId?: string; + /** Whether this remarketing list is active. */ + active?: boolean; + /** Dimension value for the advertiser ID that owns this remarketing list. This is a required field. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Remarketing list description. */ + description?: string; + /** Remarketing list ID. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingList". */ + kind?: string; + /** Number of days that a user should remain in the remarketing list without an impression. Acceptable values are 1 to 540, inclusive. */ + lifeSpan?: string; + /** Rule used to populate the remarketing list with users. */ + listPopulationRule?: ListPopulationRule; + /** Number of users currently in the list. This is a read-only field. */ + listSize?: string; + /** Product from which this remarketing list was originated. */ + listSource?: string; + /** Name of the remarketing list. This is a required field. Must be no greater than 128 characters long. */ + name?: string; + /** Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + subaccountId?: string; + } + interface RemarketingListShare { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingListShare". */ + kind?: string; + /** Remarketing list ID. This is a read-only, auto-generated field. */ + remarketingListId?: string; + /** Accounts that the remarketing list is shared with. */ + sharedAccountIds?: string[]; + /** Advertisers that the remarketing list is shared with. */ + sharedAdvertiserIds?: string[]; + } + interface RemarketingListsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingListsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Remarketing list collection. */ + remarketingLists?: RemarketingList[]; + } + interface Report { + /** The account ID to which this report belongs. */ + accountId?: string; + /** The report criteria for a report of type "STANDARD". */ + criteria?: { + /** Activity group. */ + activities?: Activities; + /** Custom Rich Media Events group. */ + customRichMediaEvents?: CustomRichMediaEvents; + /** The date range for which this report should be run. */ + dateRange?: DateRange; + /** + * The list of filters on which dimensions are filtered. + * Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + */ + dimensionFilters?: DimensionValue[]; + /** The list of standard dimensions the report should include. */ + dimensions?: SortedDimension[]; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + }; + /** The report criteria for a report of type "CROSS_DIMENSION_REACH". */ + crossDimensionReachCriteria?: { + /** The list of dimensions the report should include. */ + breakdown?: SortedDimension[]; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** The dimension option. */ + dimension?: string; + /** The list of filters on which dimensions are filtered. */ + dimensionFilters?: DimensionValue[]; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The list of names of overlap metrics the report should include. */ + overlapMetricNames?: string[]; + /** Whether the report is pivoted or not. Defaults to true. */ + pivoted?: boolean; + }; + /** The report's email delivery settings. */ + delivery?: { + /** Whether the report should be emailed to the report owner. */ + emailOwner?: boolean; + /** The type of delivery for the owner to receive, if enabled. */ + emailOwnerDeliveryType?: string; + /** The message to be sent with each email. */ + message?: string; + /** The list of recipients to which to email the report. */ + recipients?: Recipient[]; + }; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The filename used when generating report files for this report. */ + fileName?: string; + /** The report criteria for a report of type "FLOODLIGHT". */ + floodlightCriteria?: { + /** The list of custom rich media events to include. */ + customRichMediaEvents?: DimensionValue[]; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** + * The list of filters on which dimensions are filtered. + * Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + */ + dimensionFilters?: DimensionValue[]; + /** The list of dimensions the report should include. */ + dimensions?: SortedDimension[]; + /** + * The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the + * value needs to be 'dfa:floodlightConfigId'. + */ + floodlightConfigId?: DimensionValue; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The properties of the report. */ + reportProperties?: { + /** Include conversions that have no cookie, but do have an exposure path. */ + includeAttributedIPConversions?: boolean; + /** + * Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser + * within the Floodlight group, or that the interaction happened outside the lookback window. + */ + includeUnattributedCookieConversions?: boolean; + /** + * Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the + * lookback window prior to a conversion. + */ + includeUnattributedIPConversions?: boolean; + }; + }; + /** + * The output format of the report. If not specified, default format is "CSV". Note that the actual format in the completed report file might differ if + * for instance the report's size exceeds the format's capabilities. "CSV" will then be the fallback format. + */ + format?: string; + /** The unique ID identifying this report resource. */ + id?: string; + /** The kind of resource this is, in this case dfareporting#report. */ + kind?: string; + /** The timestamp (in milliseconds since epoch) of when this report was last modified. */ + lastModifiedTime?: string; + /** The name of the report. */ + name?: string; + /** The user profile id of the owner of this report. */ + ownerProfileId?: string; + /** The report criteria for a report of type "PATH_TO_CONVERSION". */ + pathToConversionCriteria?: { + /** The list of 'dfa:activity' values to filter on. */ + activityFilters?: DimensionValue[]; + /** The list of conversion dimensions the report should include. */ + conversionDimensions?: SortedDimension[]; + /** The list of custom floodlight variables the report should include. */ + customFloodlightVariables?: SortedDimension[]; + /** The list of custom rich media events to include. */ + customRichMediaEvents?: DimensionValue[]; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** + * The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the + * value needs to be 'dfa:floodlightConfigId'. + */ + floodlightConfigId?: DimensionValue; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The list of per interaction dimensions the report should include. */ + perInteractionDimensions?: SortedDimension[]; + /** The properties of the report. */ + reportProperties?: { + /** + * DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from + * Floodlight or you can manually enter a custom value. Valid values: 1-90. + */ + clicksLookbackWindow?: number; + /** + * DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from + * Floodlight or you can manually enter a custom value. Valid values: 1-90. + */ + impressionsLookbackWindow?: number; + /** Deprecated: has no effect. */ + includeAttributedIPConversions?: boolean; + /** + * Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser + * within the Floodlight group, or that the interaction happened outside the lookback window. + */ + includeUnattributedCookieConversions?: boolean; + /** + * Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the + * lookback window prior to a conversion. + */ + includeUnattributedIPConversions?: boolean; + /** + * The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 + * impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report. + */ + maximumClickInteractions?: number; + /** + * The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 + * impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report. + */ + maximumImpressionInteractions?: number; + /** The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90. */ + maximumInteractionGap?: number; + /** Enable pivoting on interaction path. */ + pivotOnInteractionPath?: boolean; + }; + }; + /** The report criteria for a report of type "REACH". */ + reachCriteria?: { + /** Activity group. */ + activities?: Activities; + /** Custom Rich Media Events group. */ + customRichMediaEvents?: CustomRichMediaEvents; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** + * The list of filters on which dimensions are filtered. + * Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + */ + dimensionFilters?: DimensionValue[]; + /** The list of dimensions the report should include. */ + dimensions?: SortedDimension[]; + /** + * Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last + * three months. + */ + enableAllDimensionCombinations?: boolean; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The list of names of Reach By Frequency metrics the report should include. */ + reachByFrequencyMetricNames?: string[]; + }; + /** The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not "TODAY". */ + schedule?: { + /** Whether the schedule is active or not. Must be set to either true or false. */ + active?: boolean; + /** Defines every how many days, weeks or months the report should be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or "MONTHLY". */ + every?: number; + /** The expiration date when the scheduled report stops running. */ + expirationDate?: string; + /** + * The interval for which the report is repeated. Note: + * - "DAILY" also requires field "every" to be set. + * - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be set. + * - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be set. + */ + repeats?: string; + /** List of week days "WEEKLY" on which scheduled reports should run. */ + repeatsOnWeekDays?: string[]; + /** + * Enum to define for "MONTHLY" scheduled reports whether reports should be repeated on the same day of the month as "startDate" or the same day of the + * week of the month. + * Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run subsequent reports on the 2nd of every Month, and + * "WEEK_OF_MONTH" would run subsequent reports on the first Monday of the month. + */ + runsOnDayOfMonth?: string; + /** Start date of date range for which scheduled reports should be run. */ + startDate?: string; + }; + /** The subaccount ID to which this report belongs if applicable. */ + subAccountId?: string; + /** The type of the report. */ + type?: string; + } + interface ReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensions" section of the report. */ + dimensions?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#reportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Metrics which are compatible to be selected as activity metrics to pivot on in the "activities" section of the report. */ + pivotedActivityMetrics?: Metric[]; + } + interface ReportList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The reports returned in this response. */ + items?: Report[]; + /** The kind of list this is, in this case dfareporting#reportList. */ + kind?: string; + /** + * Continuation token used to page through reports. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. + * The page token is only valid for a limited amount of time and should not be persisted. + */ + nextPageToken?: string; + } + interface ReportsConfiguration { + /** + * Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen + * by a user before converting. + */ + exposureToConversionEnabled?: boolean; + /** Default lookback windows for new advertisers in this account. */ + lookbackConfiguration?: LookbackConfiguration; + /** + * Report generation time zone ID of this account. This is a required field that can only be changed by a superuser. + * Acceptable values are: + * + * - "1" for "America/New_York" + * - "2" for "Europe/London" + * - "3" for "Europe/Paris" + * - "4" for "Africa/Johannesburg" + * - "5" for "Asia/Jerusalem" + * - "6" for "Asia/Shanghai" + * - "7" for "Asia/Hong_Kong" + * - "8" for "Asia/Tokyo" + * - "9" for "Australia/Sydney" + * - "10" for "Asia/Dubai" + * - "11" for "America/Los_Angeles" + * - "12" for "Pacific/Auckland" + * - "13" for "America/Sao_Paulo" + */ + reportGenerationTimeZoneId?: string; + } + interface RichMediaExitOverride { + /** Click-through URL of this rich media exit override. Applicable if the enabled field is set to true. */ + clickThroughUrl?: ClickThroughUrl; + /** Whether to use the clickThroughUrl. If false, the creative-level exit will be used. */ + enabled?: boolean; + /** ID for the override to refer to a specific exit in the creative. */ + exitId?: string; + } + interface Rule { + /** A creativeAssets[].id. This should refer to one of the parent assets in this creative. This is a required field. */ + assetId?: string; + /** A user-friendly name for this rule. This is a required field. */ + name?: string; + /** + * A targeting template ID. The targeting from the targeting template will be used to determine whether this asset should be served. This is a required + * field. + */ + targetingTemplateId?: string; + } + interface Site { + /** Account ID of this site. This is a read-only field that can be left blank. */ + accountId?: string; + /** Whether this site is approved. */ + approved?: boolean; + /** Directory site associated with this site. This is a required field that is read-only after insertion. */ + directorySiteId?: string; + /** Dimension value for the ID of the directory site. This is a read-only, auto-generated field. */ + directorySiteIdDimensionValue?: DimensionValue; + /** ID of this site. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this site. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Key name of this site. This is a read-only, auto-generated field. */ + keyName?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#site". */ + kind?: string; + /** + * Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among + * sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account. + */ + name?: string; + /** Site contacts. */ + siteContacts?: SiteContact[]; + /** Site-wide settings. */ + siteSettings?: SiteSettings; + /** Subaccount ID of this site. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface SiteContact { + /** Address of this site contact. */ + address?: string; + /** Site contact type. */ + contactType?: string; + /** Email address of this site contact. This is a required field. */ + email?: string; + /** First name of this site contact. */ + firstName?: string; + /** ID of this site contact. This is a read-only, auto-generated field. */ + id?: string; + /** Last name of this site contact. */ + lastName?: string; + /** Primary phone number of this site contact. */ + phone?: string; + /** Title or designation of this site contact. */ + title?: string; + } + interface SiteSettings { + /** Whether active view creatives are disabled for this site. */ + activeViewOptOut?: boolean; + /** + * Whether this site opts out of ad blocking. When true, ad blocking is disabled for all placements under the site, regardless of the individual placement + * settings. When false, the campaign and placement settings take effect. + */ + adBlockingOptOut?: boolean; + /** Site-wide creative settings. */ + creativeSettings?: CreativeSettings; + /** Whether new cookies are disabled for this site. */ + disableNewCookie?: boolean; + /** Lookback window settings for this site. */ + lookbackConfiguration?: LookbackConfiguration; + /** Configuration settings for dynamic and image floodlight tags. */ + tagSetting?: TagSetting; + /** + * Whether Verification and ActiveView for in-stream video creatives are disabled by default for new placements created under this site. This value will + * be used to populate the placement.videoActiveViewOptOut field, when no value is specified for the new placement. + */ + videoActiveViewOptOutTemplate?: boolean; + /** + * Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, + * when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned + * to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID + * format (HTML5 VPAID creatives use the HTML5 adapter). + * + * Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoiceTemplate?: string; + } + interface SitesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#sitesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Site collection. */ + sites?: Site[]; + } + interface Size { + /** Height of this size. Acceptable values are 0 to 32767, inclusive. */ + height?: number; + /** IAB standard size. This is a read-only, auto-generated field. */ + iab?: boolean; + /** ID of this size. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#size". */ + kind?: string; + /** Width of this size. Acceptable values are 0 to 32767, inclusive. */ + width?: number; + } + interface SizesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#sizesListResponse". */ + kind?: string; + /** Size collection. */ + sizes?: Size[]; + } + interface SkippableSetting { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#skippableSetting". */ + kind?: string; + /** Amount of time to play videos served to this placement before counting a view. Applicable when skippable is true. */ + progressOffset?: VideoOffset; + /** Amount of time to play videos served to this placement before the skip button should appear. Applicable when skippable is true. */ + skipOffset?: VideoOffset; + /** Whether the user can skip creatives served to this placement. */ + skippable?: boolean; + } + interface SortedDimension { + /** The kind of resource this is, in this case dfareporting#sortedDimension. */ + kind?: string; + /** The name of the dimension. */ + name?: string; + /** An optional sort order for the dimension column. */ + sortOrder?: string; + } + interface Subaccount { + /** ID of the account that contains this subaccount. This is a read-only field that can be left blank. */ + accountId?: string; + /** IDs of the available user role permissions for this subaccount. */ + availablePermissionIds?: string[]; + /** ID of this subaccount. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#subaccount". */ + kind?: string; + /** Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account. */ + name?: string; + } + interface SubaccountsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#subaccountsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Subaccount collection. */ + subaccounts?: Subaccount[]; + } + interface TagData { + /** Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING. */ + adId?: string; + /** Tag string to record a click. */ + clickTag?: string; + /** Creative associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING. */ + creativeId?: string; + /** TagData tag format of this tag. */ + format?: string; + /** Tag string for serving an ad. */ + impressionTag?: string; + } + interface TagSetting { + /** + * Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys + * and values must not contain commas. For example, id=2;color=red is a valid value for this field. + */ + additionalKeyValues?: string; + /** Whether static landing page URLs should be included in the tags. This setting applies only to placements. */ + includeClickThroughUrls?: boolean; + /** Whether click-tracking string should be included in the tags. */ + includeClickTracking?: boolean; + /** + * Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags + * for this site. Publishers can then add keywords to those placeholders. + */ + keywordOption?: string; + } + interface TagSettings { + /** Whether dynamic floodlight tags are enabled. */ + dynamicTagEnabled?: boolean; + /** Whether image tags are enabled. */ + imageTagEnabled?: boolean; + } + interface TargetWindow { + /** User-entered value. */ + customHtml?: string; + /** Type of browser window for which the backup image of the flash creative can be displayed. */ + targetWindowOption?: string; + } + interface TargetableRemarketingList { + /** Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + accountId?: string; + /** Whether this targetable remarketing list is active. */ + active?: boolean; + /** Dimension value for the advertiser ID that owns this targetable remarketing list. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. */ + advertiserIdDimensionValue?: DimensionValue; + /** Targetable remarketing list description. */ + description?: string; + /** Targetable remarketing list ID. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetableRemarketingList". */ + kind?: string; + /** Number of days that a user should remain in the targetable remarketing list without an impression. */ + lifeSpan?: string; + /** Number of users currently in the list. This is a read-only field. */ + listSize?: string; + /** Product from which this targetable remarketing list was originated. */ + listSource?: string; + /** Name of the targetable remarketing list. Is no greater than 128 characters long. */ + name?: string; + /** Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + subaccountId?: string; + } + interface TargetableRemarketingListsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetableRemarketingListsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Targetable remarketing list collection. */ + targetableRemarketingLists?: TargetableRemarketingList[]; + } + interface TargetingTemplate { + /** Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. */ + accountId?: string; + /** Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Time and day targeting criteria. */ + dayPartTargeting?: DayPartTargeting; + /** Geographical targeting criteria. */ + geoTargeting?: GeoTargeting; + /** ID of this targeting template. This is a read-only, auto-generated field. */ + id?: string; + /** Key-value targeting criteria. */ + keyValueTargetingExpression?: KeyValueTargetingExpression; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplate". */ + kind?: string; + /** Language targeting criteria. */ + languageTargeting?: LanguageTargeting; + /** Remarketing list targeting criteria. */ + listTargetingExpression?: ListTargetingExpression; + /** Name of this targeting template. This field is required. It must be less than 256 characters long and unique within an advertiser. */ + name?: string; + /** Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. */ + subaccountId?: string; + /** Technology platform targeting criteria. */ + technologyTargeting?: TechnologyTargeting; + } + interface TargetingTemplatesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplatesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Targeting template collection. */ + targetingTemplates?: TargetingTemplate[]; + } + interface TechnologyTargeting { + /** + * Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only + * browserVersionId will be used. The other fields are populated automatically when the ad is inserted or updated. + */ + browsers?: Browser[]; + /** + * Connection types that this ad targets. For each connection type only id is required. The other fields are populated automatically when the ad is + * inserted or updated. + */ + connectionTypes?: ConnectionType[]; + /** + * Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is + * inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes. + */ + mobileCarriers?: MobileCarrier[]; + /** + * Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. + * The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the + * corresponding operating system in operatingSystems. + */ + operatingSystemVersions?: OperatingSystemVersion[]; + /** + * Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. + * The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating + * system versions for the same operating system. + */ + operatingSystems?: OperatingSystem[]; + /** + * Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are + * populated automatically when the ad is inserted or updated. + */ + platformTypes?: PlatformType[]; + } + interface ThirdPartyAuthenticationToken { + /** Name of the third-party authentication token. */ + name?: string; + /** Value of the third-party authentication token. This is a read-only, auto-generated field. */ + value?: string; + } + interface ThirdPartyTrackingUrl { + /** Third-party URL type for in-stream video creatives. */ + thirdPartyUrlType?: string; + /** URL for the specified third-party URL type. */ + url?: string; + } + interface TranscodeSetting { + /** Whitelist of video formats to be served to this placement. Set this list to null or empty to serve all video formats. */ + enabledVideoFormats?: number[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#transcodeSetting". */ + kind?: string; + } + interface UniversalAdId { + /** Registry used for the Ad ID value. */ + registry?: string; + /** + * ID value for this creative. Only alphanumeric characters and the following symbols are valid: "_/\-". Maximum length is 64 characters. Read only when + * registry is DCM. + */ + value?: string; + } + interface UserDefinedVariableConfiguration { + /** Data type for the variable. This is a required field. */ + dataType?: string; + /** + * User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain + * the following characters: ""<>". + */ + reportName?: string; + /** Variable name in the tag. This is a required field. */ + variableType?: string; + } + interface UserProfile { + /** The account ID to which this profile belongs. */ + accountId?: string; + /** The account name this profile belongs to. */ + accountName?: string; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The kind of resource this is, in this case dfareporting#userProfile. */ + kind?: string; + /** The unique ID of the user profile. */ + profileId?: string; + /** The sub account ID this profile belongs to if applicable. */ + subAccountId?: string; + /** The sub account name this profile belongs to if applicable. */ + subAccountName?: string; + /** The user name. */ + userName?: string; + } + interface UserProfileList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The user profiles returned in this response. */ + items?: UserProfile[]; + /** The kind of list this is, in this case dfareporting#userProfileList. */ + kind?: string; + } + interface UserRole { + /** Account ID of this user role. This is a read-only field that can be left blank. */ + accountId?: string; + /** + * Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each + * default user role comes with a basic set of preassigned permissions. + */ + defaultUserRole?: boolean; + /** ID of this user role. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRole". */ + kind?: string; + /** + * Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be + * unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles + * of the same account. + */ + name?: string; + /** ID of the user role that this user role is based on or copied from. This is a required field. */ + parentUserRoleId?: string; + /** List of permissions associated with this user role. */ + permissions?: UserRolePermission[]; + /** Subaccount ID of this user role. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface UserRolePermission { + /** Levels of availability for a user role permission. */ + availability?: string; + /** ID of this user role permission. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermission". */ + kind?: string; + /** Name of this user role permission. */ + name?: string; + /** ID of the permission group that this user role permission belongs to. */ + permissionGroupId?: string; + } + interface UserRolePermissionGroup { + /** ID of this user role permission. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionGroup". */ + kind?: string; + /** Name of this user role permission group. */ + name?: string; + } + interface UserRolePermissionGroupsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionGroupsListResponse". */ + kind?: string; + /** User role permission group collection. */ + userRolePermissionGroups?: UserRolePermissionGroup[]; + } + interface UserRolePermissionsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionsListResponse". */ + kind?: string; + /** User role permission collection. */ + userRolePermissions?: UserRolePermission[]; + } + interface UserRolesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** User role collection. */ + userRoles?: UserRole[]; + } + interface VideoFormat { + /** File type of the video format. */ + fileType?: string; + /** ID of the video format. */ + id?: number; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoFormat". */ + kind?: string; + /** The resolution of this video format. */ + resolution?: Size; + /** The target bit rate of this video format. */ + targetBitRate?: number; + } + interface VideoFormatsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoFormatsListResponse". */ + kind?: string; + /** Video format collection. */ + videoFormats?: VideoFormat[]; + } + interface VideoOffset { + /** Duration, as a percentage of video duration. Do not set when offsetSeconds is set. Acceptable values are 0 to 100, inclusive. */ + offsetPercentage?: number; + /** Duration, in seconds. Do not set when offsetPercentage is set. Acceptable values are 0 to 86399, inclusive. */ + offsetSeconds?: number; + } + interface VideoSettings { + /** Settings for the companion creatives of video creatives served to this placement. */ + companionSettings?: CompanionSetting; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoSettings". */ + kind?: string; + /** + * Settings for the skippability of video creatives served to this placement. If this object is provided, the creative-level skippable settings will be + * overridden. + */ + skippableSettings?: SkippableSetting; + /** + * Settings for the transcodes of video creatives served to this placement. If this object is provided, the creative-level transcode settings will be + * overridden. + */ + transcodeSettings?: TranscodeSetting; + } + interface AccountActiveAdSummariesResource { + /** Gets the account's active ad summary by account ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Account ID. */ + summaryAccountId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountPermissionGroupsResource { + /** Gets one account permission group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account permission group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of account permission groups. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountPermissionsResource { + /** Gets one account permission by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account permission ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of account permissions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountUserProfilesResource { + /** Gets one account user profile by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User profile ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new account user profile. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of account user profiles, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active user profiles. */ + active?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only user profiles with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like + * "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and + * the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or + * simply "user profile". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only user profiles with the specified subaccount ID. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Select only user profiles with the specified user role ID. */ + userRoleId?: string; + }): Request; + /** Updates an existing account user profile. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User profile ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account user profile. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Gets one account by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of accounts, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active accounts. Don't set this field to select both active and non-active accounts. */ + active?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only accounts with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June + * 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdsResource { + /** Gets one ad by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Ad ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new ad. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of ads, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active ads. */ + active?: boolean; + /** Select only ads with this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived ads. */ + archived?: boolean; + /** Select only ads with these audience segment IDs. */ + audienceSegmentIds?: string; + /** Select only ads with these campaign IDs. */ + campaignIds?: string; + /** + * Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering + * either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. + * IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + */ + compatibility?: string; + /** Select only ads with these creative IDs assigned. */ + creativeIds?: string; + /** Select only ads with these creative optimization configuration IDs. */ + creativeOptimizationConfigurationIds?: string; + /** + * Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static + * click trackers. Leave unset to select both. + */ + dynamicClickTracker?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only ads with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only ads with these landing page IDs. */ + landingPageIds?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only ads with this event tag override ID. */ + overriddenEventTagId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Select only ads with these placement IDs assigned. */ + placementIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only ads whose list targeting expression use these remarketing list IDs. */ + remarketingListIds?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad + * April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a + * search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + */ + searchString?: string; + /** Select only ads with these size IDs. */ + sizeIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only ads that are SSL-compliant. */ + sslCompliant?: boolean; + /** Select only ads that require SSL. */ + sslRequired?: boolean; + /** Select only ads with these types. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing ad. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Ad ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing ad. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdvertiserGroupsResource { + /** Deletes an existing advertiser group. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one advertiser group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new advertiser group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of advertiser groups, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only advertiser groups with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser + * group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and + * the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup + * 2015", or simply "advertisergroup". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdvertisersResource { + /** Gets one advertiser by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new advertiser. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of advertisers, possibly filtered. This method supports paging. */ + list(request: { + /** Select only advertisers with these advertiser group IDs. */ + advertiserGroupIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only advertisers with these floodlight configuration IDs. */ + floodlightConfigurationIds?: string; + /** Select only advertisers with these IDs. */ + ids?: string; + /** Select only advertisers which do not belong to any advertiser group. */ + includeAdvertisersWithoutGroupsOnly?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only advertisers which use another advertiser's floodlight configuration. */ + onlyParent?: boolean; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser + * June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the + * search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only advertisers with the specified status. */ + status?: string; + /** Select only advertisers with these subaccount IDs. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BrowsersResource { + /** Retrieves a list of browsers. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CampaignCreativeAssociationsResource { + /** + * Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a + * default ad does not exist already. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Campaign ID in this association. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Campaign ID in this association. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CampaignsResource { + /** Gets one campaign by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Campaign ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new campaign. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Default landing page name for this new campaign. Must be less than 256 characters long. */ + defaultLandingPageName: string; + /** Default landing page URL for this new campaign. */ + defaultLandingPageUrl: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of campaigns, possibly filtered. This method supports paging. */ + list(request: { + /** Select only campaigns whose advertisers belong to these advertiser groups. */ + advertiserGroupIds?: string; + /** Select only campaigns that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. */ + archived?: boolean; + /** Select only campaigns that have at least one optimization activity. */ + atLeastOneOptimizationActivity?: boolean; + /** Exclude campaigns with these IDs. */ + excludedIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only campaigns with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only campaigns that have overridden this event tag ID. */ + overriddenEventTagId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign + * June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only campaigns that belong to this subaccount. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Campaign ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChangeLogsResource { + /** Gets one change log by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Change log ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of change logs. This method supports paging. */ + list(request: { + /** Select only change logs with the specified action. */ + action?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only change logs with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For + * example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, + * month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + */ + maxChangeTime?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** + * Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For + * example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, + * month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + */ + minChangeTime?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only change logs with these object IDs. */ + objectIds?: string; + /** Select only change logs with the specified object type. */ + objectType?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only change logs whose object ID, user name, old or new values match the search string. */ + searchString?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Select only change logs with these user profile IDs. */ + userProfileIds?: string; + }): Request; + } + interface CitiesResource { + /** Retrieves a list of cities, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Select only cities from these countries. */ + countryDartIds?: string; + /** Select only cities with these DART IDs. */ + dartIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only cities with names starting with this prefix. */ + namePrefix?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only cities from these regions. */ + regionDartIds?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ConnectionTypesResource { + /** Gets one connection type by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Connection type ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of connection types. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ContentCategoriesResource { + /** Deletes an existing content category. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Content category ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one content category by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Content category ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new content category. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of content categories, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only content categories with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like + * "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", + * "contentcategory 2015", or simply "contentcategory". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing content category. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Content category ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing content category. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ConversionsResource { + /** Inserts conversions. */ + batchinsert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates existing conversions. */ + batchupdate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CountriesResource { + /** Gets one country by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Country DART ID. */ + dartId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of countries. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeAssetsResource { + /** Inserts a new creative asset. */ + insert(request: { + /** Advertiser ID of this creative. This is a required field. */ + advertiserId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeFieldValuesResource { + /** Deletes an existing creative field value. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field Value ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one creative field value by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field Value ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative field value. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creative field values, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creative field values with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field value. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field Value ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field value. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeFieldsResource { + /** Deletes an existing creative field. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one creative field by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative field. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creative fields, possibly filtered. This method supports paging. */ + list(request: { + /** Select only creative fields that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creative fields with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names + * like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the + * start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", + * "creativefield 2015", or simply "creativefield". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeGroupsResource { + /** Gets one creative group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creative groups, possibly filtered. This method supports paging. */ + list(request: { + /** Select only creative groups that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creative groups that belong to this subgroup. */ + groupNumber?: number; + /** Select only creative groups with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names + * like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the + * start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", + * "creativegroup 2015", or simply "creativegroup". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativesResource { + /** Gets one creative by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creatives, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active creatives. Leave blank to select active and inactive creatives. */ + active?: boolean; + /** Select only creatives with this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived creatives. Leave blank to select archived and unarchived creatives. */ + archived?: boolean; + /** Select only creatives with this campaign ID. */ + campaignId?: string; + /** Select only in-stream video creatives with these companion IDs. */ + companionCreativeIds?: string; + /** Select only creatives with these creative field IDs. */ + creativeFieldIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creatives with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only creatives with these rendering IDs. */ + renderingIds?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June + * 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + */ + searchString?: string; + /** Select only creatives with these size IDs. */ + sizeIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only creatives corresponding to this Studio creative ID. */ + studioCreativeId?: string; + /** Select only creatives with these creative types. */ + types?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DimensionValuesResource { + /** Retrieves list of report dimension values for a list of filters. */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DirectorySiteContactsResource { + /** Gets one directory site contact by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Directory site contact ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of directory site contacts, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Select only directory site contacts with these directory site IDs. This is a required field. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only directory site contacts with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names + * like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add + * wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with + * name "my directory site contact", "directory site contact 2015", or simply "directory site contact". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DirectorySitesResource { + /** Gets one directory site by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Directory site ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new directory site. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of directory sites, possibly filtered. This method supports paging. */ + list(request: { + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInStreamVideoPlacements?: boolean; + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInterstitialPlacements?: boolean; + /** Select only directory sites that accept publisher paid placements. This field can be left blank. */ + acceptsPublisherPaidPlacements?: boolean; + /** Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. */ + active?: boolean; + /** Data format for the response. */ + alt?: string; + /** Select only directory sites with this country ID. */ + countryId?: string; + /** Select only directory sites with this DFP network code. */ + dfpNetworkCode?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only directory sites with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Select only directory sites with this parent ID. */ + parentId?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like + * "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory + * site 2015" or simply, "directory site". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DynamicTargetingKeysResource { + /** Deletes an existing dynamic targeting key. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are + * converted to lowercase. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the object of this dynamic targeting key. This is a required field. */ + objectId: string; + /** Type of the object of this dynamic targeting key. This is a required field. */ + objectType: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or + * placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of dynamic targeting keys. */ + list(request: { + /** Select only dynamic targeting keys whose object has this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only dynamic targeting keys exactly matching these names. */ + names?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only dynamic targeting keys with this object ID. */ + objectId?: string; + /** Select only dynamic targeting keys with this object type. */ + objectType?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EventTagsResource { + /** Deletes an existing event tag. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event tag ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one event tag by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event tag ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new event tag. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of event tags, possibly filtered. */ + list(request: { + /** Select only event tags that belong to this ad. */ + adId?: string; + /** Select only event tags that belong to this advertiser. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Select only event tags that belong to this campaign. */ + campaignId?: string; + /** + * Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent + * campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the + * enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + */ + definitionsOnly?: boolean; + /** + * Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, + * only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or + * specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + */ + enabled?: boolean; + /** + * Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party + * JavaScript URL, or a third-party click-through URL for either impression or click tracking. + */ + eventTagTypes?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only event tags with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June + * 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing event tag. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event tag ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing event tag. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FilesResource { + /** Retrieves a report file by its report ID and file ID. This method supports media download. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the report file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists files for a user profile. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The scope that defines which results are returned. */ + scope?: string; + /** The field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FloodlightActivitiesResource { + /** Deletes an existing floodlight activity. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Generates a tag for a floodlight activity. */ + generatetag(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID for which we want to generate a tag. */ + floodlightActivityId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one floodlight activity by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new floodlight activity. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of floodlight activities, possibly filtered. This method supports paging. */ + list(request: { + /** + * Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty + * result. + */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only floodlight activities with the specified floodlight activity group IDs. */ + floodlightActivityGroupIds?: string; + /** Select only floodlight activities with the specified floodlight activity group name. */ + floodlightActivityGroupName?: string; + /** Select only floodlight activities with the specified floodlight activity group tag string. */ + floodlightActivityGroupTagString?: string; + /** Select only floodlight activities with the specified floodlight activity group type. */ + floodlightActivityGroupType?: string; + /** + * Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId + * for a non-empty result. + */ + floodlightConfigurationId?: string; + /** Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like + * "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards + * implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my + * floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only floodlight activities with the specified tag string. */ + tagString?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FloodlightActivityGroupsResource { + /** Gets one floodlight activity group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity Group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new floodlight activity group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. */ + list(request: { + /** + * Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty + * result. + */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId + * for a non-empty result. + */ + floodlightConfigurationId?: string; + /** Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like + * "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add + * wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with + * name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only floodlight activity groups with the specified floodlight activity group type. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity Group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FloodlightConfigurationsResource { + /** Gets one floodlight configuration by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight configuration ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of floodlight configurations, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight configuration. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight configuration ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight configuration. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InventoryItemsResource { + /** Gets one inventory item by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Inventory item ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of inventory items, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only inventory items with these IDs. */ + ids?: string; + /** Select only inventory items that are in plan. */ + inPlan?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only inventory items that belong to specified orders. */ + orderId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only inventory items that are associated with these sites. */ + siteId?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only inventory items with this type. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface LandingPagesResource { + /** Deletes an existing campaign landing page. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Landing page ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one campaign landing page by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Landing page ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new landing page for the specified campaign. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of landing pages for the specified campaign. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign landing page. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Landing page ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign landing page. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface LanguagesResource { + /** Retrieves a list of languages. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetrosResource { + /** Retrieves a list of metros. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MobileCarriersResource { + /** Gets one mobile carrier by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Mobile carrier ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of mobile carriers. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OperatingSystemVersionsResource { + /** Gets one operating system version by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Operating system version ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of operating system versions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OperatingSystemsResource { + /** Gets one operating system by DART ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Operating system DART ID. */ + dartId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of operating systems. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OrderDocumentsResource { + /** Gets one order document by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Order document ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of order documents, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Select only order documents that have been approved by at least one user. */ + approved?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only order documents with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only order documents for specified orders. */ + orderId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names + * like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", + * "orderdocument 2015", or simply "orderdocument". + */ + searchString?: string; + /** Select only order documents that are associated with these sites. */ + siteId?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OrdersResource { + /** Gets one order by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Order ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for orders. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of orders, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only orders with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for orders. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", + * "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For + * example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + */ + searchString?: string; + /** Select only orders that are associated with these site IDs. */ + siteId?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlacementGroupsResource { + /** Gets one placement group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new placement group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of placement groups, possibly filtered. This method supports paging. */ + list(request: { + /** Select only placement groups that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived placements. Don't set this field to select both archived and non-archived placements. */ + archived?: boolean; + /** Select only placement groups that belong to these campaigns. */ + campaignIds?: string; + /** Select only placement groups that are associated with these content categories. */ + contentCategoryIds?: string; + /** Select only placement groups that are associated with these directory sites. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only placement groups with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". */ + maxEndDate?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". */ + maxStartDate?: string; + /** Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". */ + minEndDate?: string; + /** Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". */ + minStartDate?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** + * Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group + * of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at + * the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + */ + placementGroupType?: string; + /** Select only placement groups that are associated with these placement strategies. */ + placementStrategyIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Select only placement groups with these pricing types. */ + pricingTypes?: string; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names + * like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", + * "placementgroup 2015", or simply "placementgroup". + */ + searchString?: string; + /** Select only placement groups that are associated with these sites. */ + siteIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlacementStrategiesResource { + /** Deletes an existing placement strategy. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement strategy ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one placement strategy by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement strategy ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new placement strategy. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of placement strategies, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only placement strategies with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like + * "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly + * at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", + * "placementstrategy 2015", or simply "placementstrategy". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement strategy. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement strategy ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement strategy. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlacementsResource { + /** Generates tags for a placement. */ + generatetags(request: { + /** Data format for the response. */ + alt?: string; + /** Generate placements belonging to this campaign. This is a required field. */ + campaignId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Generate tags for these placements. */ + placementIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Tag formats to generate for these placements. + * + * Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + */ + tagFormats?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one placement by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new placement. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of placements, possibly filtered. This method supports paging. */ + list(request: { + /** Select only placements that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived placements. Don't set this field to select both archived and non-archived placements. */ + archived?: boolean; + /** Select only placements that belong to these campaigns. */ + campaignIds?: string; + /** + * Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on + * mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to + * rendering in in-stream video ads developed with the VAST standard. + */ + compatibilities?: string; + /** Select only placements that are associated with these content categories. */ + contentCategoryIds?: string; + /** Select only placements that are associated with these directory sites. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only placements that belong to these placement groups. */ + groupIds?: string; + /** Select only placements with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". */ + maxEndDate?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". */ + maxStartDate?: string; + /** Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". */ + minEndDate?: string; + /** Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". */ + minStartDate?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Select only placements with this payment source. */ + paymentSource?: string; + /** Select only placements that are associated with these placement strategies. */ + placementStrategyIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Select only placements with these pricing types. */ + pricingTypes?: string; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like + * "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end + * of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply + * "placement". + */ + searchString?: string; + /** Select only placements that are associated with these sites. */ + siteIds?: string; + /** Select only placements that are associated with these sizes. */ + sizeIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlatformTypesResource { + /** Gets one platform type by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Platform type ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of platform types. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PostalCodesResource { + /** Gets one postal code by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Postal code ID. */ + code: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of postal codes. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Gets one project by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Project ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of projects, possibly filtered. This method supports paging. */ + list(request: { + /** Select only projects with these advertiser IDs. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only projects with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June + * 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionsResource { + /** Retrieves a list of regions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RemarketingListSharesResource { + /** Gets one remarketing list share by remarketing list ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Remarketing list ID. */ + remarketingListId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list share. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Remarketing list ID. */ + remarketingListId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list share. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RemarketingListsResource { + /** Gets one remarketing list by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Remarketing list ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new remarketing list. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of remarketing lists, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active or only inactive remarketing lists. */ + active?: boolean; + /** Select only remarketing lists owned by this advertiser. */ + advertiserId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only remarketing lists that have this floodlight activity ID. */ + floodlightActivityId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like + * "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at + * the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", + * "remarketing list 2015", or simply "remarketing list". + */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Remarketing list ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CompatibleFieldsResource { + /** + * Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input + * report and user permissions. + */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FilesResource { + /** Retrieves a report file. This method supports media download. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the report file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists files for a report. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the parent report. */ + reportId: string; + /** The field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** Deletes a report by its ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a report by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a report. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves list of reports. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The scope that defines which results are returned. */ + scope?: string; + /** The field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a report. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs a report. */ + run(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** If set and true, tries to run the report synchronously. */ + synchronous?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a report. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + compatibleFields: CompatibleFieldsResource; + files: FilesResource; + } + interface SitesResource { + /** Gets one site by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Site ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new site. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of sites, possibly filtered. This method supports paging. */ + list(request: { + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInStreamVideoPlacements?: boolean; + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInterstitialPlacements?: boolean; + /** Select only sites that accept publisher paid placements. */ + acceptsPublisherPaidPlacements?: boolean; + /** Select only AdWords sites. */ + adWordsSite?: boolean; + /** Data format for the response. */ + alt?: string; + /** Select only approved sites. */ + approved?: boolean; + /** Select only sites with these campaign IDs. */ + campaignIds?: string; + /** Select only sites with these directory site IDs. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only sites with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June + * 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For + * example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only sites with this subaccount ID. */ + subaccountId?: string; + /** Select only sites that have not been mapped to a directory site. */ + unmappedSite?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing site. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Site ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing site. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SizesResource { + /** Gets one size by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Size ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new size. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of sizes, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only sizes with this height. */ + height?: number; + /** Select only IAB standard sizes. */ + iabStandard?: boolean; + /** Select only sizes with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Select only sizes with this width. */ + width?: number; + }): Request; + } + interface SubaccountsResource { + /** Gets one subaccount by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Subaccount ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new subaccount. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a list of subaccounts, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only subaccounts with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount + * June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the + * search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing subaccount. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Subaccount ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing subaccount. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetableRemarketingListsResource { + /** Gets one remarketing list by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Remarketing list ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active or only inactive targetable remarketing lists. */ + active?: boolean; + /** Select only targetable remarketing lists targetable by these advertisers. */ + advertiserId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like + * "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at + * the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", + * "remarketing list 2015", or simply "remarketing list". + */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetingTemplatesResource { + /** Gets one targeting template by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Targeting template ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new targeting template. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of targeting templates, optionally filtered. This method supports paging. */ + list(request: { + /** Select only targeting templates with this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only targeting templates with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June + * 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing targeting template. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Targeting template ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing targeting template. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserProfilesResource { + /** Gets one user profile by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves list of user profiles for a user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserRolePermissionGroupsResource { + /** Gets one user role permission group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role permission group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a list of all supported user role permission groups. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserRolePermissionsResource { + /** Gets one user role permission by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role permission ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a list of user role permissions, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only user role permissions with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserRolesResource { + /** Deletes an existing user role. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one user role by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new user role. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of user roles, possibly filtered. This method supports paging. */ + list(request: { + /** Select only account level user roles not associated with any specific subaccount. */ + accountUserRoleOnly?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only user roles with the specified IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June + * 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only user roles that belong to this subaccount. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing user role. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing user role. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VideoFormatsResource { + /** Gets one video format by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Video format ID. */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists available video formats. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.dfareporting/readme.md b/types/gapi.client.dfareporting/readme.md new file mode 100644 index 0000000000..2a210805c5 --- /dev/null +++ b/types/gapi.client.dfareporting/readme.md @@ -0,0 +1,1070 @@ +# TypeScript typings for DCM/DFA Reporting And Trafficking API v2.8 +Manages your DoubleClick Campaign Manager ad campaigns and reports. +For detailed description please check [documentation](https://developers.google.com/doubleclick-advertisers/). + +## Installing + +Install typings for DCM/DFA Reporting And Trafficking API: +``` +npm install @types/gapi.client.dfareporting@v2.8 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dfareporting', 'v2.8', () => { + // now we can use gapi.client.dfareporting + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage DoubleClick Digital Marketing conversions + 'https://www.googleapis.com/auth/ddmconversions', + + // View and manage DoubleClick for Advertisers reports + 'https://www.googleapis.com/auth/dfareporting', + + // View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns + 'https://www.googleapis.com/auth/dfatrafficking', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DCM/DFA Reporting And Trafficking API resources: + +```typescript + +/* +Gets the account's active ad summary by account ID. +*/ +await gapi.client.accountActiveAdSummaries.get({ profileId: "profileId", summaryAccountId: "summaryAccountId", }); + +/* +Gets one account permission group by ID. +*/ +await gapi.client.accountPermissionGroups.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves the list of account permission groups. +*/ +await gapi.client.accountPermissionGroups.list({ profileId: "profileId", }); + +/* +Gets one account permission by ID. +*/ +await gapi.client.accountPermissions.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves the list of account permissions. +*/ +await gapi.client.accountPermissions.list({ profileId: "profileId", }); + +/* +Gets one account user profile by ID. +*/ +await gapi.client.accountUserProfiles.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new account user profile. +*/ +await gapi.client.accountUserProfiles.insert({ profileId: "profileId", }); + +/* +Retrieves a list of account user profiles, possibly filtered. This method supports paging. +*/ +await gapi.client.accountUserProfiles.list({ profileId: "profileId", }); + +/* +Updates an existing account user profile. This method supports patch semantics. +*/ +await gapi.client.accountUserProfiles.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing account user profile. +*/ +await gapi.client.accountUserProfiles.update({ profileId: "profileId", }); + +/* +Gets one account by ID. +*/ +await gapi.client.accounts.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves the list of accounts, possibly filtered. This method supports paging. +*/ +await gapi.client.accounts.list({ profileId: "profileId", }); + +/* +Updates an existing account. This method supports patch semantics. +*/ +await gapi.client.accounts.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing account. +*/ +await gapi.client.accounts.update({ profileId: "profileId", }); + +/* +Gets one ad by ID. +*/ +await gapi.client.ads.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new ad. +*/ +await gapi.client.ads.insert({ profileId: "profileId", }); + +/* +Retrieves a list of ads, possibly filtered. This method supports paging. +*/ +await gapi.client.ads.list({ profileId: "profileId", }); + +/* +Updates an existing ad. This method supports patch semantics. +*/ +await gapi.client.ads.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing ad. +*/ +await gapi.client.ads.update({ profileId: "profileId", }); + +/* +Deletes an existing advertiser group. +*/ +await gapi.client.advertiserGroups.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one advertiser group by ID. +*/ +await gapi.client.advertiserGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new advertiser group. +*/ +await gapi.client.advertiserGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of advertiser groups, possibly filtered. This method supports paging. +*/ +await gapi.client.advertiserGroups.list({ profileId: "profileId", }); + +/* +Updates an existing advertiser group. This method supports patch semantics. +*/ +await gapi.client.advertiserGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing advertiser group. +*/ +await gapi.client.advertiserGroups.update({ profileId: "profileId", }); + +/* +Gets one advertiser by ID. +*/ +await gapi.client.advertisers.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new advertiser. +*/ +await gapi.client.advertisers.insert({ profileId: "profileId", }); + +/* +Retrieves a list of advertisers, possibly filtered. This method supports paging. +*/ +await gapi.client.advertisers.list({ profileId: "profileId", }); + +/* +Updates an existing advertiser. This method supports patch semantics. +*/ +await gapi.client.advertisers.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing advertiser. +*/ +await gapi.client.advertisers.update({ profileId: "profileId", }); + +/* +Retrieves a list of browsers. +*/ +await gapi.client.browsers.list({ profileId: "profileId", }); + +/* +Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already. +*/ +await gapi.client.campaignCreativeAssociations.insert({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. +*/ +await gapi.client.campaignCreativeAssociations.list({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Gets one campaign by ID. +*/ +await gapi.client.campaigns.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new campaign. +*/ +await gapi.client.campaigns.insert({ defaultLandingPageName: "defaultLandingPageName", defaultLandingPageUrl: "defaultLandingPageUrl", profileId: "profileId", }); + +/* +Retrieves a list of campaigns, possibly filtered. This method supports paging. +*/ +await gapi.client.campaigns.list({ profileId: "profileId", }); + +/* +Updates an existing campaign. This method supports patch semantics. +*/ +await gapi.client.campaigns.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing campaign. +*/ +await gapi.client.campaigns.update({ profileId: "profileId", }); + +/* +Gets one change log by ID. +*/ +await gapi.client.changeLogs.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of change logs. This method supports paging. +*/ +await gapi.client.changeLogs.list({ profileId: "profileId", }); + +/* +Retrieves a list of cities, possibly filtered. +*/ +await gapi.client.cities.list({ profileId: "profileId", }); + +/* +Gets one connection type by ID. +*/ +await gapi.client.connectionTypes.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of connection types. +*/ +await gapi.client.connectionTypes.list({ profileId: "profileId", }); + +/* +Deletes an existing content category. +*/ +await gapi.client.contentCategories.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one content category by ID. +*/ +await gapi.client.contentCategories.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new content category. +*/ +await gapi.client.contentCategories.insert({ profileId: "profileId", }); + +/* +Retrieves a list of content categories, possibly filtered. This method supports paging. +*/ +await gapi.client.contentCategories.list({ profileId: "profileId", }); + +/* +Updates an existing content category. This method supports patch semantics. +*/ +await gapi.client.contentCategories.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing content category. +*/ +await gapi.client.contentCategories.update({ profileId: "profileId", }); + +/* +Inserts conversions. +*/ +await gapi.client.conversions.batchinsert({ profileId: "profileId", }); + +/* +Updates existing conversions. +*/ +await gapi.client.conversions.batchupdate({ profileId: "profileId", }); + +/* +Gets one country by ID. +*/ +await gapi.client.countries.get({ dartId: "dartId", profileId: "profileId", }); + +/* +Retrieves a list of countries. +*/ +await gapi.client.countries.list({ profileId: "profileId", }); + +/* +Inserts a new creative asset. +*/ +await gapi.client.creativeAssets.insert({ advertiserId: "advertiserId", profileId: "profileId", }); + +/* +Deletes an existing creative field value. +*/ +await gapi.client.creativeFieldValues.delete({ creativeFieldId: "creativeFieldId", id: "id", profileId: "profileId", }); + +/* +Gets one creative field value by ID. +*/ +await gapi.client.creativeFieldValues.get({ creativeFieldId: "creativeFieldId", id: "id", profileId: "profileId", }); + +/* +Inserts a new creative field value. +*/ +await gapi.client.creativeFieldValues.insert({ creativeFieldId: "creativeFieldId", profileId: "profileId", }); + +/* +Retrieves a list of creative field values, possibly filtered. This method supports paging. +*/ +await gapi.client.creativeFieldValues.list({ creativeFieldId: "creativeFieldId", profileId: "profileId", }); + +/* +Updates an existing creative field value. This method supports patch semantics. +*/ +await gapi.client.creativeFieldValues.patch({ creativeFieldId: "creativeFieldId", id: "id", profileId: "profileId", }); + +/* +Updates an existing creative field value. +*/ +await gapi.client.creativeFieldValues.update({ creativeFieldId: "creativeFieldId", profileId: "profileId", }); + +/* +Deletes an existing creative field. +*/ +await gapi.client.creativeFields.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one creative field by ID. +*/ +await gapi.client.creativeFields.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new creative field. +*/ +await gapi.client.creativeFields.insert({ profileId: "profileId", }); + +/* +Retrieves a list of creative fields, possibly filtered. This method supports paging. +*/ +await gapi.client.creativeFields.list({ profileId: "profileId", }); + +/* +Updates an existing creative field. This method supports patch semantics. +*/ +await gapi.client.creativeFields.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing creative field. +*/ +await gapi.client.creativeFields.update({ profileId: "profileId", }); + +/* +Gets one creative group by ID. +*/ +await gapi.client.creativeGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new creative group. +*/ +await gapi.client.creativeGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of creative groups, possibly filtered. This method supports paging. +*/ +await gapi.client.creativeGroups.list({ profileId: "profileId", }); + +/* +Updates an existing creative group. This method supports patch semantics. +*/ +await gapi.client.creativeGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing creative group. +*/ +await gapi.client.creativeGroups.update({ profileId: "profileId", }); + +/* +Gets one creative by ID. +*/ +await gapi.client.creatives.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new creative. +*/ +await gapi.client.creatives.insert({ profileId: "profileId", }); + +/* +Retrieves a list of creatives, possibly filtered. This method supports paging. +*/ +await gapi.client.creatives.list({ profileId: "profileId", }); + +/* +Updates an existing creative. This method supports patch semantics. +*/ +await gapi.client.creatives.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing creative. +*/ +await gapi.client.creatives.update({ profileId: "profileId", }); + +/* +Retrieves list of report dimension values for a list of filters. +*/ +await gapi.client.dimensionValues.query({ profileId: "profileId", }); + +/* +Gets one directory site contact by ID. +*/ +await gapi.client.directorySiteContacts.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of directory site contacts, possibly filtered. This method supports paging. +*/ +await gapi.client.directorySiteContacts.list({ profileId: "profileId", }); + +/* +Gets one directory site by ID. +*/ +await gapi.client.directorySites.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new directory site. +*/ +await gapi.client.directorySites.insert({ profileId: "profileId", }); + +/* +Retrieves a list of directory sites, possibly filtered. This method supports paging. +*/ +await gapi.client.directorySites.list({ profileId: "profileId", }); + +/* +Deletes an existing dynamic targeting key. +*/ +await gapi.client.dynamicTargetingKeys.delete({ name: "name", objectId: "objectId", objectType: "objectType", profileId: "profileId", }); + +/* +Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. +*/ +await gapi.client.dynamicTargetingKeys.insert({ profileId: "profileId", }); + +/* +Retrieves a list of dynamic targeting keys. +*/ +await gapi.client.dynamicTargetingKeys.list({ profileId: "profileId", }); + +/* +Deletes an existing event tag. +*/ +await gapi.client.eventTags.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one event tag by ID. +*/ +await gapi.client.eventTags.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new event tag. +*/ +await gapi.client.eventTags.insert({ profileId: "profileId", }); + +/* +Retrieves a list of event tags, possibly filtered. +*/ +await gapi.client.eventTags.list({ profileId: "profileId", }); + +/* +Updates an existing event tag. This method supports patch semantics. +*/ +await gapi.client.eventTags.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing event tag. +*/ +await gapi.client.eventTags.update({ profileId: "profileId", }); + +/* +Retrieves a report file by its report ID and file ID. This method supports media download. +*/ +await gapi.client.files.get({ fileId: "fileId", reportId: "reportId", }); + +/* +Lists files for a user profile. +*/ +await gapi.client.files.list({ profileId: "profileId", }); + +/* +Deletes an existing floodlight activity. +*/ +await gapi.client.floodlightActivities.delete({ id: "id", profileId: "profileId", }); + +/* +Generates a tag for a floodlight activity. +*/ +await gapi.client.floodlightActivities.generatetag({ profileId: "profileId", }); + +/* +Gets one floodlight activity by ID. +*/ +await gapi.client.floodlightActivities.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new floodlight activity. +*/ +await gapi.client.floodlightActivities.insert({ profileId: "profileId", }); + +/* +Retrieves a list of floodlight activities, possibly filtered. This method supports paging. +*/ +await gapi.client.floodlightActivities.list({ profileId: "profileId", }); + +/* +Updates an existing floodlight activity. This method supports patch semantics. +*/ +await gapi.client.floodlightActivities.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing floodlight activity. +*/ +await gapi.client.floodlightActivities.update({ profileId: "profileId", }); + +/* +Gets one floodlight activity group by ID. +*/ +await gapi.client.floodlightActivityGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new floodlight activity group. +*/ +await gapi.client.floodlightActivityGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. +*/ +await gapi.client.floodlightActivityGroups.list({ profileId: "profileId", }); + +/* +Updates an existing floodlight activity group. This method supports patch semantics. +*/ +await gapi.client.floodlightActivityGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing floodlight activity group. +*/ +await gapi.client.floodlightActivityGroups.update({ profileId: "profileId", }); + +/* +Gets one floodlight configuration by ID. +*/ +await gapi.client.floodlightConfigurations.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of floodlight configurations, possibly filtered. +*/ +await gapi.client.floodlightConfigurations.list({ profileId: "profileId", }); + +/* +Updates an existing floodlight configuration. This method supports patch semantics. +*/ +await gapi.client.floodlightConfigurations.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing floodlight configuration. +*/ +await gapi.client.floodlightConfigurations.update({ profileId: "profileId", }); + +/* +Gets one inventory item by ID. +*/ +await gapi.client.inventoryItems.get({ id: "id", profileId: "profileId", projectId: "projectId", }); + +/* +Retrieves a list of inventory items, possibly filtered. This method supports paging. +*/ +await gapi.client.inventoryItems.list({ profileId: "profileId", projectId: "projectId", }); + +/* +Deletes an existing campaign landing page. +*/ +await gapi.client.landingPages.delete({ campaignId: "campaignId", id: "id", profileId: "profileId", }); + +/* +Gets one campaign landing page by ID. +*/ +await gapi.client.landingPages.get({ campaignId: "campaignId", id: "id", profileId: "profileId", }); + +/* +Inserts a new landing page for the specified campaign. +*/ +await gapi.client.landingPages.insert({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Retrieves the list of landing pages for the specified campaign. +*/ +await gapi.client.landingPages.list({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Updates an existing campaign landing page. This method supports patch semantics. +*/ +await gapi.client.landingPages.patch({ campaignId: "campaignId", id: "id", profileId: "profileId", }); + +/* +Updates an existing campaign landing page. +*/ +await gapi.client.landingPages.update({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Retrieves a list of languages. +*/ +await gapi.client.languages.list({ profileId: "profileId", }); + +/* +Retrieves a list of metros. +*/ +await gapi.client.metros.list({ profileId: "profileId", }); + +/* +Gets one mobile carrier by ID. +*/ +await gapi.client.mobileCarriers.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of mobile carriers. +*/ +await gapi.client.mobileCarriers.list({ profileId: "profileId", }); + +/* +Gets one operating system version by ID. +*/ +await gapi.client.operatingSystemVersions.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of operating system versions. +*/ +await gapi.client.operatingSystemVersions.list({ profileId: "profileId", }); + +/* +Gets one operating system by DART ID. +*/ +await gapi.client.operatingSystems.get({ dartId: "dartId", profileId: "profileId", }); + +/* +Retrieves a list of operating systems. +*/ +await gapi.client.operatingSystems.list({ profileId: "profileId", }); + +/* +Gets one order document by ID. +*/ +await gapi.client.orderDocuments.get({ id: "id", profileId: "profileId", projectId: "projectId", }); + +/* +Retrieves a list of order documents, possibly filtered. This method supports paging. +*/ +await gapi.client.orderDocuments.list({ profileId: "profileId", projectId: "projectId", }); + +/* +Gets one order by ID. +*/ +await gapi.client.orders.get({ id: "id", profileId: "profileId", projectId: "projectId", }); + +/* +Retrieves a list of orders, possibly filtered. This method supports paging. +*/ +await gapi.client.orders.list({ profileId: "profileId", projectId: "projectId", }); + +/* +Gets one placement group by ID. +*/ +await gapi.client.placementGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new placement group. +*/ +await gapi.client.placementGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of placement groups, possibly filtered. This method supports paging. +*/ +await gapi.client.placementGroups.list({ profileId: "profileId", }); + +/* +Updates an existing placement group. This method supports patch semantics. +*/ +await gapi.client.placementGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing placement group. +*/ +await gapi.client.placementGroups.update({ profileId: "profileId", }); + +/* +Deletes an existing placement strategy. +*/ +await gapi.client.placementStrategies.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one placement strategy by ID. +*/ +await gapi.client.placementStrategies.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new placement strategy. +*/ +await gapi.client.placementStrategies.insert({ profileId: "profileId", }); + +/* +Retrieves a list of placement strategies, possibly filtered. This method supports paging. +*/ +await gapi.client.placementStrategies.list({ profileId: "profileId", }); + +/* +Updates an existing placement strategy. This method supports patch semantics. +*/ +await gapi.client.placementStrategies.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing placement strategy. +*/ +await gapi.client.placementStrategies.update({ profileId: "profileId", }); + +/* +Generates tags for a placement. +*/ +await gapi.client.placements.generatetags({ profileId: "profileId", }); + +/* +Gets one placement by ID. +*/ +await gapi.client.placements.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new placement. +*/ +await gapi.client.placements.insert({ profileId: "profileId", }); + +/* +Retrieves a list of placements, possibly filtered. This method supports paging. +*/ +await gapi.client.placements.list({ profileId: "profileId", }); + +/* +Updates an existing placement. This method supports patch semantics. +*/ +await gapi.client.placements.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing placement. +*/ +await gapi.client.placements.update({ profileId: "profileId", }); + +/* +Gets one platform type by ID. +*/ +await gapi.client.platformTypes.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of platform types. +*/ +await gapi.client.platformTypes.list({ profileId: "profileId", }); + +/* +Gets one postal code by ID. +*/ +await gapi.client.postalCodes.get({ code: "code", profileId: "profileId", }); + +/* +Retrieves a list of postal codes. +*/ +await gapi.client.postalCodes.list({ profileId: "profileId", }); + +/* +Gets one project by ID. +*/ +await gapi.client.projects.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of projects, possibly filtered. This method supports paging. +*/ +await gapi.client.projects.list({ profileId: "profileId", }); + +/* +Retrieves a list of regions. +*/ +await gapi.client.regions.list({ profileId: "profileId", }); + +/* +Gets one remarketing list share by remarketing list ID. +*/ +await gapi.client.remarketingListShares.get({ profileId: "profileId", remarketingListId: "remarketingListId", }); + +/* +Updates an existing remarketing list share. This method supports patch semantics. +*/ +await gapi.client.remarketingListShares.patch({ profileId: "profileId", remarketingListId: "remarketingListId", }); + +/* +Updates an existing remarketing list share. +*/ +await gapi.client.remarketingListShares.update({ profileId: "profileId", }); + +/* +Gets one remarketing list by ID. +*/ +await gapi.client.remarketingLists.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new remarketing list. +*/ +await gapi.client.remarketingLists.insert({ profileId: "profileId", }); + +/* +Retrieves a list of remarketing lists, possibly filtered. This method supports paging. +*/ +await gapi.client.remarketingLists.list({ advertiserId: "advertiserId", profileId: "profileId", }); + +/* +Updates an existing remarketing list. This method supports patch semantics. +*/ +await gapi.client.remarketingLists.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing remarketing list. +*/ +await gapi.client.remarketingLists.update({ profileId: "profileId", }); + +/* +Deletes a report by its ID. +*/ +await gapi.client.reports.delete({ profileId: "profileId", reportId: "reportId", }); + +/* +Retrieves a report by its ID. +*/ +await gapi.client.reports.get({ profileId: "profileId", reportId: "reportId", }); + +/* +Creates a report. +*/ +await gapi.client.reports.insert({ profileId: "profileId", }); + +/* +Retrieves list of reports. +*/ +await gapi.client.reports.list({ profileId: "profileId", }); + +/* +Updates a report. This method supports patch semantics. +*/ +await gapi.client.reports.patch({ profileId: "profileId", reportId: "reportId", }); + +/* +Runs a report. +*/ +await gapi.client.reports.run({ profileId: "profileId", reportId: "reportId", }); + +/* +Updates a report. +*/ +await gapi.client.reports.update({ profileId: "profileId", reportId: "reportId", }); + +/* +Gets one site by ID. +*/ +await gapi.client.sites.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new site. +*/ +await gapi.client.sites.insert({ profileId: "profileId", }); + +/* +Retrieves a list of sites, possibly filtered. This method supports paging. +*/ +await gapi.client.sites.list({ profileId: "profileId", }); + +/* +Updates an existing site. This method supports patch semantics. +*/ +await gapi.client.sites.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing site. +*/ +await gapi.client.sites.update({ profileId: "profileId", }); + +/* +Gets one size by ID. +*/ +await gapi.client.sizes.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new size. +*/ +await gapi.client.sizes.insert({ profileId: "profileId", }); + +/* +Retrieves a list of sizes, possibly filtered. +*/ +await gapi.client.sizes.list({ profileId: "profileId", }); + +/* +Gets one subaccount by ID. +*/ +await gapi.client.subaccounts.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new subaccount. +*/ +await gapi.client.subaccounts.insert({ profileId: "profileId", }); + +/* +Gets a list of subaccounts, possibly filtered. This method supports paging. +*/ +await gapi.client.subaccounts.list({ profileId: "profileId", }); + +/* +Updates an existing subaccount. This method supports patch semantics. +*/ +await gapi.client.subaccounts.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing subaccount. +*/ +await gapi.client.subaccounts.update({ profileId: "profileId", }); + +/* +Gets one remarketing list by ID. +*/ +await gapi.client.targetableRemarketingLists.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. +*/ +await gapi.client.targetableRemarketingLists.list({ advertiserId: "advertiserId", profileId: "profileId", }); + +/* +Gets one targeting template by ID. +*/ +await gapi.client.targetingTemplates.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new targeting template. +*/ +await gapi.client.targetingTemplates.insert({ profileId: "profileId", }); + +/* +Retrieves a list of targeting templates, optionally filtered. This method supports paging. +*/ +await gapi.client.targetingTemplates.list({ profileId: "profileId", }); + +/* +Updates an existing targeting template. This method supports patch semantics. +*/ +await gapi.client.targetingTemplates.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing targeting template. +*/ +await gapi.client.targetingTemplates.update({ profileId: "profileId", }); + +/* +Gets one user profile by ID. +*/ +await gapi.client.userProfiles.get({ profileId: "profileId", }); + +/* +Retrieves list of user profiles for a user. +*/ +await gapi.client.userProfiles.list({ }); + +/* +Gets one user role permission group by ID. +*/ +await gapi.client.userRolePermissionGroups.get({ id: "id", profileId: "profileId", }); + +/* +Gets a list of all supported user role permission groups. +*/ +await gapi.client.userRolePermissionGroups.list({ profileId: "profileId", }); + +/* +Gets one user role permission by ID. +*/ +await gapi.client.userRolePermissions.get({ id: "id", profileId: "profileId", }); + +/* +Gets a list of user role permissions, possibly filtered. +*/ +await gapi.client.userRolePermissions.list({ profileId: "profileId", }); + +/* +Deletes an existing user role. +*/ +await gapi.client.userRoles.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one user role by ID. +*/ +await gapi.client.userRoles.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new user role. +*/ +await gapi.client.userRoles.insert({ profileId: "profileId", }); + +/* +Retrieves a list of user roles, possibly filtered. This method supports paging. +*/ +await gapi.client.userRoles.list({ profileId: "profileId", }); + +/* +Updates an existing user role. This method supports patch semantics. +*/ +await gapi.client.userRoles.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing user role. +*/ +await gapi.client.userRoles.update({ profileId: "profileId", }); + +/* +Gets one video format by ID. +*/ +await gapi.client.videoFormats.get({ id: 1, profileId: "profileId", }); + +/* +Lists available video formats. +*/ +await gapi.client.videoFormats.list({ profileId: "profileId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.dfareporting/tsconfig.json b/types/gapi.client.dfareporting/tsconfig.json new file mode 100644 index 0000000000..78bcd11678 --- /dev/null +++ b/types/gapi.client.dfareporting/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dfareporting-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dfareporting/tslint.json b/types/gapi.client.dfareporting/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dfareporting/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.discovery/gapi.client.discovery-tests.ts b/types/gapi.client.discovery/gapi.client.discovery-tests.ts new file mode 100644 index 0000000000..c1dab1700b --- /dev/null +++ b/types/gapi.client.discovery/gapi.client.discovery-tests.ts @@ -0,0 +1,26 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('discovery', 'v1', () => { + /** now we can use gapi.client.discovery */ + + run(); + }); + + async function run() { + /** Retrieve the description of a particular version of an api. */ + await gapi.client.apis.getRest({ + api: "api", + version: "version", + }); + /** Retrieve the list of APIs supported at this endpoint. */ + await gapi.client.apis.list({ + name: "name", + preferred: true, + }); + } +}); diff --git a/types/gapi.client.discovery/index.d.ts b/types/gapi.client.discovery/index.d.ts new file mode 100644 index 0000000000..570928f44f --- /dev/null +++ b/types/gapi.client.discovery/index.d.ts @@ -0,0 +1,322 @@ +// Type definitions for Google APIs Discovery Service v1 1.0 +// Project: https://developers.google.com/discovery/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/discovery/v1/rest + +/// + +declare namespace gapi.client { + /** Load APIs Discovery Service v1 */ + function load(name: "discovery", version: "v1"): PromiseLike; + function load(name: "discovery", version: "v1", callback: () => any): void; + + const apis: discovery.ApisResource; + + namespace discovery { + interface DirectoryList { + /** Indicate the version of the Discovery API used to generate this doc. */ + discoveryVersion?: string; + /** The individual directory entries. One entry per api/version pair. */ + items?: Array<{ + /** The description of this API. */ + description?: string; + /** A link to the discovery document. */ + discoveryLink?: string; + /** The URL for the discovery REST document. */ + discoveryRestUrl?: string; + /** A link to human readable documentation for the API. */ + documentationLink?: string; + /** Links to 16x16 and 32x32 icons representing the API. */ + icons?: { + /** The URL of the 16x16 icon. */ + x16?: string; + /** The URL of the 32x32 icon. */ + x32?: string; + }; + /** The id of this API. */ + id?: string; + /** The kind for this response. */ + kind?: string; + /** Labels for the status of this API, such as labs or deprecated. */ + labels?: string[]; + /** The name of the API. */ + name?: string; + /** True if this version is the preferred version to use. */ + preferred?: boolean; + /** The title of this API. */ + title?: string; + /** The version of the API. */ + version?: string; + }>; + /** The kind for this response. */ + kind?: string; + } + interface JsonSchema { + /** A reference to another schema. The value of this property is the "id" of another schema. */ + $ref?: string; + /** If this is a schema for an object, this property is the schema for any additional properties with dynamic keys on this object. */ + additionalProperties?: JsonSchema; + /** Additional information about this property. */ + annotations?: { + /** A list of methods for which this property is required on requests. */ + required?: string[]; + }; + /** The default value of this property (if one exists). */ + default?: string; + /** A description of this object. */ + description?: string; + /** Values this parameter may take (if it is an enum). */ + enum?: string[]; + /** The descriptions for the enums. Each position maps to the corresponding value in the "enum" array. */ + enumDescriptions?: string[]; + /** + * An additional regular expression or key that helps constrain the value. For more details see: + * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 + */ + format?: string; + /** Unique identifier for this schema. */ + id?: string; + /** If this is a schema for an array, this property is the schema for each element in the array. */ + items?: JsonSchema; + /** Whether this parameter goes in the query or the path for REST requests. */ + location?: string; + /** The maximum value of this parameter. */ + maximum?: string; + /** The minimum value of this parameter. */ + minimum?: string; + /** The regular expression this parameter must conform to. Uses Java 6 regex format: http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html */ + pattern?: string; + /** If this is a schema for an object, list the schema for each property of this object. */ + properties?: Record; + /** + * The value is read-only, generated by the service. The value cannot be modified by the client. If the value is included in a POST, PUT, or PATCH + * request, it is ignored by the service. + */ + readOnly?: boolean; + /** Whether this parameter may appear multiple times. */ + repeated?: boolean; + /** Whether the parameter is required. */ + required?: boolean; + /** The value type for this schema. A list of values can be found here: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 */ + type?: string; + /** + * In a variant data type, the value of one property is used to determine how to interpret the entire entity. Its value must exist in a map of + * descriminant values to schema names. + */ + variant?: { + /** The name of the type discriminant property. */ + discriminant?: string; + /** The map of discriminant value to schema to use for parsing.. */ + map?: Array<{ + $ref?: string; + type_value?: string; + }>; + }; + } + interface RestDescription { + /** Authentication information. */ + auth?: { + /** OAuth 2.0 authentication information. */ + oauth2?: { + /** Available OAuth 2.0 scopes. */ + scopes?: Record; + }; + }; + /** [DEPRECATED] The base path for REST requests. */ + basePath?: string; + /** [DEPRECATED] The base URL for REST requests. */ + baseUrl?: string; + /** The path for REST batch requests. */ + batchPath?: string; + /** Indicates how the API name should be capitalized and split into various parts. Useful for generating pretty class names. */ + canonicalName?: string; + /** The description of this API. */ + description?: string; + /** Indicate the version of the Discovery API used to generate this doc. */ + discoveryVersion?: string; + /** A link to human readable documentation for the API. */ + documentationLink?: string; + /** The ETag for this response. */ + etag?: string; + /** Enable exponential backoff for suitable methods in the generated clients. */ + exponentialBackoffDefault?: boolean; + /** A list of supported features for this API. */ + features?: string[]; + /** Links to 16x16 and 32x32 icons representing the API. */ + icons?: { + /** The URL of the 16x16 icon. */ + x16?: string; + /** The URL of the 32x32 icon. */ + x32?: string; + }; + /** The ID of this API. */ + id?: string; + /** The kind for this response. */ + kind?: string; + /** Labels for the status of this API, such as labs or deprecated. */ + labels?: string[]; + /** API-level methods for this API. */ + methods?: Record; + /** The name of this API. */ + name?: string; + /** + * The domain of the owner of this API. Together with the ownerName and a packagePath values, this can be used to generate a library for this API which + * would have a unique fully qualified name. + */ + ownerDomain?: string; + /** The name of the owner of this API. See ownerDomain. */ + ownerName?: string; + /** The package of the owner of this API. See ownerDomain. */ + packagePath?: string; + /** Common parameters that apply across all apis. */ + parameters?: Record; + /** The protocol described by this document. */ + protocol?: string; + /** The resources in this API. */ + resources?: Record; + /** The version of this API. */ + revision?: string; + /** The root URL under which all API services live. */ + rootUrl?: string; + /** The schemas for this API. */ + schemas?: Record; + /** The base path for all REST requests. */ + servicePath?: string; + /** The title of this API. */ + title?: string; + /** The version of this API. */ + version?: string; + version_module?: boolean; + } + interface RestMethod { + /** Description of this method. */ + description?: string; + /** Whether this method requires an ETag to be specified. The ETag is sent as an HTTP If-Match or If-None-Match header. */ + etagRequired?: boolean; + /** HTTP method used by this method. */ + httpMethod?: string; + /** A unique ID for this method. This property can be used to match methods between different versions of Discovery. */ + id?: string; + /** Media upload parameters. */ + mediaUpload?: { + /** MIME Media Ranges for acceptable media uploads to this method. */ + accept?: string[]; + /** Maximum size of a media upload, such as "1MB", "2GB" or "3TB". */ + maxSize?: string; + /** Supported upload protocols. */ + protocols?: { + /** Supports the Resumable Media Upload protocol. */ + resumable?: { + /** True if this endpoint supports uploading multipart media. */ + multipart?: boolean; + /** The URI path to be used for upload. Should be used in conjunction with the basePath property at the api-level. */ + path?: string; + }; + /** Supports uploading as a single HTTP request. */ + simple?: { + /** True if this endpoint supports upload multipart media. */ + multipart?: boolean; + /** The URI path to be used for upload. Should be used in conjunction with the basePath property at the api-level. */ + path?: string; + }; + }; + }; + /** + * Ordered list of required parameters, serves as a hint to clients on how to structure their method signatures. The array is ordered such that the + * "most-significant" parameter appears first. + */ + parameterOrder?: string[]; + /** Details for all parameters in this method. */ + parameters?: Record; + /** The URI path of this REST method. Should be used in conjunction with the basePath property at the api-level. */ + path?: string; + /** The schema for the request. */ + request?: { + /** Schema ID for the request schema. */ + $ref?: string; + /** parameter name. */ + parameterName?: string; + }; + /** The schema for the response. */ + response?: { + /** Schema ID for the response schema. */ + $ref?: string; + }; + /** OAuth 2.0 scopes applicable to this method. */ + scopes?: string[]; + /** Whether this method supports media downloads. */ + supportsMediaDownload?: boolean; + /** Whether this method supports media uploads. */ + supportsMediaUpload?: boolean; + /** Whether this method supports subscriptions. */ + supportsSubscription?: boolean; + /** Indicates that downloads from this method should use the download service URL (i.e. "/download"). Only applies if the method supports media download. */ + useMediaDownloadService?: boolean; + } + interface RestResource { + /** Methods on this resource. */ + methods?: Record; + /** Sub-resources on this resource. */ + resources?: Record; + } + interface ApisResource { + /** Retrieve the description of a particular version of an api. */ + getRest(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the API. */ + api: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The version of the API. */ + version: string; + }): Request; + /** Retrieve the list of APIs supported at this endpoint. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Only include APIs with the given name. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Return only the preferred version of an API. */ + preferred?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.discovery/readme.md b/types/gapi.client.discovery/readme.md new file mode 100644 index 0000000000..6ac616bdea --- /dev/null +++ b/types/gapi.client.discovery/readme.md @@ -0,0 +1,45 @@ +# TypeScript typings for APIs Discovery Service v1 +Provides information about other Google APIs, such as what APIs are available, the resource, and method details for each API. +For detailed description please check [documentation](https://developers.google.com/discovery/). + +## Installing + +Install typings for APIs Discovery Service: +``` +npm install @types/gapi.client.discovery@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('discovery', 'v1', () => { + // now we can use gapi.client.discovery + // ... +}); +``` + + + +After that you can use APIs Discovery Service resources: + +```typescript + +/* +Retrieve the description of a particular version of an api. +*/ +await gapi.client.apis.getRest({ api: "api", version: "version", }); + +/* +Retrieve the list of APIs supported at this endpoint. +*/ +await gapi.client.apis.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.discovery/tsconfig.json b/types/gapi.client.discovery/tsconfig.json new file mode 100644 index 0000000000..b597d1b278 --- /dev/null +++ b/types/gapi.client.discovery/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.discovery-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.discovery/tslint.json b/types/gapi.client.discovery/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.discovery/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dlp/gapi.client.dlp-tests.ts b/types/gapi.client.dlp/gapi.client.dlp-tests.ts new file mode 100644 index 0000000000..87fe123a67 --- /dev/null +++ b/types/gapi.client.dlp/gapi.client.dlp-tests.ts @@ -0,0 +1,60 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dlp', 'v2beta1', () => { + /** now we can use gapi.client.dlp */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * De-identifies potentially sensitive info from a list of strings. + * This method has limits on input size and output size. + */ + await gapi.client.content.deidentify({ + }); + /** + * Finds potentially sensitive info in a list of strings. + * This method has limits on input size, processing time, and output size. + */ + await gapi.client.content.inspect({ + }); + /** + * Redacts potentially sensitive info from a list of strings. + * This method has limits on input size, processing time, and output size. + */ + await gapi.client.content.redact({ + }); + /** + * Schedules a job to compute risk analysis metrics over content in a Google + * Cloud Platform repository. + */ + await gapi.client.dataSource.analyze({ + }); + /** Returns the list of root categories of sensitive information. */ + await gapi.client.rootCategories.list({ + languageCode: "languageCode", + }); + } +}); diff --git a/types/gapi.client.dlp/index.d.ts b/types/gapi.client.dlp/index.d.ts new file mode 100644 index 0000000000..29839bac80 --- /dev/null +++ b/types/gapi.client.dlp/index.d.ts @@ -0,0 +1,1612 @@ +// Type definitions for Google DLP API v2beta1 2.0 +// Project: https://cloud.google.com/dlp/docs/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://dlp.googleapis.com/$discovery/rest?version=v2beta1 + +/// + +declare namespace gapi.client { + /** Load DLP API v2beta1 */ + function load(name: "dlp", version: "v2beta1"): PromiseLike; + function load(name: "dlp", version: "v2beta1", callback: () => any): void; + + const content: dlp.ContentResource; + + const dataSource: dlp.DataSourceResource; + + const inspect: dlp.InspectResource; + + const riskAnalysis: dlp.RiskAnalysisResource; + + const rootCategories: dlp.RootCategoriesResource; + + namespace dlp { + interface GoogleLongrunningListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: GoogleLongrunningOperation[]; + } + interface GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: GoogleRpcStatus; + /** + * This field will contain an InspectOperationMetadata object for `inspect.operations.create` or a RiskAnalysisOperationMetadata object for + * `dataSource.analyze`. This will always be returned with the Operation. + */ + metadata?: Record; + /** The server-assigned name. The `name` should have the format of `inspect/operations/`. */ + name?: string; + /** + * This field will contain an InspectOperationResult object for `inspect.operations.create` or a RiskAnalysisOperationResult object for + * `dataSource.analyze`. + */ + response?: Record; + } + interface GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest { + /** Privacy metric to compute. */ + privacyMetric?: GooglePrivacyDlpV2beta1PrivacyMetric; + /** Input dataset to compute metrics over. */ + sourceTable?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. + * Nested fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields?: GooglePrivacyDlpV2beta1FieldId[]; + /** Complete BigQuery table reference. */ + tableReference?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1BigQueryTable { + /** Dataset ID of the table. */ + datasetId?: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId?: string; + /** Name of the table. */ + tableId?: string; + } + interface GooglePrivacyDlpV2beta1Bucket { + /** Upper bound of the range, exclusive; type must match min. */ + max?: GooglePrivacyDlpV2beta1Value; + /** + * Lower bound of the range, inclusive. Type should be the same as max if + * used. + */ + min?: GooglePrivacyDlpV2beta1Value; + /** + * Replacement value for this bucket. If not provided + * the default behavior will be to hyphenate the min-max range. + */ + replacementValue?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1BucketingConfig { + buckets?: GooglePrivacyDlpV2beta1Bucket[]; + } + interface GooglePrivacyDlpV2beta1CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are + * supported except for arrays and structs. However, it may be more + * informative to use NumericalStats when the field type is supported, + * depending on the data. + */ + field?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + /** Total number of records in this bucket. */ + bucketSize?: string; + /** + * Sample of value frequencies in this bucket. The total number of + * values returned per bucket is capped at 20. + */ + bucketValues?: GooglePrivacyDlpV2beta1ValueFrequency[]; + /** Lower bound on the value frequency of the values in this bucket. */ + valueFrequencyLowerBound?: string; + /** Upper bound on the value frequency of the values in this bucket. */ + valueFrequencyUpperBound?: string; + } + interface GooglePrivacyDlpV2beta1CategoricalStatsResult { + /** Histogram of value frequencies in the column. */ + valueFrequencyHistogramBuckets?: GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; + } + interface GooglePrivacyDlpV2beta1CategoryDescription { + /** Human readable form of the category name. */ + displayName?: string; + /** Internal name of the category. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1CharacterMaskConfig { + /** + * When masking a string, items in this list will be skipped when replacing. + * For example, if your string is 555-555-5555 and you ask us to skip `-` and + * mask 5 chars with * we would produce ***-*55-5555. + */ + charactersToIgnore?: GooglePrivacyDlpV2beta1CharsToIgnore[]; + /** + * Character to mask the sensitive values—for example, "*" for an + * alphabetic string such as name, or "0" for a numeric string such as ZIP + * code or credit card number. String must have length 1. If not supplied, we + * will default to "*" for strings, 0 for digits. + */ + maskingCharacter?: string; + /** + * Number of characters to mask. If not set, all matching chars will be + * masked. Skipped characters do not count towards this tally. + */ + numberToMask?: number; + /** + * Mask characters in reverse order. For example, if `masking_character` is + * '0', number_to_mask is 14, and `reverse_order` is false, then + * 1234-5678-9012-3456 -> 00000000000000-3456 + * If `masking_character` is '*', `number_to_mask` is 3, and `reverse_order` + * is true, then 12345 -> 12*** + */ + reverseOrder?: boolean; + } + interface GooglePrivacyDlpV2beta1CharsToIgnore { + charactersToSkip?: string; + commonCharactersToIgnore?: string; + } + interface GooglePrivacyDlpV2beta1CloudStorageKey { + /** Path to the file. */ + filePath?: string; + /** Byte offset of the referenced data in the file. */ + startOffset?: string; + } + interface GooglePrivacyDlpV2beta1CloudStorageOptions { + fileSet?: GooglePrivacyDlpV2beta1FileSet; + } + interface GooglePrivacyDlpV2beta1CloudStoragePath { + /** The url, in the format of `gs://bucket/`. */ + path?: string; + } + interface GooglePrivacyDlpV2beta1Color { + /** The amount of blue in the color as a value in the interval [0, 1]. */ + blue?: number; + /** The amount of green in the color as a value in the interval [0, 1]. */ + green?: number; + /** The amount of red in the color as a value in the interval [0, 1]. */ + red?: number; + } + interface GooglePrivacyDlpV2beta1Condition { + /** Field within the record this condition is evaluated against. [required] */ + field?: GooglePrivacyDlpV2beta1FieldId; + /** Operator used to compare the field or info type to the value. [required] */ + operator?: string; + /** Value to compare against. [Required, except for `EXISTS` tests.] */ + value?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1Conditions { + conditions?: GooglePrivacyDlpV2beta1Condition[]; + } + interface GooglePrivacyDlpV2beta1ContentItem { + /** Content data to inspect or redact. */ + data?: string; + /** Structured content for inspection. */ + table?: GooglePrivacyDlpV2beta1Table; + /** + * Type of the content, as defined in Content-Type HTTP header. + * Supported types are: all "text" types, octet streams, PNG images, + * JPEG images. + */ + type?: string; + /** String data to inspect or redact. */ + value?: string; + } + interface GooglePrivacyDlpV2beta1CreateInspectOperationRequest { + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** Additional configuration settings for long running operations. */ + operationConfig?: GooglePrivacyDlpV2beta1OperationConfig; + /** Optional location to store findings. */ + outputConfig?: GooglePrivacyDlpV2beta1OutputStorageConfig; + /** Specification of the data set to process. */ + storageConfig?: GooglePrivacyDlpV2beta1StorageConfig; + } + interface GooglePrivacyDlpV2beta1CryptoHashConfig { + /** The key used by the hash function. */ + cryptoKey?: GooglePrivacyDlpV2beta1CryptoKey; + } + interface GooglePrivacyDlpV2beta1CryptoKey { + kmsWrapped?: GooglePrivacyDlpV2beta1KmsWrappedCryptoKey; + transient?: GooglePrivacyDlpV2beta1TransientCryptoKey; + unwrapped?: GooglePrivacyDlpV2beta1UnwrappedCryptoKey; + } + interface GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { + commonAlphabet?: string; + /** + * A context may be used for higher security since the same + * identifier in two different contexts likely will be given a distinct + * surrogate. The principle is that the likeliness is inversely related + * to the ratio of the number of distinct identifiers per context over the + * number of possible surrogates: As long as this ratio is small, the + * likehood is large. + * + * If the context is not set, a default tweak will be used. + * If the context is set but: + * + * 1. there is no record present when transforming a given value or + * 1. the field is not present when transforming a given value, + * + * a default tweak will be used. + * + * Note that case (1) is expected when an `InfoTypeTransformation` is + * applied to both structured and non-structured `ContentItem`s. + * Currently, the referenced field may be of value type integer or string. + * + * The tweak is constructed as a sequence of bytes in big endian byte order + * such that: + * + * - a 64 bit integer is encoded followed by a single byte of value 1 + * - a string is encoded in UTF-8 format followed by a single byte of value 2 + * + * This is also known as the 'tweak', as in tweakable encryption. + */ + context?: GooglePrivacyDlpV2beta1FieldId; + /** The key used by the encryption algorithm. [required] */ + cryptoKey?: GooglePrivacyDlpV2beta1CryptoKey; + /** + * This is supported by mapping these to the alphanumeric characters + * that the FFX mode natively supports. This happens before/after + * encryption/decryption. + * Each character listed must appear only once. + * Number of characters must be in the range [2, 62]. + * This must be encoded as ASCII. + * The order of characters does not matter. + */ + customAlphabet?: string; + /** The native way to select the alphabet. Must be in the range [2, 62]. */ + radix?: number; + } + interface GooglePrivacyDlpV2beta1DatastoreKey { + /** Datastore entity key. */ + entityKey?: GooglePrivacyDlpV2beta1Key; + } + interface GooglePrivacyDlpV2beta1DatastoreOptions { + /** The kind to process. */ + kind?: GooglePrivacyDlpV2beta1KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId?: GooglePrivacyDlpV2beta1PartitionId; + /** + * Properties to scan. If none are specified, all properties will be scanned + * by default. + */ + projection?: GooglePrivacyDlpV2beta1Projection[]; + } + interface GooglePrivacyDlpV2beta1DeidentificationSummary { + /** Transformations applied to the dataset. */ + transformationSummaries?: GooglePrivacyDlpV2beta1TransformationSummary[]; + /** Total size in bytes that were transformed in some way. */ + transformedBytes?: string; + } + interface GooglePrivacyDlpV2beta1DeidentifyConfig { + /** + * Treat the dataset as free-form text and apply the same free text + * transformation everywhere. + */ + infoTypeTransformations?: GooglePrivacyDlpV2beta1InfoTypeTransformations; + /** + * Treat the dataset as structured. Transformations can be applied to + * specific locations within structured datasets, such as transforming + * a column within a table. + */ + recordTransformations?: GooglePrivacyDlpV2beta1RecordTransformations; + } + interface GooglePrivacyDlpV2beta1DeidentifyContentRequest { + /** Configuration for the de-identification of the list of content items. */ + deidentifyConfig?: GooglePrivacyDlpV2beta1DeidentifyConfig; + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Up to 100 are allowed per request. + * All items will be treated as text/*. + */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + } + interface GooglePrivacyDlpV2beta1DeidentifyContentResponse { + items?: GooglePrivacyDlpV2beta1ContentItem[]; + /** A review of the transformations that took place for each item. */ + summaries?: GooglePrivacyDlpV2beta1DeidentificationSummary[]; + } + interface GooglePrivacyDlpV2beta1EntityId { + /** Composite key indicating which field contains the entity identifier. */ + field?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1Expressions { + conditions?: GooglePrivacyDlpV2beta1Conditions; + /** + * The operator to apply to the result of conditions. Default and currently + * only supported value is `AND`. + */ + logicalOperator?: string; + } + interface GooglePrivacyDlpV2beta1FieldId { + /** Name describing the field. */ + columnName?: string; + } + interface GooglePrivacyDlpV2beta1FieldTransformation { + /** + * Only apply the transformation if the condition evaluates to true for the + * given `RecordCondition`. The conditions are allowed to reference fields + * that are not used in the actual transformation. [optional] + * + * Example Use Cases: + * + * - Apply a different bucket transformation to an age column if the zip code + * column for the same record is within a specific range. + * - Redact a field if the date of birth field is greater than 85. + */ + condition?: GooglePrivacyDlpV2beta1RecordCondition; + /** Input field(s) to apply the transformation to. [required] */ + fields?: GooglePrivacyDlpV2beta1FieldId[]; + /** + * Treat the contents of the field as free text, and selectively + * transform content that matches an `InfoType`. + */ + infoTypeTransformations?: GooglePrivacyDlpV2beta1InfoTypeTransformations; + /** Apply the transformation to the entire field. */ + primitiveTransformation?: GooglePrivacyDlpV2beta1PrimitiveTransformation; + } + interface GooglePrivacyDlpV2beta1FileSet { + /** + * The url, in the format `gs:///`. Trailing wildcard in the + * path is allowed. + */ + url?: string; + } + interface GooglePrivacyDlpV2beta1Finding { + /** Timestamp when finding was detected. */ + createTime?: string; + /** The specific type of info the string might be. */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** Estimate of how likely it is that the info_type is correct. */ + likelihood?: string; + /** Location of the info found. */ + location?: GooglePrivacyDlpV2beta1Location; + /** The specific string that may be potentially sensitive info. */ + quote?: string; + } + interface GooglePrivacyDlpV2beta1FixedSizeBucketingConfig { + /** + * Size of each bucket (except for minimum and maximum buckets). So if + * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + */ + bucketSize?: number; + /** + * Lower bound value of buckets. All values less than `lower_bound` are + * grouped together into a single bucket; for example if `lower_bound` = 10, + * then all values less than 10 are replaced with the value “-10”. [Required]. + */ + lowerBound?: GooglePrivacyDlpV2beta1Value; + /** + * Upper bound value of buckets. All values greater than upper_bound are + * grouped together into a single bucket; for example if `upper_bound` = 89, + * then all values greater than 89 are replaced with the value “89+”. + * [Required]. + */ + upperBound?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1ImageLocation { + /** Height of the bounding box in pixels. */ + height?: number; + /** Left coordinate of the bounding box. (0,0) is upper left. */ + left?: number; + /** Top coordinate of the bounding box. (0,0) is upper left. */ + top?: number; + /** Width of the bounding box in pixels. */ + width?: number; + } + interface GooglePrivacyDlpV2beta1ImageRedactionConfig { + /** + * Only one per info_type should be provided per request. If not + * specified, and redact_all_text is false, the DLP API will redact all + * text that it matches against all info_types that are found, but not + * specified in another ImageRedactionConfig. + */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** + * If true, all text found in the image, regardless whether it matches an + * info_type, is redacted. + */ + redactAllText?: boolean; + /** + * The color to use when redacting content from an image. If not specified, + * the default is black. + */ + redactionColor?: GooglePrivacyDlpV2beta1Color; + } + interface GooglePrivacyDlpV2beta1InfoType { + /** Name of the information type. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1InfoTypeDescription { + /** List of categories this infoType belongs to. */ + categories?: GooglePrivacyDlpV2beta1CategoryDescription[]; + /** Human readable form of the infoType name. */ + displayName?: string; + /** Internal name of the infoType. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** Max findings limit for the given infoType. */ + maxFindings?: number; + } + interface GooglePrivacyDlpV2beta1InfoTypeStatistics { + /** Number of findings for this info type. */ + count?: string; + /** The type of finding this stat is for. */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + } + interface GooglePrivacyDlpV2beta1InfoTypeTransformation { + /** + * Info types to apply the transformation to. Empty list will match all + * available info types for this transformation. + */ + infoTypes?: GooglePrivacyDlpV2beta1InfoType[]; + /** Primitive transformation to apply to the info type. [required] */ + primitiveTransformation?: GooglePrivacyDlpV2beta1PrimitiveTransformation; + } + interface GooglePrivacyDlpV2beta1InfoTypeTransformations { + /** + * Transformation for each info type. Cannot specify more than one + * for a given info type. [required] + */ + transformations?: GooglePrivacyDlpV2beta1InfoTypeTransformation[]; + } + interface GooglePrivacyDlpV2beta1InspectConfig { + /** When true, excludes type information of the findings. */ + excludeTypes?: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote?: boolean; + /** Configuration of findings limit given for specified info types. */ + infoTypeLimits?: GooglePrivacyDlpV2beta1InfoTypeLimit[]; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + * Empty info_types runs all enabled detectors. + */ + infoTypes?: GooglePrivacyDlpV2beta1InfoType[]; + /** Limits the number of findings per content item or long running operation. */ + maxFindings?: number; + /** Only returns findings equal or above this threshold. */ + minLikelihood?: string; + } + interface GooglePrivacyDlpV2beta1InspectContentRequest { + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Items in a single request are + * considered "related" unless inspect_config.independent_inputs is true. + * Up to 100 are allowed per request. + */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + } + interface GooglePrivacyDlpV2beta1InspectContentResponse { + /** + * Each content_item from the request has a result in this list, in the + * same order as the request. + */ + results?: GooglePrivacyDlpV2beta1InspectResult[]; + } + interface GooglePrivacyDlpV2beta1InspectOperationMetadata { + /** The time which this request was started. */ + createTime?: string; + infoTypeStats?: GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + /** Total size in bytes that were processed. */ + processedBytes?: string; + /** The inspect config used to create the Operation. */ + requestInspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** Optional location to store findings. */ + requestOutputConfig?: GooglePrivacyDlpV2beta1OutputStorageConfig; + /** The storage config used to create the Operation. */ + requestStorageConfig?: GooglePrivacyDlpV2beta1StorageConfig; + /** Estimate of the number of bytes to process. */ + totalEstimatedBytes?: string; + } + interface GooglePrivacyDlpV2beta1InspectOperationResult { + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `inspect/results/{id}`. + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1InspectResult { + /** List of findings for an item. */ + findings?: GooglePrivacyDlpV2beta1Finding[]; + /** + * If true, then this item might have more findings than were returned, + * and the findings returned are an arbitrary subset of all findings. + * The findings list might be truncated because the input items were too + * large, or because the server reached the maximum amount of resources + * allowed for a single API call. For best results, divide the input into + * smaller batches. + */ + findingsTruncated?: boolean; + } + interface GooglePrivacyDlpV2beta1KAnonymityConfig { + /** + * Optional message indicating that each distinct `EntityId` should not + * contribute to the k-anonymity count more than once per equivalence class. + */ + entityId?: GooglePrivacyDlpV2beta1EntityId; + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within + * a repeated field. + */ + quasiIds?: GooglePrivacyDlpV2beta1FieldId[]; + } + interface GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the + * above set of values. + */ + equivalenceClassSize?: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. + * The order is always the same as the original request. + */ + quasiIdsValues?: GooglePrivacyDlpV2beta1Value[]; + } + interface GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + /** Total number of records in this bucket. */ + bucketSize?: string; + /** + * Sample of equivalence classes in this bucket. The total number of + * classes returned per bucket is capped at 20. + */ + bucketValues?: GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + /** Lower bound on the size of the equivalence classes in this bucket. */ + equivalenceClassSizeLowerBound?: string; + /** Upper bound on the size of the equivalence classes in this bucket. */ + equivalenceClassSizeUpperBound?: string; + } + interface GooglePrivacyDlpV2beta1KAnonymityResult { + /** Histogram of k-anonymity equivalence classes. */ + equivalenceClassHistogramBuckets?: GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; + } + interface GooglePrivacyDlpV2beta1Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + */ + partitionId?: GooglePrivacyDlpV2beta1PartitionId; + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * + * A path can never be empty, and a path can have at most 100 elements. + */ + path?: GooglePrivacyDlpV2beta1PathElement[]; + } + interface GooglePrivacyDlpV2beta1KindExpression { + /** The name of the kind. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1KmsWrappedCryptoKey { + /** The resource name of the KMS CryptoKey to use for unwrapping. [required] */ + cryptoKeyName?: string; + /** The wrapped data crypto key. [required] */ + wrappedKey?: string; + } + interface GooglePrivacyDlpV2beta1LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are + * defined for the l-diversity computation. When multiple fields are + * specified, they are considered a single composite key. + */ + quasiIds?: GooglePrivacyDlpV2beta1FieldId[]; + /** Sensitive field for computing the l-value. */ + sensitiveAttribute?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + /** Size of the k-anonymity equivalence class. */ + equivalenceClassSize?: string; + /** Number of distinct sensitive values in this equivalence class. */ + numDistinctSensitiveValues?: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence + * class. The order is always the same as the original request. + */ + quasiIdsValues?: GooglePrivacyDlpV2beta1Value[]; + /** Estimated frequencies of top sensitive values. */ + topSensitiveValues?: GooglePrivacyDlpV2beta1ValueFrequency[]; + } + interface GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + /** Total number of records in this bucket. */ + bucketSize?: string; + /** + * Sample of equivalence classes in this bucket. The total number of + * classes returned per bucket is capped at 20. + */ + bucketValues?: GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence + * classes in this bucket. + */ + sensitiveValueFrequencyLowerBound?: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence + * classes in this bucket. + */ + sensitiveValueFrequencyUpperBound?: string; + } + interface GooglePrivacyDlpV2beta1LDiversityResult { + /** Histogram of l-diversity equivalence class sensitive value frequencies. */ + sensitiveValueFrequencyHistogramBuckets?: GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; + } + interface GooglePrivacyDlpV2beta1ListInfoTypesResponse { + /** Set of sensitive info types belonging to a category. */ + infoTypes?: GooglePrivacyDlpV2beta1InfoTypeDescription[]; + } + interface GooglePrivacyDlpV2beta1ListInspectFindingsResponse { + /** + * If not empty, indicates that there may be more results that match the + * request; this value should be passed in a new `ListInspectFindingsRequest`. + */ + nextPageToken?: string; + /** The results. */ + result?: GooglePrivacyDlpV2beta1InspectResult; + } + interface GooglePrivacyDlpV2beta1ListRootCategoriesResponse { + /** List of all into type categories supported by the API. */ + categories?: GooglePrivacyDlpV2beta1CategoryDescription[]; + } + interface GooglePrivacyDlpV2beta1Location { + /** Zero-based byte offsets within a content item. */ + byteRange?: GooglePrivacyDlpV2beta1Range; + /** + * Character offsets within a content item, included when content type + * is a text. Default charset assumed to be UTF-8. + */ + codepointRange?: GooglePrivacyDlpV2beta1Range; + /** Field id of the field containing the finding. */ + fieldId?: GooglePrivacyDlpV2beta1FieldId; + /** Location within an image's pixels. */ + imageBoxes?: GooglePrivacyDlpV2beta1ImageLocation[]; + /** Key of the finding. */ + recordKey?: GooglePrivacyDlpV2beta1RecordKey; + /** Location within a `ContentItem.Table`. */ + tableLocation?: GooglePrivacyDlpV2beta1TableLocation; + } + interface GooglePrivacyDlpV2beta1NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are + * integer, float, date, datetime, timestamp, time. + */ + field?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1NumericalStatsResult { + /** Maximum value appearing in the column. */ + maxValue?: GooglePrivacyDlpV2beta1Value; + /** Minimum value appearing in the column. */ + minValue?: GooglePrivacyDlpV2beta1Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues?: GooglePrivacyDlpV2beta1Value[]; + } + interface GooglePrivacyDlpV2beta1OperationConfig { + /** Max number of findings per file, Datastore entity, or database row. */ + maxItemFindings?: string; + } + interface GooglePrivacyDlpV2beta1OutputStorageConfig { + /** + * The path to a Google Cloud Storage location to store output. + * The bucket must already exist and + * the Google APIs service account for DLP must have write permission to + * write to the given bucket. + * Results are split over multiple csv files with each file name matching + * the pattern "[operation_id]_[count].csv", for example + * `3094877188788974909_1.csv`. The `operation_id` matches the + * identifier for the Operation, and the `count` is a counter used for + * tracking the number of files written. + * + * The CSV file(s) contain the following columns regardless of storage type + * scanned: + * - id + * - info_type + * - likelihood + * - byte size of finding + * - quote + * - timestamp + * + * For Cloud Storage the next columns are: + * + * - file_path + * - start_offset + * + * For Cloud Datastore the next columns are: + * + * - project_id + * - namespace_id + * - path + * - column_name + * - offset + * + * For BigQuery the next columns are: + * + * - row_number + * - project_id + * - dataset_id + * - table_id + */ + storagePath?: GooglePrivacyDlpV2beta1CloudStoragePath; + /** Store findings in a new table in the dataset. */ + table?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1PartitionId { + /** If not empty, the ID of the namespace to which the entities belong. */ + namespaceId?: string; + /** The ID of the project to which the entities belong. */ + projectId?: string; + } + interface GooglePrivacyDlpV2beta1PathElement { + /** + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + */ + id?: string; + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + kind?: string; + /** + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1PrimitiveTransformation { + bucketingConfig?: GooglePrivacyDlpV2beta1BucketingConfig; + characterMaskConfig?: GooglePrivacyDlpV2beta1CharacterMaskConfig; + cryptoHashConfig?: GooglePrivacyDlpV2beta1CryptoHashConfig; + cryptoReplaceFfxFpeConfig?: GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig; + fixedSizeBucketingConfig?: GooglePrivacyDlpV2beta1FixedSizeBucketingConfig; + redactConfig?: any; + replaceConfig?: GooglePrivacyDlpV2beta1ReplaceValueConfig; + replaceWithInfoTypeConfig?: any; + timePartConfig?: GooglePrivacyDlpV2beta1TimePartConfig; + } + interface GooglePrivacyDlpV2beta1PrivacyMetric { + categoricalStatsConfig?: GooglePrivacyDlpV2beta1CategoricalStatsConfig; + kAnonymityConfig?: GooglePrivacyDlpV2beta1KAnonymityConfig; + lDiversityConfig?: GooglePrivacyDlpV2beta1LDiversityConfig; + numericalStatsConfig?: GooglePrivacyDlpV2beta1NumericalStatsConfig; + } + interface GooglePrivacyDlpV2beta1Projection { + /** The property to project. */ + property?: GooglePrivacyDlpV2beta1PropertyReference; + } + interface GooglePrivacyDlpV2beta1PropertyReference { + /** + * The name of the property. + * If name includes "."s, it may be interpreted as a property name path. + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1Range { + /** Index of the last character of the range (exclusive). */ + end?: string; + /** Index of the first character of the range (inclusive). */ + start?: string; + } + interface GooglePrivacyDlpV2beta1RecordCondition { + expressions?: GooglePrivacyDlpV2beta1Expressions; + } + interface GooglePrivacyDlpV2beta1RecordKey { + cloudStorageKey?: GooglePrivacyDlpV2beta1CloudStorageKey; + datastoreKey?: GooglePrivacyDlpV2beta1DatastoreKey; + } + interface GooglePrivacyDlpV2beta1RecordSuppression { + condition?: GooglePrivacyDlpV2beta1RecordCondition; + } + interface GooglePrivacyDlpV2beta1RecordTransformations { + /** Transform the record by applying various field transformations. */ + fieldTransformations?: GooglePrivacyDlpV2beta1FieldTransformation[]; + /** + * Configuration defining which records get suppressed entirely. Records that + * match any suppression rule are omitted from the output [optional]. + */ + recordSuppressions?: GooglePrivacyDlpV2beta1RecordSuppression[]; + } + interface GooglePrivacyDlpV2beta1RedactContentRequest { + /** The configuration for specifying what content to redact from images. */ + imageRedactionConfigs?: GooglePrivacyDlpV2beta1ImageRedactionConfig[]; + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** The list of items to inspect. Up to 100 are allowed per request. */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + /** + * The strings to replace findings text findings with. Must specify at least + * one of these or one ImageRedactionConfig if redacting images. + */ + replaceConfigs?: GooglePrivacyDlpV2beta1ReplaceConfig[]; + } + interface GooglePrivacyDlpV2beta1RedactContentResponse { + /** The redacted content. */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + } + interface GooglePrivacyDlpV2beta1ReplaceConfig { + /** + * Type of information to replace. Only one ReplaceConfig per info_type + * should be provided. If ReplaceConfig does not have an info_type, the DLP + * API matches it against all info_types that are found but not specified in + * another ReplaceConfig. + */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** Content replacing sensitive information of given type. Max 256 chars. */ + replaceWith?: string; + } + interface GooglePrivacyDlpV2beta1ReplaceValueConfig { + /** Value to replace it with. */ + newValue?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + /** The time which this request was started. */ + createTime?: string; + /** Privacy metric to compute. */ + requestedPrivacyMetric?: GooglePrivacyDlpV2beta1PrivacyMetric; + /** Input dataset to compute metrics over. */ + requestedSourceTable?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { + categoricalStatsResult?: GooglePrivacyDlpV2beta1CategoricalStatsResult; + kAnonymityResult?: GooglePrivacyDlpV2beta1KAnonymityResult; + lDiversityResult?: GooglePrivacyDlpV2beta1LDiversityResult; + numericalStatsResult?: GooglePrivacyDlpV2beta1NumericalStatsResult; + } + interface GooglePrivacyDlpV2beta1Row { + values?: GooglePrivacyDlpV2beta1Value[]; + } + interface GooglePrivacyDlpV2beta1StorageConfig { + /** BigQuery options specification. */ + bigQueryOptions?: GooglePrivacyDlpV2beta1BigQueryOptions; + /** Google Cloud Storage options specification. */ + cloudStorageOptions?: GooglePrivacyDlpV2beta1CloudStorageOptions; + /** Google Cloud Datastore options specification. */ + datastoreOptions?: GooglePrivacyDlpV2beta1DatastoreOptions; + } + interface GooglePrivacyDlpV2beta1SummaryResult { + code?: string; + count?: string; + /** + * A place for warnings or errors to show up if a transformation didn't + * work as expected. + */ + details?: string; + } + interface GooglePrivacyDlpV2beta1Table { + headers?: GooglePrivacyDlpV2beta1FieldId[]; + rows?: GooglePrivacyDlpV2beta1Row[]; + } + interface GooglePrivacyDlpV2beta1TableLocation { + /** The zero-based index of the row where the finding is located. */ + rowIndex?: string; + } + interface GooglePrivacyDlpV2beta1TimePartConfig { + partToExtract?: string; + } + interface GooglePrivacyDlpV2beta1TransformationSummary { + /** Set if the transformation was limited to a specific FieldId. */ + field?: GooglePrivacyDlpV2beta1FieldId; + /** + * The field transformation that was applied. This list will contain + * multiple only in the case of errors. + */ + fieldTransformations?: GooglePrivacyDlpV2beta1FieldTransformation[]; + /** Set if the transformation was limited to a specific info_type. */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** The specific suppression option these stats apply to. */ + recordSuppress?: GooglePrivacyDlpV2beta1RecordSuppression; + results?: GooglePrivacyDlpV2beta1SummaryResult[]; + /** The specific transformation these stats apply to. */ + transformation?: GooglePrivacyDlpV2beta1PrimitiveTransformation; + } + interface GooglePrivacyDlpV2beta1TransientCryptoKey { + /** + * Name of the key. [required] + * This is an arbitrary string used to differentiate different keys. + * A unique key is generated per name: two separate `TransientCryptoKey` + * protos share the same generated key if their names are the same. + * When the data crypto key is generated, this name is not used in any way + * (repeating the api call will result in a different key being generated). + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1UnwrappedCryptoKey { + /** The AES 128/192/256 bit key. [required] */ + key?: string; + } + interface GooglePrivacyDlpV2beta1Value { + booleanValue?: boolean; + dateValue?: GoogleTypeDate; + floatValue?: number; + integerValue?: string; + stringValue?: string; + timeValue?: GoogleTypeTimeOfDay; + timestampValue?: string; + } + interface GooglePrivacyDlpV2beta1ValueFrequency { + /** How many times the value is contained in the field. */ + count?: string; + /** A value contained in the field in question. */ + value?: GooglePrivacyDlpV2beta1Value; + } + interface GoogleRpcStatus { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface GoogleTypeDate { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day?: number; + /** Month of year. Must be from 1 to 12. */ + month?: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without + * a year. + */ + year?: number; + } + interface GoogleTypeTimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + */ + hours?: number; + /** Minutes of hour of day. Must be from 0 to 59. */ + minutes?: number; + /** Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. */ + nanos?: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds?: number; + } + interface ContentResource { + /** + * De-identifies potentially sensitive info from a list of strings. + * This method has limits on input size and output size. + */ + deidentify(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Finds potentially sensitive info in a list of strings. + * This method has limits on input size, processing time, and output size. + */ + inspect(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Redacts potentially sensitive info from a list of strings. + * This method has limits on input size, processing time, and output size. + */ + redact(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DataSourceResource { + /** + * Schedules a job to compute risk analysis metrics over content in a Google + * Cloud Platform repository. + */ + analyze(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Schedules a job scanning content in a Google Cloud Platform data + * repository. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** This method is not supported and the server returns `UNIMPLEMENTED`. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Fetches the list of long running operations. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters by `done`. That is, `done=true` or `done=false`. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The list page size. The maximum allowed value is 256 and the default is 100. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FindingsResource { + /** Returns list of results for given inspect operation result set id. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Restricts findings to items that match. Supports info_type and likelihood. + * + * Examples: + * + * - info_type=EMAIL_ADDRESS + * - info_type=PHONE_NUMBER,EMAIL_ADDRESS + * - likelihood=VERY_LIKELY + * - likelihood=VERY_LIKELY,LIKELY + * - info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Identifier of the results set returned as metadata of + * the longrunning operation created by a call to InspectDataSource. + * Should be in the format of `inspect/results/{id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of results to return. + * If 0, the implementation selects a reasonable value. + */ + pageSize?: number; + /** + * The value returned by the last `ListInspectFindingsResponse`; indicates + * that this is a continuation of a prior `ListInspectFindings` call, and that + * the system should return the next page of data. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ResultsResource { + findings: FindingsResource; + } + interface InspectResource { + operations: OperationsResource; + results: ResultsResource; + } + interface OperationsResource { + /** Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** This method is not supported and the server returns `UNIMPLEMENTED`. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Fetches the list of long running operations. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters by `done`. That is, `done=true` or `done=false`. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The list page size. The maximum allowed value is 256 and the default is 100. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RiskAnalysisResource { + operations: OperationsResource; + } + interface InfoTypesResource { + /** Returns sensitive information types for given category. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Category name as returned by ListRootCategories. */ + category: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Optional BCP-47 language code for localized info type friendly + * names. If omitted, or if localized strings are not available, + * en-US strings will be returned. + */ + languageCode?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RootCategoriesResource { + /** Returns the list of root categories of sensitive information. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Optional language code for localized friendly category names. + * If omitted or if localized strings are not available, + * en-US strings will be returned. + */ + languageCode?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + infoTypes: InfoTypesResource; + } + } +} diff --git a/types/gapi.client.dlp/readme.md b/types/gapi.client.dlp/readme.md new file mode 100644 index 0000000000..8a9a52d069 --- /dev/null +++ b/types/gapi.client.dlp/readme.md @@ -0,0 +1,83 @@ +# TypeScript typings for DLP API v2beta1 +The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories. +For detailed description please check [documentation](https://cloud.google.com/dlp/docs/). + +## Installing + +Install typings for DLP API: +``` +npm install @types/gapi.client.dlp@v2beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dlp', 'v2beta1', () => { + // now we can use gapi.client.dlp + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DLP API resources: + +```typescript + +/* +De-identifies potentially sensitive info from a list of strings. +This method has limits on input size and output size. +*/ +await gapi.client.content.deidentify({ }); + +/* +Finds potentially sensitive info in a list of strings. +This method has limits on input size, processing time, and output size. +*/ +await gapi.client.content.inspect({ }); + +/* +Redacts potentially sensitive info from a list of strings. +This method has limits on input size, processing time, and output size. +*/ +await gapi.client.content.redact({ }); + +/* +Schedules a job to compute risk analysis metrics over content in a Google +Cloud Platform repository. +*/ +await gapi.client.dataSource.analyze({ }); + +/* +Returns the list of root categories of sensitive information. +*/ +await gapi.client.rootCategories.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.dlp/tsconfig.json b/types/gapi.client.dlp/tsconfig.json new file mode 100644 index 0000000000..b7ab822674 --- /dev/null +++ b/types/gapi.client.dlp/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dlp-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dlp/tslint.json b/types/gapi.client.dlp/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dlp/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dns/gapi.client.dns-tests.ts b/types/gapi.client.dns/gapi.client.dns-tests.ts new file mode 100644 index 0000000000..16164e4e41 --- /dev/null +++ b/types/gapi.client.dns/gapi.client.dns-tests.ts @@ -0,0 +1,92 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dns', 'v1', () => { + /** now we can use gapi.client.dns */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** View your DNS records hosted by Google Cloud DNS */ + 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + /** View and manage your DNS records hosted by Google Cloud DNS */ + 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Atomically update the ResourceRecordSet collection. */ + await gapi.client.changes.create({ + managedZone: "managedZone", + project: "project", + }); + /** Fetch the representation of an existing Change. */ + await gapi.client.changes.get({ + changeId: "changeId", + managedZone: "managedZone", + project: "project", + }); + /** Enumerate Changes to a ResourceRecordSet collection. */ + await gapi.client.changes.list({ + managedZone: "managedZone", + maxResults: 2, + pageToken: "pageToken", + project: "project", + sortBy: "sortBy", + sortOrder: "sortOrder", + }); + /** Create a new ManagedZone. */ + await gapi.client.managedZones.create({ + project: "project", + }); + /** Delete a previously created ManagedZone. */ + await gapi.client.managedZones.delete({ + managedZone: "managedZone", + project: "project", + }); + /** Fetch the representation of an existing ManagedZone. */ + await gapi.client.managedZones.get({ + managedZone: "managedZone", + project: "project", + }); + /** Enumerate ManagedZones that have been created but not yet deleted. */ + await gapi.client.managedZones.list({ + dnsName: "dnsName", + maxResults: 2, + pageToken: "pageToken", + project: "project", + }); + /** Fetch the representation of an existing Project. */ + await gapi.client.projects.get({ + project: "project", + }); + /** Enumerate ResourceRecordSets that have been created but not yet deleted. */ + await gapi.client.resourceRecordSets.list({ + managedZone: "managedZone", + maxResults: 2, + name: "name", + pageToken: "pageToken", + project: "project", + type: "type", + }); + } +}); diff --git a/types/gapi.client.dns/index.d.ts b/types/gapi.client.dns/index.d.ts new file mode 100644 index 0000000000..c97f2c0240 --- /dev/null +++ b/types/gapi.client.dns/index.d.ts @@ -0,0 +1,392 @@ +// Type definitions for Google Google Cloud DNS API v1 1.0 +// Project: https://developers.google.com/cloud-dns +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/dns/v1/rest + +/// + +declare namespace gapi.client { + /** Load Google Cloud DNS API v1 */ + function load(name: "dns", version: "v1"): PromiseLike; + function load(name: "dns", version: "v1", callback: () => any): void; + + const changes: dns.ChangesResource; + + const managedZones: dns.ManagedZonesResource; + + const projects: dns.ProjectsResource; + + const resourceRecordSets: dns.ResourceRecordSetsResource; + + namespace dns { + interface Change { + /** Which ResourceRecordSets to add? */ + additions?: ResourceRecordSet[]; + /** Which ResourceRecordSets to remove? Must match existing data exactly. */ + deletions?: ResourceRecordSet[]; + /** Unique identifier for the resource; defined by the server (output only). */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dns#change". */ + kind?: string; + /** The time that this operation was started by the server (output only). This is in RFC3339 text format. */ + startTime?: string; + /** Status of the operation (output only). */ + status?: string; + } + interface ChangesListResponse { + /** The requested changes. */ + changes?: Change[]; + /** Type of resource. */ + kind?: string; + /** + * The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another + * list request using this value as your pagination token. + * + * In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to + * retrieve a "snapshot" of collections larger than the maximum page size. + */ + nextPageToken?: string; + } + interface ManagedZone { + /** The time that this resource was created on the server. This is in RFC3339 text format. Output only. */ + creationTime?: string; + /** A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function. */ + description?: string; + /** The DNS name of this managed zone, for instance "example.com.". */ + dnsName?: string; + /** Unique identifier for the resource; defined by the server (output only) */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dns#managedZone". */ + kind?: string; + /** + * User assigned name for this resource. Must be unique within the project. The name must be 1-63 characters long, must begin with a letter, end with a + * letter or digit, and only contain lowercase letters, digits or dashes. + */ + name?: string; + /** + * Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most + * users will leave this field unset. + */ + nameServerSet?: string; + /** Delegate your managed_zone to these virtual name servers; defined by the server (output only) */ + nameServers?: string[]; + } + interface ManagedZonesListResponse { + /** Type of resource. */ + kind?: string; + /** The managed zone resources. */ + managedZones?: ManagedZone[]; + /** + * The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another + * list request using this value as your page token. + * + * In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to + * retrieve a consistent snapshot of a collection larger than the maximum page size. + */ + nextPageToken?: string; + } + interface Project { + /** User assigned unique identifier for the resource (output only). */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dns#project". */ + kind?: string; + /** Unique numeric identifier for the resource; defined by the server (output only). */ + number?: string; + /** Quotas assigned to this project (output only). */ + quota?: Quota; + } + interface Quota { + /** Identifies what kind of resource this is. Value: the fixed string "dns#quota". */ + kind?: string; + /** Maximum allowed number of managed zones in the project. */ + managedZones?: number; + /** Maximum allowed number of ResourceRecords per ResourceRecordSet. */ + resourceRecordsPerRrset?: number; + /** Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest. */ + rrsetAdditionsPerChange?: number; + /** Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest. */ + rrsetDeletionsPerChange?: number; + /** Maximum allowed number of ResourceRecordSets per zone in the project. */ + rrsetsPerManagedZone?: number; + /** Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes. */ + totalRrdataSizePerChange?: number; + } + interface ResourceRecordSet { + /** Identifies what kind of resource this is. Value: the fixed string "dns#resourceRecordSet". */ + kind?: string; + /** For example, www.example.com. */ + name?: string; + /** As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). */ + rrdatas?: string[]; + /** Number of seconds that this ResourceRecordSet can be cached by resolvers. */ + ttl?: number; + /** The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on. */ + type?: string; + } + interface ResourceRecordSetsListResponse { + /** Type of resource. */ + kind?: string; + /** + * The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another + * list request using this value as your pagination token. + * + * In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to + * retrieve a consistent snapshot of a collection larger than the maximum page size. + */ + nextPageToken?: string; + /** The resource record set resources. */ + rrsets?: ResourceRecordSet[]; + } + interface ChangesResource { + /** Atomically update the ResourceRecordSet collection. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetch the representation of an existing Change. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. */ + changeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enumerate Changes to a ResourceRecordSet collection. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Sorting criterion. The only supported value is change sequence. */ + sortBy?: string; + /** Sorting order direction: 'ascending' or 'descending'. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManagedZonesResource { + /** Create a new ManagedZone. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete a previously created ManagedZone. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetch the representation of an existing ManagedZone. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enumerate ManagedZones that have been created but not yet deleted. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Restricts the list to return only zones with this domain name. */ + dnsName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Fetch the representation of an existing Project. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ResourceRecordSetsResource { + /** Enumerate ResourceRecordSets that have been created but not yet deleted. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. */ + maxResults?: number; + /** Restricts the list to return only records with this fully qualified domain name. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Restricts the list to return only records of this type. If present, the "name" parameter must also be present. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.dns/readme.md b/types/gapi.client.dns/readme.md new file mode 100644 index 0000000000..2f7171937e --- /dev/null +++ b/types/gapi.client.dns/readme.md @@ -0,0 +1,108 @@ +# TypeScript typings for Google Cloud DNS API v1 +Configures and serves authoritative DNS records. +For detailed description please check [documentation](https://developers.google.com/cloud-dns). + +## Installing + +Install typings for Google Cloud DNS API: +``` +npm install @types/gapi.client.dns@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dns', 'v1', () => { + // now we can use gapi.client.dns + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // View your DNS records hosted by Google Cloud DNS + 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + + // View and manage your DNS records hosted by Google Cloud DNS + 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud DNS API resources: + +```typescript + +/* +Atomically update the ResourceRecordSet collection. +*/ +await gapi.client.changes.create({ managedZone: "managedZone", project: "project", }); + +/* +Fetch the representation of an existing Change. +*/ +await gapi.client.changes.get({ changeId: "changeId", managedZone: "managedZone", project: "project", }); + +/* +Enumerate Changes to a ResourceRecordSet collection. +*/ +await gapi.client.changes.list({ managedZone: "managedZone", project: "project", }); + +/* +Create a new ManagedZone. +*/ +await gapi.client.managedZones.create({ project: "project", }); + +/* +Delete a previously created ManagedZone. +*/ +await gapi.client.managedZones.delete({ managedZone: "managedZone", project: "project", }); + +/* +Fetch the representation of an existing ManagedZone. +*/ +await gapi.client.managedZones.get({ managedZone: "managedZone", project: "project", }); + +/* +Enumerate ManagedZones that have been created but not yet deleted. +*/ +await gapi.client.managedZones.list({ project: "project", }); + +/* +Fetch the representation of an existing Project. +*/ +await gapi.client.projects.get({ project: "project", }); + +/* +Enumerate ResourceRecordSets that have been created but not yet deleted. +*/ +await gapi.client.resourceRecordSets.list({ managedZone: "managedZone", project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.dns/tsconfig.json b/types/gapi.client.dns/tsconfig.json new file mode 100644 index 0000000000..93f3858c6c --- /dev/null +++ b/types/gapi.client.dns/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dns-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dns/tslint.json b/types/gapi.client.dns/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dns/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.doubleclickbidmanager/gapi.client.doubleclickbidmanager-tests.ts b/types/gapi.client.doubleclickbidmanager/gapi.client.doubleclickbidmanager-tests.ts new file mode 100644 index 0000000000..85dbaea986 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/gapi.client.doubleclickbidmanager-tests.ts @@ -0,0 +1,63 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('doubleclickbidmanager', 'v1', () => { + /** now we can use gapi.client.doubleclickbidmanager */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your reports in DoubleClick Bid Manager */ + 'https://www.googleapis.com/auth/doubleclickbidmanager', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves line items in CSV format. */ + await gapi.client.lineitems.downloadlineitems({ + }); + /** Uploads line items in CSV format. */ + await gapi.client.lineitems.uploadlineitems({ + }); + /** Creates a query. */ + await gapi.client.queries.createquery({ + }); + /** Deletes a stored query as well as the associated stored reports. */ + await gapi.client.queries.deletequery({ + queryId: "queryId", + }); + /** Retrieves a stored query. */ + await gapi.client.queries.getquery({ + queryId: "queryId", + }); + /** Retrieves stored queries. */ + await gapi.client.queries.listqueries({ + }); + /** Runs a stored query to generate a report. */ + await gapi.client.queries.runquery({ + queryId: "queryId", + }); + /** Retrieves stored reports. */ + await gapi.client.reports.listreports({ + queryId: "queryId", + }); + /** Retrieves entities in SDF format. */ + await gapi.client.sdf.download({ + }); + } +}); diff --git a/types/gapi.client.doubleclickbidmanager/index.d.ts b/types/gapi.client.doubleclickbidmanager/index.d.ts new file mode 100644 index 0000000000..13274ff247 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/index.d.ts @@ -0,0 +1,435 @@ +// Type definitions for Google DoubleClick Bid Manager API v1 1.0 +// Project: https://developers.google.com/bid-manager/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/doubleclickbidmanager/v1/rest + +/// + +declare namespace gapi.client { + /** Load DoubleClick Bid Manager API v1 */ + function load(name: "doubleclickbidmanager", version: "v1"): PromiseLike; + function load(name: "doubleclickbidmanager", version: "v1", callback: () => any): void; + + const lineitems: doubleclickbidmanager.LineitemsResource; + + const queries: doubleclickbidmanager.QueriesResource; + + const reports: doubleclickbidmanager.ReportsResource; + + const sdf: doubleclickbidmanager.SdfResource; + + namespace doubleclickbidmanager { + interface DownloadLineItemsRequest { + /** File specification (column names, types, order) in which the line items will be returned. Default to EWF. */ + fileSpec?: string; + /** Ids of the specified filter type used to filter line items to fetch. If omitted, all the line items will be returned. */ + filterIds?: string[]; + /** Filter type used to filter line items to fetch. */ + filterType?: string; + /** Format in which the line items will be returned. Default to CSV. */ + format?: string; + } + interface DownloadLineItemsResponse { + /** Retrieved line items in CSV format. For more information about file formats, see Entity Write File Format. */ + lineItems?: string; + } + interface DownloadRequest { + /** File types that will be returned. */ + fileTypes?: string[]; + /** + * The IDs of the specified filter type. This is used to filter entities to fetch. At least one ID must be specified. Only one ID is allowed for the + * ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter types, all IDs must be from the same Advertiser. + */ + filterIds?: string[]; + /** Filter type used to filter line items to fetch. */ + filterType?: string; + /** SDF Version (column names, types, order) in which the entities will be returned. Default to 3. */ + version?: string; + } + interface DownloadResponse { + /** Retrieved ad groups in SDF format. */ + adGroups?: string; + /** Retrieved ads in SDF format. */ + ads?: string; + /** Retrieved insertion orders in SDF format. */ + insertionOrders?: string; + /** Retrieved line items in SDF format. */ + lineItems?: string; + } + interface FilterPair { + /** Filter type. */ + type?: string; + /** Filter value. */ + value?: string; + } + interface ListQueriesResponse { + /** Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#listQueriesResponse". */ + kind?: string; + /** Retrieved queries. */ + queries?: Query[]; + } + interface ListReportsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#listReportsResponse". */ + kind?: string; + /** Retrieved reports. */ + reports?: Report[]; + } + interface Parameters { + /** Filters used to match traffic data in your report. */ + filters?: FilterPair[]; + /** Data is grouped by the filters listed in this field. */ + groupBys?: string[]; + /** Whether to include data from Invite Media. */ + includeInviteData?: boolean; + /** Metrics to include as columns in your report. */ + metrics?: string[]; + /** Report type. */ + type?: string; + } + interface Query { + /** Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#query". */ + kind?: string; + /** Query metadata. */ + metadata?: QueryMetadata; + /** Query parameters. */ + params?: Parameters; + /** Query ID. */ + queryId?: string; + /** + * The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored + * otherwise. + */ + reportDataEndTimeMs?: string; + /** + * The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored + * otherwise. + */ + reportDataStartTimeMs?: string; + /** Information on how often and when to run a query. */ + schedule?: QuerySchedule; + /** Canonical timezone code for report data time. Defaults to America/New_York. */ + timezoneCode?: string; + } + interface QueryMetadata { + /** Range of report data. */ + dataRange?: string; + /** Format of the generated report. */ + format?: string; + /** The path to the location in Google Cloud Storage where the latest report is stored. */ + googleCloudStoragePathForLatestReport?: string; + /** The path in Google Drive for the latest report. */ + googleDrivePathForLatestReport?: string; + /** The time when the latest report started to run. */ + latestReportRunTimeMs?: string; + /** + * Locale of the generated reports. Valid values are cs CZECH de GERMAN en ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko KOREAN pl POLISH pt-BR + * BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk UKRAINIAN zh-CN CHINA_CHINESE zh-TW TAIWAN_CHINESE + * + * An locale string not in the list above will generate reports in English. + */ + locale?: string; + /** Number of reports that have been generated for the query. */ + reportCount?: number; + /** Whether the latest report is currently running. */ + running?: boolean; + /** Whether to send an email notification when a report is ready. Default to false. */ + sendNotification?: boolean; + /** List of email addresses which are sent email notifications when the report is finished. Separate from sendNotification. */ + shareEmailAddress?: string[]; + /** Query title. It is used to name the reports generated from this query. */ + title?: string; + } + interface QuerySchedule { + /** Datetime to periodically run the query until. */ + endTimeMs?: string; + /** How often the query is run. */ + frequency?: string; + /** Time of day at which a new report will be generated, represented as minutes past midnight. Range is 0 to 1439. Only applies to scheduled reports. */ + nextRunMinuteOfDay?: number; + /** Canonical timezone code for report generation time. Defaults to America/New_York. */ + nextRunTimezoneCode?: string; + } + interface Report { + /** Key used to identify a report. */ + key?: ReportKey; + /** Report metadata. */ + metadata?: ReportMetadata; + /** Report parameters. */ + params?: Parameters; + } + interface ReportFailure { + /** Error code that shows why the report was not created. */ + errorCode?: string; + } + interface ReportKey { + /** Query ID. */ + queryId?: string; + /** Report ID. */ + reportId?: string; + } + interface ReportMetadata { + /** The path to the location in Google Cloud Storage where the report is stored. */ + googleCloudStoragePath?: string; + /** The ending time for the data that is shown in the report. */ + reportDataEndTimeMs?: string; + /** The starting time for the data that is shown in the report. */ + reportDataStartTimeMs?: string; + /** Report status. */ + status?: ReportStatus; + } + interface ReportStatus { + /** If the report failed, this records the cause. */ + failure?: ReportFailure; + /** The time when this report either completed successfully or failed. */ + finishTimeMs?: string; + /** The file type of the report. */ + format?: string; + /** The state of the report. */ + state?: string; + } + interface RowStatus { + /** Whether the stored entity is changed as a result of upload. */ + changed?: boolean; + /** Entity Id. */ + entityId?: string; + /** Entity name. */ + entityName?: string; + /** Reasons why the entity can't be uploaded. */ + errors?: string[]; + /** Whether the entity is persisted. */ + persisted?: boolean; + /** Row number. */ + rowNumber?: number; + } + interface RunQueryRequest { + /** Report data range used to generate the report. */ + dataRange?: string; + /** The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if dataRange is CUSTOM_DATES and ignored otherwise. */ + reportDataEndTimeMs?: string; + /** The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if dataRange is CUSTOM_DATES and ignored otherwise. */ + reportDataStartTimeMs?: string; + /** Canonical timezone code for report data time. Defaults to America/New_York. */ + timezoneCode?: string; + } + interface UploadLineItemsRequest { + /** Set to true to get upload status without actually persisting the line items. */ + dryRun?: boolean; + /** Format the line items are in. Default to CSV. */ + format?: string; + /** Line items in CSV to upload. Refer to Entity Write File Format for more information on file format. */ + lineItems?: string; + } + interface UploadLineItemsResponse { + /** Status of upload. */ + uploadStatus?: UploadStatus; + } + interface UploadStatus { + /** Reasons why upload can't be completed. */ + errors?: string[]; + /** Per-row upload status. */ + rowStatus?: RowStatus[]; + } + interface LineitemsResource { + /** Retrieves line items in CSV format. */ + downloadlineitems(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Uploads line items in CSV format. */ + uploadlineitems(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface QueriesResource { + /** Creates a query. */ + createquery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a stored query as well as the associated stored reports. */ + deletequery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID to delete. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a stored query. */ + getquery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID to retrieve. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves stored queries. */ + listqueries(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs a stored query to generate a report. */ + runquery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID to run. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** Retrieves stored reports. */ + listreports(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID with which the reports are associated. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SdfResource { + /** Retrieves entities in SDF format. */ + download(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.doubleclickbidmanager/readme.md b/types/gapi.client.doubleclickbidmanager/readme.md new file mode 100644 index 0000000000..cdb82d9f8f --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/readme.md @@ -0,0 +1,99 @@ +# TypeScript typings for DoubleClick Bid Manager API v1 +API for viewing and managing your reports in DoubleClick Bid Manager. +For detailed description please check [documentation](https://developers.google.com/bid-manager/). + +## Installing + +Install typings for DoubleClick Bid Manager API: +``` +npm install @types/gapi.client.doubleclickbidmanager@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('doubleclickbidmanager', 'v1', () => { + // now we can use gapi.client.doubleclickbidmanager + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your reports in DoubleClick Bid Manager + 'https://www.googleapis.com/auth/doubleclickbidmanager', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DoubleClick Bid Manager API resources: + +```typescript + +/* +Retrieves line items in CSV format. +*/ +await gapi.client.lineitems.downloadlineitems({ }); + +/* +Uploads line items in CSV format. +*/ +await gapi.client.lineitems.uploadlineitems({ }); + +/* +Creates a query. +*/ +await gapi.client.queries.createquery({ }); + +/* +Deletes a stored query as well as the associated stored reports. +*/ +await gapi.client.queries.deletequery({ queryId: "queryId", }); + +/* +Retrieves a stored query. +*/ +await gapi.client.queries.getquery({ queryId: "queryId", }); + +/* +Retrieves stored queries. +*/ +await gapi.client.queries.listqueries({ }); + +/* +Runs a stored query to generate a report. +*/ +await gapi.client.queries.runquery({ queryId: "queryId", }); + +/* +Retrieves stored reports. +*/ +await gapi.client.reports.listreports({ queryId: "queryId", }); + +/* +Retrieves entities in SDF format. +*/ +await gapi.client.sdf.download({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.doubleclickbidmanager/tsconfig.json b/types/gapi.client.doubleclickbidmanager/tsconfig.json new file mode 100644 index 0000000000..1e00b8c904 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.doubleclickbidmanager-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.doubleclickbidmanager/tslint.json b/types/gapi.client.doubleclickbidmanager/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.doubleclicksearch/gapi.client.doubleclicksearch-tests.ts b/types/gapi.client.doubleclicksearch/gapi.client.doubleclicksearch-tests.ts new file mode 100644 index 0000000000..14dc6b1fb6 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/gapi.client.doubleclicksearch-tests.ts @@ -0,0 +1,85 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('doubleclicksearch', 'v2', () => { + /** now we can use gapi.client.doubleclicksearch */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your advertising data in DoubleClick Search */ + 'https://www.googleapis.com/auth/doubleclicksearch', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves a list of conversions from a DoubleClick Search engine account. */ + await gapi.client.conversion.get({ + adGroupId: "adGroupId", + adId: "adId", + advertiserId: "advertiserId", + agencyId: "agencyId", + campaignId: "campaignId", + criterionId: "criterionId", + endDate: 7, + engineAccountId: "engineAccountId", + rowCount: 9, + startDate: 10, + startRow: 11, + }); + /** Inserts a batch of new conversions into DoubleClick Search. */ + await gapi.client.conversion.insert({ + }); + /** Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. */ + await gapi.client.conversion.patch({ + advertiserId: "advertiserId", + agencyId: "agencyId", + endDate: 3, + engineAccountId: "engineAccountId", + rowCount: 5, + startDate: 6, + startRow: 7, + }); + /** Updates a batch of conversions in DoubleClick Search. */ + await gapi.client.conversion.update({ + }); + /** Updates the availabilities of a batch of floodlight activities in DoubleClick Search. */ + await gapi.client.conversion.updateAvailability({ + }); + /** Generates and returns a report immediately. */ + await gapi.client.reports.generate({ + }); + /** Polls for the status of a report request. */ + await gapi.client.reports.get({ + reportId: "reportId", + }); + /** Downloads a report file encoded in UTF-8. */ + await gapi.client.reports.getFile({ + reportFragment: 1, + reportId: "reportId", + }); + /** Inserts a report request into the reporting system. */ + await gapi.client.reports.request({ + }); + /** Retrieve the list of saved columns for a specified advertiser. */ + await gapi.client.savedColumns.list({ + advertiserId: "advertiserId", + agencyId: "agencyId", + }); + } +}); diff --git a/types/gapi.client.doubleclicksearch/index.d.ts b/types/gapi.client.doubleclicksearch/index.d.ts new file mode 100644 index 0000000000..f1e0a69436 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/index.d.ts @@ -0,0 +1,578 @@ +// Type definitions for Google DoubleClick Search API v2 2.0 +// Project: https://developers.google.com/doubleclick-search/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/doubleclicksearch/v2/rest + +/// + +declare namespace gapi.client { + /** Load DoubleClick Search API v2 */ + function load(name: "doubleclicksearch", version: "v2"): PromiseLike; + function load(name: "doubleclicksearch", version: "v2", callback: () => any): void; + + const conversion: doubleclicksearch.ConversionResource; + + const reports: doubleclicksearch.ReportsResource; + + const savedColumns: doubleclicksearch.SavedColumnsResource; + + namespace doubleclicksearch { + interface Availability { + /** DS advertiser ID. */ + advertiserId?: string; + /** DS agency ID. */ + agencyId?: string; + /** The time by which all conversions have been uploaded, in epoch millis UTC. */ + availabilityTimestamp?: string; + /** The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). */ + segmentationId?: string; + /** The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). */ + segmentationName?: string; + /** The segmentation type that this availability is for (its default value is FLOODLIGHT). */ + segmentationType?: string; + } + interface Conversion { + /** DS ad group ID. */ + adGroupId?: string; + /** DS ad ID. */ + adId?: string; + /** DS advertiser ID. */ + advertiserId?: string; + /** DS agency ID. */ + agencyId?: string; + /** Available to advertisers only after contacting DoubleClick Search customer support. */ + attributionModel?: string; + /** DS campaign ID. */ + campaignId?: string; + /** + * Sales channel for the product. Acceptable values are: + * - "local": a physical store + * - "online": an online store + */ + channel?: string; + /** DS click ID for the conversion. */ + clickId?: string; + /** + * For offline conversions, advertisers provide this ID. Advertisers can specify any ID that is meaningful to them. Each conversion in a request must + * specify a unique ID, and the combination of ID and timestamp must be unique amongst all conversions within the advertiser. + * For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions. + */ + conversionId?: string; + /** The time at which the conversion was last modified, in epoch millis UTC. */ + conversionModifiedTimestamp?: string; + /** The time at which the conversion took place, in epoch millis UTC. */ + conversionTimestamp?: string; + /** Available to advertisers only after contacting DoubleClick Search customer support. */ + countMillis?: string; + /** DS criterion (keyword) ID. */ + criterionId?: string; + /** The currency code for the conversion's revenue. Should be in ISO 4217 alphabetic (3-char) format. */ + currencyCode?: string; + /** Custom dimensions for the conversion, which can be used to filter data in a report. */ + customDimension?: CustomDimension[]; + /** Custom metrics for the conversion. */ + customMetric?: CustomMetric[]; + /** The type of device on which the conversion occurred. */ + deviceType?: string; + /** ID that DoubleClick Search generates for each conversion. */ + dsConversionId?: string; + /** DS engine account ID. */ + engineAccountId?: string; + /** The Floodlight order ID provided by the advertiser for the conversion. */ + floodlightOrderId?: string; + /** ID that DS generates and uses to uniquely identify the inventory account that contains the product. */ + inventoryAccountId?: string; + /** The country registered for the Merchant Center feed that contains the product. Use an ISO 3166 code to specify a country. */ + productCountry?: string; + /** DS product group ID. */ + productGroupId?: string; + /** The product ID (SKU). */ + productId?: string; + /** The language registered for the Merchant Center feed that contains the product. Use an ISO 639 code to specify a language. */ + productLanguage?: string; + /** The quantity of this conversion, in millis. */ + quantityMillis?: string; + /** + * The revenue amount of this TRANSACTION conversion, in micros (value multiplied by 1000000, no decimal). For example, to specify a revenue value of "10" + * enter "10000000" (10 million) in your request. + */ + revenueMicros?: string; + /** The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). */ + segmentationId?: string; + /** The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). */ + segmentationName?: string; + /** The segmentation type of this conversion (for example, FLOODLIGHT). */ + segmentationType?: string; + /** The state of the conversion, that is, either ACTIVE or REMOVED. Note: state DELETED is deprecated. */ + state?: string; + /** The ID of the local store for which the product was advertised. Applicable only when the channel is "local". */ + storeId?: string; + /** + * The type of the conversion, that is, either ACTION or TRANSACTION. An ACTION conversion is an action by the user that has no monetarily quantifiable + * value, while a TRANSACTION conversion is an action that does have a monetarily quantifiable value. Examples are email list signups (ACTION) versus + * ecommerce purchases (TRANSACTION). + */ + type?: string; + } + interface ConversionList { + /** The conversions being requested. */ + conversion?: Conversion[]; + /** Identifies this as a ConversionList resource. Value: the fixed string doubleclicksearch#conversionList. */ + kind?: string; + } + interface CustomDimension { + /** Custom dimension name. */ + name?: string; + /** Custom dimension value. */ + value?: string; + } + interface CustomMetric { + /** Custom metric name. */ + name?: string; + /** Custom metric numeric value. */ + value?: number; + } + interface Report { + /** Asynchronous report only. Contains a list of generated report files once the report has succesfully completed. */ + files?: Array<{ + /** The size of this report file in bytes. */ + byteCount?: string; + /** Use this url to download the report file. */ + url?: string; + }>; + /** Asynchronous report only. Id of the report. */ + id?: string; + /** Asynchronous report only. True if and only if the report has completed successfully and the report files are ready to be downloaded. */ + isReportReady?: boolean; + /** Identifies this as a Report resource. Value: the fixed string doubleclicksearch#report. */ + kind?: string; + /** The request that created the report. Optional fields not specified in the original request are filled with default values. */ + request?: ReportRequest; + /** The number of report rows generated by the report, not including headers. */ + rowCount?: number; + /** Synchronous report only. Generated report rows. */ + rows?: ReportRow[]; + /** + * The currency code of all monetary values produced in the report, including values that are set by users (e.g., keyword bid settings) and metrics (e.g., + * cost and revenue). The currency code of a report is determined by the statisticsCurrency field of the report request. + */ + statisticsCurrencyCode?: string; + /** If all statistics of the report are sourced from the same time zone, this would be it. Otherwise the field is unset. */ + statisticsTimeZone?: string; + } + interface ReportApiColumnSpec { + /** Name of a DoubleClick Search column to include in the report. */ + columnName?: string; + /** + * Segments a report by a custom dimension. The report must be scoped to an advertiser or lower, and the custom dimension must already be set up in + * DoubleClick Search. The custom dimension name, which appears in DoubleClick Search, is case sensitive. + * If used in a conversion report, returns the value of the specified custom dimension for the given conversion, if set. This column does not segment the + * conversion report. + */ + customDimensionName?: string; + /** + * Name of a custom metric to include in the report. The report must be scoped to an advertiser or lower, and the custom metric must already be set up in + * DoubleClick Search. The custom metric name, which appears in DoubleClick Search, is case sensitive. + */ + customMetricName?: string; + /** + * Inclusive day in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together + * with startDate. + */ + endDate?: string; + /** Synchronous report only. Set to true to group by this column. Defaults to false. */ + groupByColumn?: boolean; + /** + * Text used to identify this column in the report output; defaults to columnName or savedColumnName when not specified. This can be used to prevent + * collisions between DoubleClick Search columns and saved columns with the same name. + */ + headerText?: string; + /** The platform that is used to provide data for the custom dimension. Acceptable values are "floodlight". */ + platformSource?: string; + /** + * Returns metrics only for a specific type of product activity. Accepted values are: + * - "sold": returns metrics only for products that were sold + * - "advertised": returns metrics only for products that were advertised in a Shopping campaign, and that might or might not have been sold + */ + productReportPerspective?: string; + /** + * Name of a saved column to include in the report. The report must be scoped at advertiser or lower, and this saved column must already be created in the + * DoubleClick Search UI. + */ + savedColumnName?: string; + /** + * Inclusive date in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together + * with endDate. + */ + startDate?: string; + } + interface ReportRequest { + /** + * The columns to include in the report. This includes both DoubleClick Search columns and saved columns. For DoubleClick Search columns, only the + * columnName parameter is required. For saved columns only the savedColumnName parameter is required. Both columnName and savedColumnName cannot be set + * in the same stanza. + */ + columns?: ReportApiColumnSpec[]; + /** Format that the report should be returned in. Currently csv or tsv is supported. */ + downloadFormat?: string; + /** A list of filters to be applied to the report. */ + filters?: Array<{ + /** Column to perform the filter on. This can be a DoubleClick Search column or a saved column. */ + column?: ReportApiColumnSpec; + /** Operator to use in the filter. See the filter reference for a list of available operators. */ + operator?: string; + /** A list of values to filter the column value against. */ + values?: any[]; + }>; + /** Determines if removed entities should be included in the report. Defaults to false. Deprecated, please use includeRemovedEntities instead. */ + includeDeletedEntities?: boolean; + /** Determines if removed entities should be included in the report. Defaults to false. */ + includeRemovedEntities?: boolean; + /** + * Asynchronous report only. The maximum number of rows per report file. A large report is split into many files based on this field. Acceptable values + * are 1000000 to 100000000, inclusive. + */ + maxRowsPerFile?: number; + /** Synchronous report only. A list of columns and directions defining sorting to be performed on the report rows. */ + orderBy?: Array<{ + /** Column to perform the sort on. This can be a DoubleClick Search-defined column or a saved column. */ + column?: ReportApiColumnSpec; + /** The sort direction, which is either ascending or descending. */ + sortOrder?: string; + }>; + /** + * The reportScope is a set of IDs that are used to determine which subset of entities will be returned in the report. The full lineage of IDs from the + * lowest scoped level desired up through agency is required. + */ + reportScope?: { + /** DS ad group ID. */ + adGroupId?: string; + /** DS ad ID. */ + adId?: string; + /** DS advertiser ID. */ + advertiserId?: string; + /** DS agency ID. */ + agencyId?: string; + /** DS campaign ID. */ + campaignId?: string; + /** DS engine account ID. */ + engineAccountId?: string; + /** DS keyword ID. */ + keywordId?: string; + }; + /** + * Determines the type of rows that are returned in the report. For example, if you specify reportType: keyword, each row in the report will contain data + * about a keyword. See the Types of Reports reference for the columns that are available for each type. + */ + reportType?: string; + /** + * Synchronous report only. The maxinum number of rows to return; additional rows are dropped. Acceptable values are 0 to 10000, inclusive. Defaults to + * 10000. + */ + rowCount?: number; + /** Synchronous report only. Zero-based index of the first row to return. Acceptable values are 0 to 50000, inclusive. Defaults to 0. */ + startRow?: number; + /** + * Specifies the currency in which monetary will be returned. Possible values are: usd, agency (valid if the report is scoped to agency or lower), + * advertiser (valid if the report is scoped to * advertiser or lower), or account (valid if the report is scoped to engine account or lower). + */ + statisticsCurrency?: string; + /** If metrics are requested in a report, this argument will be used to restrict the metrics to a specific time range. */ + timeRange?: { + /** Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See additional references on how changed attribute reports work. */ + changedAttributesSinceTimestamp?: string; + /** Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See additional references on how changed metrics reports work. */ + changedMetricsSinceTimestamp?: string; + /** Inclusive date in YYYY-MM-DD format. */ + endDate?: string; + /** Inclusive date in YYYY-MM-DD format. */ + startDate?: string; + }; + /** If true, the report would only be created if all the requested stat data are sourced from a single timezone. Defaults to false. */ + verifySingleTimeZone?: boolean; + } + interface ReportRow { + [key: string]: any; + } + interface SavedColumn { + /** Identifies this as a SavedColumn resource. Value: the fixed string doubleclicksearch#savedColumn. */ + kind?: string; + /** The name of the saved column. */ + savedColumnName?: string; + /** The type of data this saved column will produce. */ + type?: string; + } + interface SavedColumnList { + /** The saved columns being requested. */ + items?: SavedColumn[]; + /** Identifies this as a SavedColumnList resource. Value: the fixed string doubleclicksearch#savedColumnList. */ + kind?: string; + } + interface UpdateAvailabilityRequest { + /** The availabilities being requested. */ + availabilities?: Availability[]; + } + interface UpdateAvailabilityResponse { + /** The availabilities being returned. */ + availabilities?: Availability[]; + } + interface ConversionResource { + /** Retrieves a list of conversions from a DoubleClick Search engine account. */ + get(request: { + /** Numeric ID of the ad group. */ + adGroupId?: string; + /** Numeric ID of the ad. */ + adId?: string; + /** Numeric ID of the advertiser. */ + advertiserId: string; + /** Numeric ID of the agency. */ + agencyId: string; + /** Data format for the response. */ + alt?: string; + /** Numeric ID of the campaign. */ + campaignId?: string; + /** Numeric ID of the criterion. */ + criterionId?: string; + /** Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + endDate: number; + /** Numeric ID of the engine account. */ + engineAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The number of conversions to return per call. */ + rowCount: number; + /** First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + startDate: number; + /** The 0-based starting index for retrieving conversions results. */ + startRow: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a batch of new conversions into DoubleClick Search. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. */ + patch(request: { + /** Numeric ID of the advertiser. */ + advertiserId: string; + /** Numeric ID of the agency. */ + agencyId: string; + /** Data format for the response. */ + alt?: string; + /** Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + endDate: number; + /** Numeric ID of the engine account. */ + engineAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The number of conversions to return per call. */ + rowCount: number; + /** First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + startDate: number; + /** The 0-based starting index for retrieving conversions results. */ + startRow: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a batch of conversions in DoubleClick Search. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the availabilities of a batch of floodlight activities in DoubleClick Search. */ + updateAvailability(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** Generates and returns a report immediately. */ + generate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Polls for the status of a report request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the report request being polled. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Downloads a report file encoded in UTF-8. */ + getFile(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The index of the report fragment to download. */ + reportFragment: number; + /** ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a report request into the reporting system. */ + request(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedColumnsResource { + /** Retrieve the list of saved columns for a specified advertiser. */ + list(request: { + /** DS ID of the advertiser. */ + advertiserId: string; + /** DS ID of the agency. */ + agencyId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.doubleclicksearch/readme.md b/types/gapi.client.doubleclicksearch/readme.md new file mode 100644 index 0000000000..5889f83d22 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/readme.md @@ -0,0 +1,104 @@ +# TypeScript typings for DoubleClick Search API v2 +Reports and modifies your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions). +For detailed description please check [documentation](https://developers.google.com/doubleclick-search/). + +## Installing + +Install typings for DoubleClick Search API: +``` +npm install @types/gapi.client.doubleclicksearch@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('doubleclicksearch', 'v2', () => { + // now we can use gapi.client.doubleclicksearch + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your advertising data in DoubleClick Search + 'https://www.googleapis.com/auth/doubleclicksearch', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DoubleClick Search API resources: + +```typescript + +/* +Retrieves a list of conversions from a DoubleClick Search engine account. +*/ +await gapi.client.conversion.get({ advertiserId: "advertiserId", agencyId: "agencyId", endDate: 1, engineAccountId: "engineAccountId", rowCount: 1, startDate: 1, startRow: 1, }); + +/* +Inserts a batch of new conversions into DoubleClick Search. +*/ +await gapi.client.conversion.insert({ }); + +/* +Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. +*/ +await gapi.client.conversion.patch({ advertiserId: "advertiserId", agencyId: "agencyId", endDate: 1, engineAccountId: "engineAccountId", rowCount: 1, startDate: 1, startRow: 1, }); + +/* +Updates a batch of conversions in DoubleClick Search. +*/ +await gapi.client.conversion.update({ }); + +/* +Updates the availabilities of a batch of floodlight activities in DoubleClick Search. +*/ +await gapi.client.conversion.updateAvailability({ }); + +/* +Generates and returns a report immediately. +*/ +await gapi.client.reports.generate({ }); + +/* +Polls for the status of a report request. +*/ +await gapi.client.reports.get({ reportId: "reportId", }); + +/* +Downloads a report file encoded in UTF-8. +*/ +await gapi.client.reports.getFile({ reportFragment: 1, reportId: "reportId", }); + +/* +Inserts a report request into the reporting system. +*/ +await gapi.client.reports.request({ }); + +/* +Retrieve the list of saved columns for a specified advertiser. +*/ +await gapi.client.savedColumns.list({ advertiserId: "advertiserId", agencyId: "agencyId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.doubleclicksearch/tsconfig.json b/types/gapi.client.doubleclicksearch/tsconfig.json new file mode 100644 index 0000000000..fb0d0a44bd --- /dev/null +++ b/types/gapi.client.doubleclicksearch/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.doubleclicksearch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.doubleclicksearch/tslint.json b/types/gapi.client.doubleclicksearch/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.drive/gapi.client.drive-tests.ts b/types/gapi.client.drive/gapi.client.drive-tests.ts new file mode 100644 index 0000000000..f9fa0ce332 --- /dev/null +++ b/types/gapi.client.drive/gapi.client.drive-tests.ts @@ -0,0 +1,291 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('drive', 'v3', () => { + /** now we can use gapi.client.drive */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive', + /** View and manage its own configuration data in your Google Drive */ + 'https://www.googleapis.com/auth/drive.appdata', + /** View and manage Google Drive files and folders that you have opened or created with this app */ + 'https://www.googleapis.com/auth/drive.file', + /** View and manage metadata of files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata', + /** View metadata for files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata.readonly', + /** View the photos, videos and albums in your Google Photos */ + 'https://www.googleapis.com/auth/drive.photos.readonly', + /** View the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.readonly', + /** Modify your Google Apps Script scripts' behavior */ + 'https://www.googleapis.com/auth/drive.scripts', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets information about the user, the user's Drive, and system capabilities. */ + await gapi.client.about.get({ + }); + /** Gets the starting pageToken for listing future changes. */ + await gapi.client.changes.getStartPageToken({ + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Lists the changes for a user or Team Drive. */ + await gapi.client.changes.list({ + includeCorpusRemovals: true, + includeRemoved: true, + includeTeamDriveItems: true, + pageSize: 4, + pageToken: "pageToken", + restrictToMyDrive: true, + spaces: "spaces", + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Subscribes to changes for a user. */ + await gapi.client.changes.watch({ + includeCorpusRemovals: true, + includeRemoved: true, + includeTeamDriveItems: true, + pageSize: 4, + pageToken: "pageToken", + restrictToMyDrive: true, + spaces: "spaces", + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Stop watching resources through this channel */ + await gapi.client.channels.stop({ + }); + /** Creates a new comment on a file. */ + await gapi.client.comments.create({ + fileId: "fileId", + }); + /** Deletes a comment. */ + await gapi.client.comments.delete({ + commentId: "commentId", + fileId: "fileId", + }); + /** Gets a comment by ID. */ + await gapi.client.comments.get({ + commentId: "commentId", + fileId: "fileId", + includeDeleted: true, + }); + /** Lists a file's comments. */ + await gapi.client.comments.list({ + fileId: "fileId", + includeDeleted: true, + pageSize: 3, + pageToken: "pageToken", + startModifiedTime: "startModifiedTime", + }); + /** Updates a comment with patch semantics. */ + await gapi.client.comments.update({ + commentId: "commentId", + fileId: "fileId", + }); + /** Creates a copy of a file and applies any requested updates with patch semantics. */ + await gapi.client.files.copy({ + fileId: "fileId", + ignoreDefaultVisibility: true, + keepRevisionForever: true, + ocrLanguage: "ocrLanguage", + supportsTeamDrives: true, + }); + /** Creates a new file. */ + await gapi.client.files.create({ + ignoreDefaultVisibility: true, + keepRevisionForever: true, + ocrLanguage: "ocrLanguage", + supportsTeamDrives: true, + useContentAsIndexableText: true, + }); + /** + * Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the + * parent. If the target is a folder, all descendants owned by the user are also deleted. + */ + await gapi.client.files.delete({ + fileId: "fileId", + supportsTeamDrives: true, + }); + /** Permanently deletes all of the user's trashed files. */ + await gapi.client.files.emptyTrash({ + }); + /** Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. */ + await gapi.client.files.export({ + fileId: "fileId", + mimeType: "mimeType", + }); + /** Generates a set of file IDs which can be provided in create requests. */ + await gapi.client.files.generateIds({ + count: 1, + space: "space", + }); + /** Gets a file's metadata or content by ID. */ + await gapi.client.files.get({ + acknowledgeAbuse: true, + fileId: "fileId", + supportsTeamDrives: true, + }); + /** Lists or searches files. */ + await gapi.client.files.list({ + corpora: "corpora", + corpus: "corpus", + includeTeamDriveItems: true, + orderBy: "orderBy", + pageSize: 5, + pageToken: "pageToken", + q: "q", + spaces: "spaces", + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Updates a file's metadata and/or content with patch semantics. */ + await gapi.client.files.update({ + addParents: "addParents", + fileId: "fileId", + keepRevisionForever: true, + ocrLanguage: "ocrLanguage", + removeParents: "removeParents", + supportsTeamDrives: true, + useContentAsIndexableText: true, + }); + /** Subscribes to changes to a file */ + await gapi.client.files.watch({ + acknowledgeAbuse: true, + fileId: "fileId", + supportsTeamDrives: true, + }); + /** Creates a permission for a file or Team Drive. */ + await gapi.client.permissions.create({ + emailMessage: "emailMessage", + fileId: "fileId", + sendNotificationEmail: true, + supportsTeamDrives: true, + transferOwnership: true, + }); + /** Deletes a permission. */ + await gapi.client.permissions.delete({ + fileId: "fileId", + permissionId: "permissionId", + supportsTeamDrives: true, + }); + /** Gets a permission by ID. */ + await gapi.client.permissions.get({ + fileId: "fileId", + permissionId: "permissionId", + supportsTeamDrives: true, + }); + /** Lists a file's or Team Drive's permissions. */ + await gapi.client.permissions.list({ + fileId: "fileId", + pageSize: 2, + pageToken: "pageToken", + supportsTeamDrives: true, + }); + /** Updates a permission with patch semantics. */ + await gapi.client.permissions.update({ + fileId: "fileId", + permissionId: "permissionId", + removeExpiration: true, + supportsTeamDrives: true, + transferOwnership: true, + }); + /** Creates a new reply to a comment. */ + await gapi.client.replies.create({ + commentId: "commentId", + fileId: "fileId", + }); + /** Deletes a reply. */ + await gapi.client.replies.delete({ + commentId: "commentId", + fileId: "fileId", + replyId: "replyId", + }); + /** Gets a reply by ID. */ + await gapi.client.replies.get({ + commentId: "commentId", + fileId: "fileId", + includeDeleted: true, + replyId: "replyId", + }); + /** Lists a comment's replies. */ + await gapi.client.replies.list({ + commentId: "commentId", + fileId: "fileId", + includeDeleted: true, + pageSize: 4, + pageToken: "pageToken", + }); + /** Updates a reply with patch semantics. */ + await gapi.client.replies.update({ + commentId: "commentId", + fileId: "fileId", + replyId: "replyId", + }); + /** Permanently deletes a revision. This method is only applicable to files with binary content in Drive. */ + await gapi.client.revisions.delete({ + fileId: "fileId", + revisionId: "revisionId", + }); + /** Gets a revision's metadata or content by ID. */ + await gapi.client.revisions.get({ + acknowledgeAbuse: true, + fileId: "fileId", + revisionId: "revisionId", + }); + /** Lists a file's revisions. */ + await gapi.client.revisions.list({ + fileId: "fileId", + pageSize: 2, + pageToken: "pageToken", + }); + /** Updates a revision with patch semantics. */ + await gapi.client.revisions.update({ + fileId: "fileId", + revisionId: "revisionId", + }); + /** Creates a new Team Drive. */ + await gapi.client.teamdrives.create({ + requestId: "requestId", + }); + /** Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. */ + await gapi.client.teamdrives.delete({ + teamDriveId: "teamDriveId", + }); + /** Gets a Team Drive's metadata by ID. */ + await gapi.client.teamdrives.get({ + teamDriveId: "teamDriveId", + }); + /** Lists the user's Team Drives. */ + await gapi.client.teamdrives.list({ + pageSize: 1, + pageToken: "pageToken", + }); + /** Updates a Team Drive's metadata */ + await gapi.client.teamdrives.update({ + teamDriveId: "teamDriveId", + }); + } +}); diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts new file mode 100644 index 0000000000..7004e2c0bb --- /dev/null +++ b/types/gapi.client.drive/index.d.ts @@ -0,0 +1,1831 @@ +// Type definitions for Google Drive API v3 3.0 +// Project: https://developers.google.com/drive/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/drive/v3/rest + +/// + +declare namespace gapi.client { + /** Load Drive API v3 */ + function load(name: "drive", version: "v3"): PromiseLike; + function load(name: "drive", version: "v3", callback: () => any): void; + + const about: drive.AboutResource; + + const changes: drive.ChangesResource; + + const channels: drive.ChannelsResource; + + const comments: drive.CommentsResource; + + const files: drive.FilesResource; + + const permissions: drive.PermissionsResource; + + const replies: drive.RepliesResource; + + const revisions: drive.RevisionsResource; + + const teamdrives: drive.TeamdrivesResource; + + namespace drive { + interface About { + /** Whether the user has installed the requesting app. */ + appInstalled?: boolean; + /** A map of source MIME type to possible targets for all supported exports. */ + exportFormats?: Record; + /** The currently supported folder colors as RGB hex strings. */ + folderColorPalette?: string[]; + /** A map of source MIME type to possible targets for all supported imports. */ + importFormats?: Record; + /** Identifies what kind of resource this is. Value: the fixed string "drive#about". */ + kind?: string; + /** A map of maximum import sizes by MIME type, in bytes. */ + maxImportSizes?: Record; + /** The maximum upload size in bytes. */ + maxUploadSize?: string; + /** The user's storage quota limits and usage. All fields are measured in bytes. */ + storageQuota?: { + /** The usage limit, if applicable. This will not be present if the user has unlimited storage. */ + limit?: string; + /** The total usage across all services. */ + usage?: string; + /** The usage by all files in Google Drive. */ + usageInDrive?: string; + /** The usage by trashed files in Google Drive. */ + usageInDriveTrash?: string; + }; + /** A list of themes that are supported for Team Drives. */ + teamDriveThemes?: Array<{ + /** A link to this Team Drive theme's background image. */ + backgroundImageLink?: string; + /** The color of this Team Drive theme as an RGB hex string. */ + colorRgb?: string; + /** The ID of the theme. */ + id?: string; + }>; + /** The authenticated user. */ + user?: User; + } + interface Change { + /** 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 which has changed. */ + fileId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#change". */ + kind?: string; + /** Whether the file or Team Drive has been removed from this list of changes, for example by deletion or loss of access. */ + removed?: boolean; + /** + * The updated state of the Team Drive. Present if the type is teamDrive, the user is still a member of the Team Drive, and the Team Drive has not been + * removed. + */ + teamDrive?: TeamDrive; + /** The ID of the Team Drive associated with this change. */ + teamDriveId?: string; + /** The time of this change (RFC 3339 date-time). */ + time?: string; + /** The type of the change. Possible values are file and teamDrive. */ + type?: string; + } + interface ChangeList { + /** The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + changes?: Change[]; + /** Identifies what kind of resource this is. Value: the fixed string "drive#changeList". */ + kind?: string; + /** The starting page token for future changes. This will be present only if the end of the current changes list has been reached. */ + newStartPageToken?: string; + /** + * 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. + */ + nextPageToken?: string; + } + interface Channel { + /** The address where notifications are delivered for this channel. */ + address?: string; + /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ + expiration?: string; + /** A UUID or similar unique string that identifies this channel. */ + id?: string; + /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */ + kind?: string; + /** Additional parameters controlling delivery channel behavior. Optional. */ + params?: Record; + /** A Boolean value to indicate whether payload is wanted. Optional. */ + payload?: boolean; + /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ + resourceId?: string; + /** A version-specific identifier for the watched resource. */ + resourceUri?: string; + /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ + token?: string; + /** The type of delivery mechanism used for this channel. */ + type?: string; + } + interface Comment { + /** A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties. */ + anchor?: string; + /** The user who created the comment. */ + author?: User; + /** The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed. */ + content?: string; + /** The time at which the comment was created (RFC 3339 date-time). */ + createdTime?: string; + /** Whether the comment has been deleted. A deleted comment has no content. */ + deleted?: boolean; + /** The content of the comment with HTML formatting. */ + htmlContent?: string; + /** The ID of the comment. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#comment". */ + kind?: string; + /** The last time the comment or any of its replies was modified (RFC 3339 date-time). */ + modifiedTime?: string; + /** + * The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location + * of the comment. + */ + quotedFileContent?: { + /** The MIME type of the quoted content. */ + mimeType?: string; + /** The quoted content itself. This is interpreted as plain text if set through the API. */ + value?: string; + }; + /** The full list of replies to the comment in chronological order. */ + replies?: Reply[]; + /** Whether the comment has been resolved by one of its replies. */ + resolved?: boolean; + } + interface CommentList { + /** The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + comments?: Comment[]; + /** Identifies what kind of resource this is. Value: the fixed string "drive#commentList". */ + kind?: string; + /** + * 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. + */ + nextPageToken?: string; + } + interface File { + /** + * A collection of arbitrary key-value pairs which are private to the requesting app. + * Entries with null values are cleared in update and copy requests. + */ + appProperties?: Record; + /** Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. */ + capabilities?: { + /** Whether the current user can add children to this folder. This is always false when the item is not a folder. */ + canAddChildren?: boolean; + /** Whether the current user can change whether viewers can copy the contents of this file. */ + canChangeViewersCanCopyContent?: boolean; + /** Whether the current user can comment on this file. */ + canComment?: boolean; + /** + * Whether the current user can copy this file. For a Team Drive item, whether the current user can copy non-folder descendants of this item, or this item + * itself if it is not a folder. + */ + canCopy?: boolean; + /** Whether the current user can delete this file. */ + canDelete?: boolean; + /** Whether the current user can download this file. */ + canDownload?: boolean; + /** Whether the current user can edit this file. */ + canEdit?: boolean; + /** Whether the current user can list the children of this folder. This is always false when the item is not a folder. */ + canListChildren?: boolean; + /** Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem. */ + canMoveItemIntoTeamDrive?: boolean; + /** + * Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail + * depending on the new parent that is being added. Only populated for Team Drive files. + */ + canMoveTeamDriveItem?: boolean; + /** + * Whether the current user can read the revisions resource of this file. For a Team Drive item, whether revisions of non-folder descendants of this item, + * or this item itself if it is not a folder, can be read. + */ + canReadRevisions?: boolean; + /** Whether the current user can read the Team Drive to which this file belongs. Only populated for Team Drive files. */ + canReadTeamDrive?: boolean; + /** Whether the current user can remove children from this folder. This is always false when the item is not a folder. */ + canRemoveChildren?: boolean; + /** Whether the current user can rename this file. */ + canRename?: boolean; + /** Whether the current user can modify the sharing settings for this file. */ + canShare?: boolean; + /** Whether the current user can move this file to trash. */ + canTrash?: boolean; + /** Whether the current user can restore this file from trash. */ + canUntrash?: boolean; + }; + /** Additional information about the content of the file. These fields are never populated in responses. */ + contentHints?: { + /** Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. */ + indexableText?: string; + /** A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. */ + thumbnail?: { + /** The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). */ + image?: string; + /** The MIME type of the thumbnail. */ + mimeType?: string; + }; + }; + /** The time at which the file was created (RFC 3339 date-time). */ + createdTime?: string; + /** A short description of the file. */ + description?: string; + /** Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. */ + explicitlyTrashed?: boolean; + /** The final component of fullFileExtension. This is only available for files with binary content in Drive. */ + fileExtension?: string; + /** + * The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. + * If an unsupported color is specified, the closest color in the palette will be used instead. + */ + folderColorRgb?: string; + /** + * The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files + * with binary content in Drive. + * This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. + */ + fullFileExtension?: string; + /** Whether any users are granted file access directly on this file. This field is only populated for Team Drive files. */ + hasAugmentedPermissions?: boolean; + /** + * 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. + */ + hasThumbnail?: boolean; + /** The ID of the file's head revision. This is currently only available for files with binary content in Drive. */ + headRevisionId?: string; + /** A static, unauthenticated link to the file's icon. */ + iconLink?: string; + /** The ID of the file. */ + id?: string; + /** Additional metadata about image media, if available. */ + imageMediaMetadata?: { + /** The aperture used to create the photo (f-number). */ + aperture?: number; + /** The make of the camera used to create the photo. */ + cameraMake?: string; + /** The model of the camera used to create the photo. */ + cameraModel?: string; + /** The color space of the photo. */ + colorSpace?: string; + /** The exposure bias of the photo (APEX value). */ + exposureBias?: number; + /** The exposure mode used to create the photo. */ + exposureMode?: string; + /** The length of the exposure, in seconds. */ + exposureTime?: number; + /** Whether a flash was used to create the photo. */ + flashUsed?: boolean; + /** The focal length used to create the photo, in millimeters. */ + focalLength?: number; + /** The height of the image in pixels. */ + height?: number; + /** The ISO speed used to create the photo. */ + isoSpeed?: number; + /** The lens used to create the photo. */ + lens?: string; + /** Geographic location information stored in the image. */ + location?: { + /** The altitude stored in the image. */ + altitude?: number; + /** The latitude stored in the image. */ + latitude?: number; + /** The longitude stored in the image. */ + longitude?: number; + }; + /** The smallest f-number of the lens at the focal length used to create the photo (APEX value). */ + maxApertureValue?: number; + /** The metering mode used to create the photo. */ + meteringMode?: string; + /** The rotation in clockwise degrees from the image's original orientation. */ + rotation?: number; + /** The type of sensor used to create the photo. */ + sensor?: string; + /** The distance to the subject of the photo, in meters. */ + subjectDistance?: number; + /** The date and time the photo was taken (EXIF DateTime). */ + time?: string; + /** The white balance mode used to create the photo. */ + whiteBalance?: string; + /** The width of the image in pixels. */ + width?: number; + }; + /** Whether the file was created or opened by the requesting app. */ + isAppAuthorized?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "drive#file". */ + kind?: string; + /** The last user to modify the file. */ + lastModifyingUser?: User; + /** The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive. */ + md5Checksum?: string; + /** + * The MIME type of the file. + * Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new + * revision is uploaded. + * If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the + * About resource. + */ + mimeType?: string; + /** Whether the file has been modified by this user. */ + modifiedByMe?: boolean; + /** The last time the file was modified by the user (RFC 3339 date-time). */ + modifiedByMeTime?: string; + /** + * The last time the file was modified by anyone (RFC 3339 date-time). + * Note that setting modifiedTime will also update modifiedByMeTime for the user. + */ + modifiedTime?: string; + /** + * The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of Team Drives, My + * Drive root folder, and Application Data folder the name is constant. + */ + name?: string; + /** + * The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary + * content in Drive. + */ + originalFilename?: string; + /** Whether the user owns the file. Not populated for Team Drive files. */ + ownedByMe?: boolean; + /** The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files. */ + owners?: User[]; + /** + * The IDs of the parent folders which contain the file. + * If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and + * removeParents parameters to modify the values. + */ + parents?: string[]; + /** List of permission IDs for users with access to this file. */ + permissionIds?: string[]; + /** The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files. */ + permissions?: Permission[]; + /** + * A collection of arbitrary key-value pairs which are visible to all apps. + * Entries with null values are cleared in update and copy requests. + */ + properties?: Record; + /** The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. */ + quotaBytesUsed?: string; + /** Whether the file has been shared. Not populated for Team Drive files. */ + shared?: boolean; + /** The time at which the file was shared with the user, if applicable (RFC 3339 date-time). */ + sharedWithMeTime?: string; + /** The user who shared the file with the requesting user, if applicable. */ + sharingUser?: User; + /** The size of the file's content in bytes. This is only applicable to files with binary content in Drive. */ + size?: string; + /** The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string[]; + /** Whether the user has starred the file. */ + starred?: boolean; + /** ID of the Team Drive the file resides in. */ + teamDriveId?: string; + /** + * A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the + * file's content. + */ + thumbnailLink?: string; + /** The thumbnail version for use in thumbnail cache invalidation. */ + thumbnailVersion?: string; + /** + * Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files + * in the owner's trash. + */ + trashed?: boolean; + /** The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files. */ + trashedTime?: string; + /** If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files. */ + trashingUser?: User; + /** 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 user. */ + version?: string; + /** Additional metadata about video media. This may not be available immediately upon upload. */ + videoMediaMetadata?: { + /** The duration of the video in milliseconds. */ + durationMillis?: string; + /** The height of the video in pixels. */ + height?: number; + /** The width of the video in pixels. */ + width?: number; + }; + /** Whether the file has been viewed by this user. */ + viewedByMe?: boolean; + /** The last time the file was viewed by the user (RFC 3339 date-time). */ + viewedByMeTime?: string; + /** Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations. */ + viewersCanCopyContent?: boolean; + /** A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive. */ + webContentLink?: string; + /** A link for opening the file in a relevant Google editor or viewer in a browser. */ + webViewLink?: string; + /** Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files. */ + writersCanShare?: boolean; + } + interface FileList { + /** The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + files?: File[]; + /** + * 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 Team Drives with the "user,allTeamDrives" 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 "user" or "teamDrive". + */ + incompleteSearch?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "drive#fileList". */ + kind?: string; + /** + * 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. + */ + nextPageToken?: string; + } + interface GeneratedIds { + /** The IDs generated for the requesting user in the specified space. */ + ids?: string[]; + /** Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds". */ + kind?: string; + /** The type of file that can be created with these IDs. */ + space?: string; + } + interface Permission { + /** Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. */ + allowFileDiscovery?: boolean; + /** Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. */ + deleted?: boolean; + /** A displayable name for users, groups or domains. */ + displayName?: string; + /** The domain to which this permission refers. */ + domain?: string; + /** The email address of the user or group to which this permission refers. */ + emailAddress?: string; + /** + * The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: + * - They can only be set on user and group permissions + * - The time must be in the future + * - The time cannot be more than a year in the future + */ + expirationTime?: string; + /** The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#permission". */ + kind?: string; + /** A link to the user's profile photo, if available. */ + photoLink?: string; + /** + * The role granted by this permission. While new values may be supported in the future, the following are currently allowed: + * - organizer + * - owner + * - writer + * - commenter + * - reader + */ + role?: string; + /** + * Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only + * for Team Drive items. + */ + teamDrivePermissionDetails?: Array<{ + /** Whether this permission is inherited. This field is always populated. This is an output-only field. */ + inherited?: boolean; + /** The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive. */ + inheritedFrom?: string; + /** + * The primary role for this user. While new values may be added in the future, the following are currently possible: + * - organizer + * - writer + * - commenter + * - reader + */ + role?: string; + /** + * The Team Drive permission type for this user. While new values may be added in future, the following are currently possible: + * - file + * - member + */ + teamDrivePermissionType?: string; + }>; + /** + * The type of the grantee. Valid values are: + * - user + * - group + * - domain + * - anyone + */ + type?: string; + } + interface PermissionList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#permissionList". */ + kind?: string; + /** + * 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. + */ + nextPageToken?: string; + /** The list of permissions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + permissions?: Permission[]; + } + interface Reply { + /** + * The action the reply performed to the parent comment. Valid values are: + * - resolve + * - reopen + */ + action?: string; + /** The user who created the reply. */ + author?: User; + /** + * The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if + * no action is specified. + */ + content?: string; + /** The time at which the reply was created (RFC 3339 date-time). */ + createdTime?: string; + /** Whether the reply has been deleted. A deleted reply has no content. */ + deleted?: boolean; + /** The content of the reply with HTML formatting. */ + htmlContent?: string; + /** The ID of the reply. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#reply". */ + kind?: string; + /** The last time the reply was modified (RFC 3339 date-time). */ + modifiedTime?: string; + } + interface ReplyList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#replyList". */ + kind?: string; + /** + * 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. + */ + nextPageToken?: string; + /** The list of replies. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + replies?: Reply[]; + } + interface Revision { + /** The ID of the revision. */ + id?: string; + /** + * Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after + * newer content is uploaded. This can be set on a maximum of 200 revisions for a file. + * This field is only applicable to files with binary content in Drive. + */ + keepForever?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "drive#revision". */ + kind?: string; + /** The last user to modify this revision. */ + lastModifyingUser?: User; + /** The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. */ + md5Checksum?: string; + /** The MIME type of the revision. */ + mimeType?: string; + /** The last time the revision was modified (RFC 3339 date-time). */ + modifiedTime?: string; + /** The original filename used to create this revision. This is only applicable to files with binary content in Drive. */ + originalFilename?: string; + /** Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs. */ + publishAuto?: boolean; + /** Whether this revision is published. This is only applicable to Google Docs. */ + published?: boolean; + /** Whether this revision is published outside the domain. This is only applicable to Google Docs. */ + publishedOutsideDomain?: boolean; + /** The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. */ + size?: string; + } + interface RevisionList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#revisionList". */ + kind?: string; + /** + * The page token for the next page of revisions. This 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. + */ + nextPageToken?: string; + /** The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + revisions?: Revision[]; + } + interface StartPageToken { + /** Identifies what kind of resource this is. Value: the fixed string "drive#startPageToken". */ + kind?: string; + /** The starting page token for listing changes. */ + startPageToken?: string; + } + interface 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. + */ + backgroundImageFile?: { + /** The ID of an image file in Drive to use for the background image. */ + id?: string; + /** + * 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. + */ + width?: number; + /** + * 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. + */ + xCoordinate?: number; + /** + * 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. + */ + yCoordinate?: number; + }; + /** A short-lived link to this Team Drive's background image. */ + backgroundImageLink?: string; + /** Capabilities the current user has on this Team Drive. */ + capabilities?: { + /** Whether the current user can add children to folders in this Team Drive. */ + canAddChildren?: boolean; + /** Whether the current user can change the background of this Team Drive. */ + canChangeTeamDriveBackground?: boolean; + /** Whether the current user can comment on files in this Team Drive. */ + canComment?: boolean; + /** Whether the current user can copy files in this Team Drive. */ + canCopy?: boolean; + /** + * 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. + */ + canDeleteTeamDrive?: boolean; + /** Whether the current user can download files in this Team Drive. */ + canDownload?: boolean; + /** Whether the current user can edit files in this Team Drive */ + canEdit?: boolean; + /** Whether the current user can list the children of folders in this Team Drive. */ + canListChildren?: boolean; + /** Whether the current user can add members to this Team Drive or remove them or change their role. */ + canManageMembers?: boolean; + /** Whether the current user can read the revisions resource of files in this Team Drive. */ + canReadRevisions?: boolean; + /** Whether the current user can remove children from folders in this Team Drive. */ + canRemoveChildren?: boolean; + /** Whether the current user can rename files or folders in this Team Drive. */ + canRename?: boolean; + /** Whether the current user can rename this Team Drive. */ + canRenameTeamDrive?: boolean; + /** Whether the current user can share files or folders in this Team Drive. */ + canShare?: boolean; + }; + /** 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. */ + colorRgb?: string; + /** The ID of this Team Drive which is also the ID of the top level folder for this Team Drive. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#teamDrive". */ + kind?: string; + /** The name of this Team Drive. */ + name?: string; + /** + * 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.create 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. + */ + themeId?: string; + } + interface TeamDriveList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#teamDriveList". */ + kind?: string; + /** + * The page token for the next page of Team Drives. This will be absent if the end of the Team Drives 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. + */ + nextPageToken?: string; + /** The list of Team Drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + teamDrives?: TeamDrive[]; + } + interface User { + /** A plain text displayable name for this user. */ + displayName?: string; + /** 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. */ + emailAddress?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#user". */ + kind?: string; + /** Whether this user is the requesting user. */ + me?: boolean; + /** The user's ID as visible in Permission resources. */ + permissionId?: string; + /** A link to the user's profile photo, if available. */ + photoLink?: string; + } + interface AboutResource { + /** Gets information about the user, the user's Drive, and system capabilities. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChangesResource { + /** Gets the starting pageToken for listing future changes. */ + getStartPageToken(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the changes for a user or Team Drive. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * 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. + */ + includeCorpusRemovals?: boolean; + /** Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. */ + includeRemoved?: boolean; + /** Whether Team Drive files or changes should be included in results. */ + includeTeamDriveItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of changes to return per page. */ + pageSize?: number; + /** + * 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. + */ + pageToken: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or + * shared files which have not been added to My Drive. + */ + restrictToMyDrive?: boolean; + /** A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID + * and change ID as an identifier. + */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Subscribes to changes for a user. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * 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. + */ + includeCorpusRemovals?: boolean; + /** Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. */ + includeRemoved?: boolean; + /** Whether Team Drive files or changes should be included in results. */ + includeTeamDriveItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of changes to return per page. */ + pageSize?: number; + /** + * 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. + */ + pageToken: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or + * shared files which have not been added to My Drive. + */ + restrictToMyDrive?: boolean; + /** A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID + * and change ID as an identifier. + */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChannelsResource { + /** Stop watching resources through this channel */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CommentsResource { + /** Creates a new comment on a file. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a comment. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a comment by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to return deleted comments. Deleted comments will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a file's comments. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to include deleted comments. Deleted comments will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of comments to return per page. */ + pageSize?: number; + /** 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. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time). */ + startModifiedTime?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a comment with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FilesResource { + /** Creates a copy of a file and applies any requested updates with patch semantics. */ + copy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** + * Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to + * the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + */ + ignoreDefaultVisibility?: boolean; + /** Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. */ + keepRevisionForever?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** A language hint for OCR processing during image import (ISO 639-1 code). */ + ocrLanguage?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new file. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to + * the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + */ + ignoreDefaultVisibility?: boolean; + /** Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. */ + keepRevisionForever?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** A language hint for OCR processing during image import (ISO 639-1 code). */ + ocrLanguage?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** Whether to use the uploaded content as indexable text. */ + useContentAsIndexableText?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the + * parent. If the target is a folder, all descendants owned by the user are also deleted. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Permanently deletes all of the user's trashed files. */ + emptyTrash(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. */ + export(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The MIME type of the format requested for this export. */ + mimeType: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Generates a set of file IDs which can be provided in create requests. */ + generateIds(request: { + /** Data format for the response. */ + alt?: string; + /** The number of IDs to return. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. */ + space?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a file's metadata or content by ID. */ + get(request: { + /** Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. */ + acknowledgeAbuse?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists or searches files. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and + * 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to + * 'allTeamDrives' for efficiency. + */ + corpora?: string; + /** The source of files to list. Deprecated: use 'corpora' instead. */ + corpus?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether Team Drive items should be included in results. */ + includeTeamDriveItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', + * 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the + * 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one + * million files in which the requested sort order is ignored. + */ + orderBy?: string; + /** 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. */ + pageSize?: number; + /** 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. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A query for filtering the file results. See the "Search for Files" guide for supported syntax. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** ID of Team Drive to search. */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a file's metadata and/or content with patch semantics. */ + update(request: { + /** A comma-separated list of parent IDs to add. */ + addParents?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. */ + keepRevisionForever?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** A language hint for OCR processing during image import (ISO 639-1 code). */ + ocrLanguage?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A comma-separated list of parent IDs to remove. */ + removeParents?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** Whether to use the uploaded content as indexable text. */ + useContentAsIndexableText?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Subscribes to changes to a file */ + watch(request: { + /** Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. */ + acknowledgeAbuse?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PermissionsResource { + /** Creates a permission for a file or Team Drive. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** A custom message to include in the notification email. */ + emailMessage?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other + * requests. It must not be disabled for ownership transfers. + */ + sendNotificationEmail?: boolean; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of + * the side effect. + */ + transferOwnership?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a permission. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a permission by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a file's or Team Drive's permissions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for + * files that are not in a Team Drive, the entire list will be returned. + */ + pageSize?: number; + /** 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. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a permission with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to remove the expiration date. */ + removeExpiration?: boolean; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of + * the side effect. + */ + transferOwnership?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RepliesResource { + /** Creates a new reply to a comment. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a reply. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the reply. */ + replyId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a reply by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to return deleted replies. Deleted replies will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the reply. */ + replyId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a comment's replies. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to include deleted replies. Deleted replies will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of replies to return per page. */ + pageSize?: number; + /** 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. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a reply with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the reply. */ + replyId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RevisionsResource { + /** Permanently deletes a revision. This method is only applicable to files with binary content in Drive. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the revision. */ + revisionId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a revision's metadata or content by ID. */ + get(request: { + /** Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. */ + acknowledgeAbuse?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the revision. */ + revisionId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a file's revisions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of revisions to return per page. */ + pageSize?: number; + /** 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. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a revision with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the revision. */ + revisionId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TeamdrivesResource { + /** Creates a new Team Drive. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * 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. + */ + requestId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the Team Drive */ + teamDriveId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a Team Drive's metadata by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the Team Drive */ + teamDriveId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the user's Team Drives. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum number of Team Drives to return. */ + pageSize?: number; + /** Page token for Team Drives. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a Team Drive's metadata */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the Team Drive */ + teamDriveId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.drive/readme.md b/types/gapi.client.drive/readme.md new file mode 100644 index 0000000000..da5a3fb6e5 --- /dev/null +++ b/types/gapi.client.drive/readme.md @@ -0,0 +1,270 @@ +# TypeScript typings for Drive API v3 +Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions. +For detailed description please check [documentation](https://developers.google.com/drive/). + +## Installing + +Install typings for Drive API: +``` +npm install @types/gapi.client.drive@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('drive', 'v3', () => { + // now we can use gapi.client.drive + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage the files in your Google Drive + 'https://www.googleapis.com/auth/drive', + + // View and manage its own configuration data in your Google Drive + 'https://www.googleapis.com/auth/drive.appdata', + + // View and manage Google Drive files and folders that you have opened or created with this app + 'https://www.googleapis.com/auth/drive.file', + + // View and manage metadata of files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata', + + // View metadata for files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata.readonly', + + // View the photos, videos and albums in your Google Photos + 'https://www.googleapis.com/auth/drive.photos.readonly', + + // View the files in your Google Drive + 'https://www.googleapis.com/auth/drive.readonly', + + // Modify your Google Apps Script scripts' behavior + 'https://www.googleapis.com/auth/drive.scripts', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Drive API resources: + +```typescript + +/* +Gets information about the user, the user's Drive, and system capabilities. +*/ +await gapi.client.about.get({ }); + +/* +Gets the starting pageToken for listing future changes. +*/ +await gapi.client.changes.getStartPageToken({ }); + +/* +Lists the changes for a user or Team Drive. +*/ +await gapi.client.changes.list({ pageToken: "pageToken", }); + +/* +Subscribes to changes for a user. +*/ +await gapi.client.changes.watch({ pageToken: "pageToken", }); + +/* +Stop watching resources through this channel +*/ +await gapi.client.channels.stop({ }); + +/* +Creates a new comment on a file. +*/ +await gapi.client.comments.create({ fileId: "fileId", }); + +/* +Deletes a comment. +*/ +await gapi.client.comments.delete({ commentId: "commentId", fileId: "fileId", }); + +/* +Gets a comment by ID. +*/ +await gapi.client.comments.get({ commentId: "commentId", fileId: "fileId", }); + +/* +Lists a file's comments. +*/ +await gapi.client.comments.list({ fileId: "fileId", }); + +/* +Updates a comment with patch semantics. +*/ +await gapi.client.comments.update({ commentId: "commentId", fileId: "fileId", }); + +/* +Creates a copy of a file and applies any requested updates with patch semantics. +*/ +await gapi.client.files.copy({ fileId: "fileId", }); + +/* +Creates a new file. +*/ +await gapi.client.files.create({ }); + +/* +Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. +*/ +await gapi.client.files.delete({ fileId: "fileId", }); + +/* +Permanently deletes all of the user's trashed files. +*/ +await gapi.client.files.emptyTrash({ }); + +/* +Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. +*/ +await gapi.client.files.export({ fileId: "fileId", mimeType: "mimeType", }); + +/* +Generates a set of file IDs which can be provided in create requests. +*/ +await gapi.client.files.generateIds({ }); + +/* +Gets a file's metadata or content by ID. +*/ +await gapi.client.files.get({ fileId: "fileId", }); + +/* +Lists or searches files. +*/ +await gapi.client.files.list({ }); + +/* +Updates a file's metadata and/or content with patch semantics. +*/ +await gapi.client.files.update({ fileId: "fileId", }); + +/* +Subscribes to changes to a file +*/ +await gapi.client.files.watch({ fileId: "fileId", }); + +/* +Creates a permission for a file or Team Drive. +*/ +await gapi.client.permissions.create({ fileId: "fileId", }); + +/* +Deletes a permission. +*/ +await gapi.client.permissions.delete({ fileId: "fileId", permissionId: "permissionId", }); + +/* +Gets a permission by ID. +*/ +await gapi.client.permissions.get({ fileId: "fileId", permissionId: "permissionId", }); + +/* +Lists a file's or Team Drive's permissions. +*/ +await gapi.client.permissions.list({ fileId: "fileId", }); + +/* +Updates a permission with patch semantics. +*/ +await gapi.client.permissions.update({ fileId: "fileId", permissionId: "permissionId", }); + +/* +Creates a new reply to a comment. +*/ +await gapi.client.replies.create({ commentId: "commentId", fileId: "fileId", }); + +/* +Deletes a reply. +*/ +await gapi.client.replies.delete({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); + +/* +Gets a reply by ID. +*/ +await gapi.client.replies.get({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); + +/* +Lists a comment's replies. +*/ +await gapi.client.replies.list({ commentId: "commentId", fileId: "fileId", }); + +/* +Updates a reply with patch semantics. +*/ +await gapi.client.replies.update({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); + +/* +Permanently deletes a revision. This method is only applicable to files with binary content in Drive. +*/ +await gapi.client.revisions.delete({ fileId: "fileId", revisionId: "revisionId", }); + +/* +Gets a revision's metadata or content by ID. +*/ +await gapi.client.revisions.get({ fileId: "fileId", revisionId: "revisionId", }); + +/* +Lists a file's revisions. +*/ +await gapi.client.revisions.list({ fileId: "fileId", }); + +/* +Updates a revision with patch semantics. +*/ +await gapi.client.revisions.update({ fileId: "fileId", revisionId: "revisionId", }); + +/* +Creates a new Team Drive. +*/ +await gapi.client.teamdrives.create({ requestId: "requestId", }); + +/* +Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. +*/ +await gapi.client.teamdrives.delete({ teamDriveId: "teamDriveId", }); + +/* +Gets a Team Drive's metadata by ID. +*/ +await gapi.client.teamdrives.get({ teamDriveId: "teamDriveId", }); + +/* +Lists the user's Team Drives. +*/ +await gapi.client.teamdrives.list({ }); + +/* +Updates a Team Drive's metadata +*/ +await gapi.client.teamdrives.update({ teamDriveId: "teamDriveId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.drive/tsconfig.json b/types/gapi.client.drive/tsconfig.json new file mode 100644 index 0000000000..6d5901b410 --- /dev/null +++ b/types/gapi.client.drive/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.drive-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.drive/tslint.json b/types/gapi.client.drive/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.drive/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firebasedynamiclinks/gapi.client.firebasedynamiclinks-tests.ts b/types/gapi.client.firebasedynamiclinks/gapi.client.firebasedynamiclinks-tests.ts new file mode 100644 index 0000000000..4ef78ca6ba --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/gapi.client.firebasedynamiclinks-tests.ts @@ -0,0 +1,57 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firebasedynamiclinks', 'v1', () => { + /** now we can use gapi.client.firebasedynamiclinks */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and administer all your Firebase data and settings */ + 'https://www.googleapis.com/auth/firebase', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Creates a short Dynamic Link given either a valid long Dynamic Link or + * details such as Dynamic Link domain, Android and iOS app information. + * The created short Dynamic Link will not expire. + * + * Repeated calls with the same long Dynamic Link or Dynamic Link information + * will produce the same short Dynamic Link. + * + * The Dynamic Link domain in the request must be owned by requester's + * Firebase project. + */ + await gapi.client.shortLinks.create({ + }); + /** + * Fetches analytics stats of a short Dynamic Link for a given + * duration. Metrics include number of clicks, redirects, installs, + * app first opens, and app reopens. + */ + await gapi.client.v1.getLinkStats({ + durationDays: "durationDays", + dynamicLink: "dynamicLink", + }); + /** Get iOS strong/weak-match info for post-install attribution. */ + await gapi.client.v1.installAttribution({ + }); + } +}); diff --git a/types/gapi.client.firebasedynamiclinks/index.d.ts b/types/gapi.client.firebasedynamiclinks/index.d.ts new file mode 100644 index 0000000000..618a8845a6 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/index.d.ts @@ -0,0 +1,430 @@ +// Type definitions for Google Firebase Dynamic Links API v1 1.0 +// Project: https://firebase.google.com/docs/dynamic-links/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firebasedynamiclinks.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Firebase Dynamic Links API v1 */ + function load(name: "firebasedynamiclinks", version: "v1"): PromiseLike; + function load(name: "firebasedynamiclinks", version: "v1", callback: () => any): void; + + const shortLinks: firebasedynamiclinks.ShortLinksResource; + + const v1: firebasedynamiclinks.V1Resource; + + namespace firebasedynamiclinks { + interface AnalyticsInfo { + /** Google Play Campaign Measurements. */ + googlePlayAnalytics?: GooglePlayAnalytics; + /** iTunes Connect App Analytics. */ + itunesConnectAnalytics?: ITunesConnectAnalytics; + } + interface AndroidInfo { + /** Link to open on Android if the app is not installed. */ + androidFallbackLink?: string; + /** If specified, this overrides the â€link’ parameter on Android. */ + androidLink?: string; + /** + * Minimum version code for the Android app. If the installed app’s version + * code is lower, then the user is taken to the Play Store. + */ + androidMinPackageVersionCode?: string; + /** Android package name of the app. */ + androidPackageName?: string; + } + interface CreateShortDynamicLinkRequest { + /** + * Information about the Dynamic Link to be shortened. + * [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + */ + dynamicLinkInfo?: DynamicLinkInfo; + /** + * Full long Dynamic Link URL with desired query parameters specified. + * For example, + * "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", + * [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + */ + longDynamicLink?: string; + /** Short Dynamic Link suffix. Optional. */ + suffix?: Suffix; + } + interface CreateShortDynamicLinkResponse { + /** Preivew link to show the link flow chart. */ + previewLink?: string; + /** Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz */ + shortLink?: string; + /** Information about potential warnings on link creation. */ + warning?: DynamicLinkWarning[]; + } + interface DeviceInfo { + /** Device model name. */ + deviceModelName?: string; + /** Device language code setting. */ + languageCode?: string; + /** Device display resolution height. */ + screenResolutionHeight?: string; + /** Device display resolution width. */ + screenResolutionWidth?: string; + /** Device timezone setting. */ + timezone?: string; + } + interface DynamicLinkEventStat { + /** The number of times this event occurred. */ + count?: string; + /** Link event. */ + event?: string; + /** Requested platform. */ + platform?: string; + } + interface DynamicLinkInfo { + /** + * Parameters used for tracking. See all tracking parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + analyticsInfo?: AnalyticsInfo; + /** + * Android related information. See Android related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + androidInfo?: AndroidInfo; + /** + * Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl + * [Learn more](https://firebase.google.com/docs/dynamic-links/android/receive) + * on how to set up Dynamic Link domain associated with your Firebase project. + * + * Required. + */ + dynamicLinkDomain?: string; + /** + * iOS related information. See iOS related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + iosInfo?: IosInfo; + /** + * The link your app will open, You can specify any URL your app can handle. + * This link must be a well-formatted URL, be properly URL-encoded, and use + * the HTTP or HTTPS scheme. See 'link' parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + * + * Required. + */ + link?: string; + /** Information of navigation behavior of a Firebase Dynamic Links. */ + navigationInfo?: NavigationInfo; + /** + * Parameters for social meta tag params. + * Used to set meta tag data for link previews on social sites. + */ + socialMetaTagInfo?: SocialMetaTagInfo; + } + interface DynamicLinkStats { + /** Dynamic Link event stats. */ + linkEventStats?: DynamicLinkEventStat[]; + } + interface DynamicLinkWarning { + /** The warning code. */ + warningCode?: string; + /** The document describing the warning, and helps resolve. */ + warningDocumentLink?: string; + /** The warning message to help developers improve their requests. */ + warningMessage?: string; + } + interface GetIosPostInstallAttributionRequest { + /** + * App installation epoch time (https://en.wikipedia.org/wiki/Unix_time). + * This is a client signal for a more accurate weak match. + */ + appInstallationTime?: string; + /** APP bundle ID. */ + bundleId?: string; + /** Device information. */ + device?: DeviceInfo; + /** + * iOS version, ie: 9.3.5. + * Consider adding "build". + */ + iosVersion?: string; + /** + * App post install attribution retrieval information. Disambiguates + * mechanism (iSDK or developer invoked) to retrieve payload from + * clicked link. + */ + retrievalMethod?: string; + /** Google SDK version. */ + sdkVersion?: string; + /** + * Possible unique matched link that server need to check before performing + * fingerprint match. If passed link is short server need to expand the link. + * If link is long server need to vslidate the link. + */ + uniqueMatchLinkToCheck?: string; + /** + * Strong match page information. Disambiguates between default UI and + * custom page to present when strong match succeeds/fails to find cookie. + */ + visualStyle?: string; + } + interface GetIosPostInstallAttributionResponse { + /** + * The minimum version for app, specified by dev through ?imv= parameter. + * Return to iSDK to allow app to evaluate if current version meets this. + */ + appMinimumVersion?: string; + /** The confidence of the returned attribution. */ + attributionConfidence?: string; + /** + * The deep-link attributed post-install via one of several techniques + * (fingerprint, copy unique). + */ + deepLink?: string; + /** + * User-agent specific custom-scheme URIs for iSDK to open. This will be set + * according to the user-agent tha the click was originally made in. There is + * no Safari-equivalent custom-scheme open URLs. + * ie: googlechrome://www.example.com + * ie: firefox://open-url?url=http://www.example.com + * ie: opera-http://example.com + */ + externalBrowserDestinationLink?: string; + /** + * The link to navigate to update the app if min version is not met. + * This is either (in order): 1) fallback link (from ?ifl= parameter, if + * specified by developer) or 2) AppStore URL (from ?isi= parameter, if + * specified), or 3) the payload link (from required link= parameter). + */ + fallbackLink?: string; + /** + * Invitation ID attributed post-install via one of several techniques + * (fingerprint, copy unique). + */ + invitationId?: string; + /** + * Instruction for iSDK to attemmpt to perform strong match. For instance, + * if browser does not support/allow cookie or outside of support browsers, + * this will be false. + */ + isStrongMatchExecutable?: boolean; + /** + * Describes why match failed, ie: "discarded due to low confidence". + * This message will be publicly visible. + */ + matchMessage?: string; + /** + * Entire FDL (short or long) attributed post-install via one of several + * techniques (fingerprint, copy unique). + */ + requestedLink?: string; + /** + * The entire FDL, expanded from a short link. It is the same as the + * requested_link, if it is long. Parameters from this should not be + * used directly (ie: server can default utm_[campaign|medium|source] + * to a value when requested_link lack them, server determine the best + * fallback_link when requested_link specifies >1 fallback links). + */ + resolvedLink?: string; + /** Scion campaign value to be propagated by iSDK to Scion at post-install. */ + utmCampaign?: string; + /** Scion medium value to be propagated by iSDK to Scion at post-install. */ + utmMedium?: string; + /** Scion source value to be propagated by iSDK to Scion at post-install. */ + utmSource?: string; + } + interface GooglePlayAnalytics { + /** + * [AdWords autotagging parameter](https://support.google.com/analytics/answer/1033981?hl=en); + * used to measure Google AdWords ads. This value is generated dynamically + * and should never be modified. + */ + gclid?: string; + /** + * Campaign name; used for keyword analysis to identify a specific product + * promotion or strategic campaign. + */ + utmCampaign?: string; + /** + * Campaign content; used for A/B testing and content-targeted ads to + * differentiate ads or links that point to the same URL. + */ + utmContent?: string; + /** Campaign medium; used to identify a medium such as email or cost-per-click. */ + utmMedium?: string; + /** + * Campaign source; used to identify a search engine, newsletter, or other + * source. + */ + utmSource?: string; + /** Campaign term; used with paid search to supply the keywords for ads. */ + utmTerm?: string; + } + interface ITunesConnectAnalytics { + /** Affiliate token used to create affiliate-coded links. */ + at?: string; + /** + * Campaign text that developers can optionally add to any link in order to + * track sales from a specific marketing campaign. + */ + ct?: string; + /** iTune media types, including music, podcasts, audiobooks and so on. */ + mt?: string; + /** + * Provider token that enables analytics for Dynamic Links from within iTunes + * Connect. + */ + pt?: string; + } + interface IosInfo { + /** iOS App Store ID. */ + iosAppStoreId?: string; + /** iOS bundle ID of the app. */ + iosBundleId?: string; + /** + * Custom (destination) scheme to use for iOS. By default, we’ll use the + * bundle ID as the custom scheme. Developer can override this behavior using + * this param. + */ + iosCustomScheme?: string; + /** Link to open on iOS if the app is not installed. */ + iosFallbackLink?: string; + /** iPad bundle ID of the app. */ + iosIpadBundleId?: string; + /** If specified, this overrides the ios_fallback_link value on iPads. */ + iosIpadFallbackLink?: string; + } + interface NavigationInfo { + /** + * If this option is on, FDL click will be forced to redirect rather than + * show an interstitial page. + */ + enableForcedRedirect?: boolean; + } + interface SocialMetaTagInfo { + /** A short description of the link. Optional. */ + socialDescription?: string; + /** An image url string. Optional. */ + socialImageLink?: string; + /** Title to be displayed. Optional. */ + socialTitle?: string; + } + interface Suffix { + /** Suffix option. */ + option?: string; + } + interface ShortLinksResource { + /** + * Creates a short Dynamic Link given either a valid long Dynamic Link or + * details such as Dynamic Link domain, Android and iOS app information. + * The created short Dynamic Link will not expire. + * + * Repeated calls with the same long Dynamic Link or Dynamic Link information + * will produce the same short Dynamic Link. + * + * The Dynamic Link domain in the request must be owned by requester's + * Firebase project. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface V1Resource { + /** + * Fetches analytics stats of a short Dynamic Link for a given + * duration. Metrics include number of clicks, redirects, installs, + * app first opens, and app reopens. + */ + getLinkStats(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The span of time requested in days. */ + durationDays?: string; + /** Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz */ + dynamicLink: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get iOS strong/weak-match info for post-install attribution. */ + installAttribution(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.firebasedynamiclinks/readme.md b/types/gapi.client.firebasedynamiclinks/readme.md new file mode 100644 index 0000000000..ec49c972a7 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/readme.md @@ -0,0 +1,79 @@ +# TypeScript typings for Firebase Dynamic Links API v1 +Programmatically creates and manages Firebase Dynamic Links. +For detailed description please check [documentation](https://firebase.google.com/docs/dynamic-links/). + +## Installing + +Install typings for Firebase Dynamic Links API: +``` +npm install @types/gapi.client.firebasedynamiclinks@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firebasedynamiclinks', 'v1', () => { + // now we can use gapi.client.firebasedynamiclinks + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and administer all your Firebase data and settings + 'https://www.googleapis.com/auth/firebase', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Firebase Dynamic Links API resources: + +```typescript + +/* +Creates a short Dynamic Link given either a valid long Dynamic Link or +details such as Dynamic Link domain, Android and iOS app information. +The created short Dynamic Link will not expire. + +Repeated calls with the same long Dynamic Link or Dynamic Link information +will produce the same short Dynamic Link. + +The Dynamic Link domain in the request must be owned by requester's +Firebase project. +*/ +await gapi.client.shortLinks.create({ }); + +/* +Fetches analytics stats of a short Dynamic Link for a given +duration. Metrics include number of clicks, redirects, installs, +app first opens, and app reopens. +*/ +await gapi.client.v1.getLinkStats({ dynamicLink: "dynamicLink", }); + +/* +Get iOS strong/weak-match info for post-install attribution. +*/ +await gapi.client.v1.installAttribution({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.firebasedynamiclinks/tsconfig.json b/types/gapi.client.firebasedynamiclinks/tsconfig.json new file mode 100644 index 0000000000..e43d9944a4 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firebasedynamiclinks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firebasedynamiclinks/tslint.json b/types/gapi.client.firebasedynamiclinks/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firebaseremoteconfig/gapi.client.firebaseremoteconfig-tests.ts b/types/gapi.client.firebaseremoteconfig/gapi.client.firebaseremoteconfig-tests.ts new file mode 100644 index 0000000000..60c5cec59c --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/gapi.client.firebaseremoteconfig-tests.ts @@ -0,0 +1,48 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firebaseremoteconfig', 'v1', () => { + /** now we can use gapi.client.firebaseremoteconfig */ + + run(); + }); + + async function run() { + /** + * Get the latest version Remote Configuration for a project. + * Returns the RemoteConfig as the payload, and also the eTag as a + * response header. + */ + await gapi.client.projects.getRemoteConfig({ + project: "project", + }); + /** + * Update a RemoteConfig. We treat this as an always-existing + * resource (when it is not found in our data store, we treat it as version + * 0, a template with zero conditions and zero parameters). Hence there are + * no Create or Delete operations. Returns the updated template when + * successful (and the updated eTag as a response header), or an error if + * things go wrong. + * Possible error messages: + * * VALIDATION_ERROR (HTTP status 400) with additional details if the + * template being passed in can not be validated. + * * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be + * authenticate (e.g. no access token, or invalid access token). + * * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be + * authorized (e.g. the user has no access to the specified project id). + * * VERSION_MISMATCH (HTTP status 412) when trying to update when the + * expected eTag (passed in via the "If-match" header) is not specified, or + * is specified but does does not match the current eTag. + * * Internal error (HTTP status 500) for Database problems or other internal + * errors. + */ + await gapi.client.projects.updateRemoteConfig({ + project: "project", + validateOnly: true, + }); + } +}); diff --git a/types/gapi.client.firebaseremoteconfig/index.d.ts b/types/gapi.client.firebaseremoteconfig/index.d.ts new file mode 100644 index 0000000000..22c96e59c8 --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/index.d.ts @@ -0,0 +1,197 @@ +// Type definitions for Google Firebase Remote Config API v1 1.0 +// Project: https://firebase.google.com/docs/remote-config/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firebaseremoteconfig.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Firebase Remote Config API v1 */ + function load(name: "firebaseremoteconfig", version: "v1"): PromiseLike; + function load(name: "firebaseremoteconfig", version: "v1", callback: () => any): void; + + const projects: firebaseremoteconfig.ProjectsResource; + + namespace firebaseremoteconfig { + interface RemoteConfig { + /** + * The list of named conditions. The order *does* affect the semantics. + * The condition_name values of these entries must be unique. + * + * The resolved value of a config parameter P is determined as follow: + * * Let Y be the set of values from the submap of P that refer to conditions + * that evaluate to true. + * * If Y is non empty, the value is taken from the specific submap in Y whose + * condition_name is the earliest in this condition list. + * * Else, if P has a default value option (condition_name is empty) then + * the value is taken from that option. + * * Else, parameter P has no value and is omitted from the config result. + * + * Example: parameter key "p1", default value "v1", submap specified as + * {"c1": v2, "c2": v3} where "c1" and "c2" are names of conditions in the + * condition list (where "c1" in this example appears before "c2"). The + * value of p1 would be v2 as long as c1 is true. Otherwise, if c2 is true, + * p1 would evaluate to v3, and if c1 and c2 are both false, p1 would evaluate + * to v1. If no default value was specified, and c1 and c2 were both false, + * no value for p1 would be generated. + */ + conditions?: RemoteConfigCondition[]; + /** + * Map of parameter keys to their optional default values and optional submap + * of (condition name : value). Order doesn't affect semantics, and so is + * sorted by the server. The 'key' values of the params must be unique. + */ + parameters?: Record; + } + interface RemoteConfigCondition { + /** Required. */ + expression?: string; + /** + * Required. + * A non empty and unique name of this condition. + */ + name?: string; + /** + * Optional. + * The display (tag) color of this condition. This serves as part of a tag + * (in the future, we may add tag text as well as tag color, but that is not + * yet implemented in the UI). + * This value has no affect on the semantics of the delivered config and it + * is ignored by the backend, except for passing it through write/read + * requests. + * Not having this value or having the "CONDITION_DISPLAY_COLOR_UNSPECIFIED" + * value (0) have the same meaning: Let the UI choose any valid color when + * displaying the condition. + */ + tagColor?: string; + } + interface RemoteConfigParameter { + /** + * Optional - a map of (condition_name, value). The condition_name of the + * highest priority (the one listed first in the conditions array) determines + * the value of this parameter. + */ + conditionalValues?: Record; + /** + * Optional - value to set the parameter to, when none of the named conditions + * evaluate to true. + */ + defaultValue?: RemoteConfigParameterValue; + } + interface RemoteConfigParameterValue { + /** if true, omit the parameter from the map of fetched parameter values */ + useInAppDefault?: boolean; + /** the string to set the parameter to */ + value?: string; + } + interface ProjectsResource { + /** + * Get the latest version Remote Configuration for a project. + * Returns the RemoteConfig as the payload, and also the eTag as a + * response header. + */ + getRemoteConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The GMP project identifier. Required. + * See note at the beginning of this file regarding project ids. + */ + project: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Update a RemoteConfig. We treat this as an always-existing + * resource (when it is not found in our data store, we treat it as version + * 0, a template with zero conditions and zero parameters). Hence there are + * no Create or Delete operations. Returns the updated template when + * successful (and the updated eTag as a response header), or an error if + * things go wrong. + * Possible error messages: + * * VALIDATION_ERROR (HTTP status 400) with additional details if the + * template being passed in can not be validated. + * * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be + * authenticate (e.g. no access token, or invalid access token). + * * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be + * authorized (e.g. the user has no access to the specified project id). + * * VERSION_MISMATCH (HTTP status 412) when trying to update when the + * expected eTag (passed in via the "If-match" header) is not specified, or + * is specified but does does not match the current eTag. + * * Internal error (HTTP status 500) for Database problems or other internal + * errors. + */ + updateRemoteConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The GMP project identifier. Required. + * See note at the beginning of this file regarding project ids. + */ + project: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Optional. Defaults to false (UpdateRemoteConfig call should + * update the backend if there are no validation/interal errors). May be set + * to true to indicate that, should no validation errors occur, + * the call should return a "200 OK" instead of performing the update. Note + * that other error messages (500 Internal Error, 412 Version Mismatch, etc) + * may still result after flipping to false, even if getting a + * "200 OK" when calling with true. + */ + validateOnly?: boolean; + }): Request; + } + } +} diff --git a/types/gapi.client.firebaseremoteconfig/readme.md b/types/gapi.client.firebaseremoteconfig/readme.md new file mode 100644 index 0000000000..eb99d22d5f --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/readme.md @@ -0,0 +1,64 @@ +# TypeScript typings for Firebase Remote Config API v1 +Firebase Remote Config API allows the 3P clients to manage Remote Config conditions and parameters for Firebase applications. +For detailed description please check [documentation](https://firebase.google.com/docs/remote-config/). + +## Installing + +Install typings for Firebase Remote Config API: +``` +npm install @types/gapi.client.firebaseremoteconfig@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firebaseremoteconfig', 'v1', () => { + // now we can use gapi.client.firebaseremoteconfig + // ... +}); +``` + + + +After that you can use Firebase Remote Config API resources: + +```typescript + +/* +Get the latest version Remote Configuration for a project. +Returns the RemoteConfig as the payload, and also the eTag as a +response header. +*/ +await gapi.client.projects.getRemoteConfig({ project: "project", }); + +/* +Update a RemoteConfig. We treat this as an always-existing +resource (when it is not found in our data store, we treat it as version +0, a template with zero conditions and zero parameters). Hence there are +no Create or Delete operations. Returns the updated template when +successful (and the updated eTag as a response header), or an error if +things go wrong. +Possible error messages: +* VALIDATION_ERROR (HTTP status 400) with additional details if the +template being passed in can not be validated. +* AUTHENTICATION_ERROR (HTTP status 401) if the request can not be +authenticate (e.g. no access token, or invalid access token). +* AUTHORIZATION_ERROR (HTTP status 403) if the request can not be +authorized (e.g. the user has no access to the specified project id). +* VERSION_MISMATCH (HTTP status 412) when trying to update when the +expected eTag (passed in via the "If-match" header) is not specified, or +is specified but does does not match the current eTag. +* Internal error (HTTP status 500) for Database problems or other internal +errors. +*/ +await gapi.client.projects.updateRemoteConfig({ project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.firebaseremoteconfig/tsconfig.json b/types/gapi.client.firebaseremoteconfig/tsconfig.json new file mode 100644 index 0000000000..9366ffa276 --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firebaseremoteconfig-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firebaseremoteconfig/tslint.json b/types/gapi.client.firebaseremoteconfig/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firebaserules/gapi.client.firebaserules-tests.ts b/types/gapi.client.firebaserules/gapi.client.firebaserules-tests.ts new file mode 100644 index 0000000000..28ca08a8d8 --- /dev/null +++ b/types/gapi.client.firebaserules/gapi.client.firebaserules-tests.ts @@ -0,0 +1,63 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firebaserules', 'v1', () => { + /** now we can use gapi.client.firebaserules */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and administer all your Firebase data and settings */ + 'https://www.googleapis.com/auth/firebase', + /** View all your Firebase data and settings */ + 'https://www.googleapis.com/auth/firebase.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Test `Source` for syntactic and semantic correctness. Issues present, if + * any, will be returned to the caller with a description, severity, and + * source location. + * + * The test method may be executed with `Source` or a `Ruleset` name. + * Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` + * name is useful for regression testing an existing rule. + * + * The following is an example of `Source` that permits users to upload images + * to a bucket bearing their user id and matching the correct metadata: + * + * _*Example*_ + * + * // Users are allowed to subscribe and unsubscribe to the blog. + * service firebase.storage { + * match /users/{userId}/images/{imageName} { + * allow write: if userId == request.auth.uid + * && (imageName.matches('*.png$') + * || imageName.matches('*.jpg$')) + * && resource.mimeType.matches('^image/') + * } + * } + */ + await gapi.client.projects.test({ + name: "name", + }); + } +}); diff --git a/types/gapi.client.firebaserules/index.d.ts b/types/gapi.client.firebaserules/index.d.ts new file mode 100644 index 0000000000..fbe2fb4da7 --- /dev/null +++ b/types/gapi.client.firebaserules/index.d.ts @@ -0,0 +1,828 @@ +// Type definitions for Google Firebase Rules API v1 1.0 +// Project: https://firebase.google.com/docs/storage/security +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firebaserules.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Firebase Rules API v1 */ + function load(name: "firebaserules", version: "v1"): PromiseLike; + function load(name: "firebaserules", version: "v1", callback: () => any): void; + + const projects: firebaserules.ProjectsResource; + + namespace firebaserules { + interface Arg { + /** Argument matches any value provided. */ + anyValue?: any; + /** Argument exactly matches value provided. */ + exactValue?: any; + } + interface File { + /** Textual Content. */ + content?: string; + /** Fingerprint (e.g. github sha) associated with the `File`. */ + fingerprint?: string; + /** File name. */ + name?: string; + } + interface FunctionCall { + /** The arguments that were provided to the function. */ + args?: any[]; + /** Name of the function invoked. */ + function?: string; + } + interface FunctionMock { + /** + * The list of `Arg` values to match. The order in which the arguments are + * provided is the order in which they must appear in the function + * invocation. + */ + args?: Arg[]; + /** + * The name of the function. + * + * The function name must match one provided by a service declaration. + */ + function?: string; + /** The mock result of the function call. */ + result?: Result; + } + interface GetReleaseExecutableResponse { + /** Executable view of the `Ruleset` referenced by the `Release`. */ + executable?: string; + /** The Rules runtime version of the executable. */ + executableVersion?: string; + /** `Language` used to generate the executable bytes. */ + language?: string; + /** `Ruleset` name associated with the `Release` executable. */ + rulesetName?: string; + /** Timestamp for the most recent `Release.update_time`. */ + updateTime?: string; + } + interface Issue { + /** Short error description. */ + description?: string; + /** The severity of the issue. */ + severity?: string; + /** Position of the issue in the `Source`. */ + sourcePosition?: SourcePosition; + } + interface ListReleasesResponse { + /** + * The pagination token to retrieve the next page of results. If the value is + * empty, no further results remain. + */ + nextPageToken?: string; + /** List of `Release` instances. */ + releases?: Release[]; + } + interface ListRulesetsResponse { + /** + * The pagination token to retrieve the next page of results. If the value is + * empty, no further results remain. + */ + nextPageToken?: string; + /** List of `Ruleset` instances. */ + rulesets?: Ruleset[]; + } + interface Release { + /** + * Time the release was created. + * Output only. + */ + createTime?: string; + /** + * Resource name for the `Release`. + * + * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` + * which affords developers a great deal of flexibility in mapping the name + * to the style that best fits their existing development practices. For + * example, a name could refer to an environment, an app, a version, or some + * combination of three. + * + * In the table below, for the project name `projects/foo`, the following + * relative release paths show how flat and structured names might be chosen + * to match a desired development / deployment strategy. + * + * Use Case | Flat Name | Structured Name + * -------------|---------------------|---------------- + * Environments | releases/qa | releases/qa + * Apps | releases/app1_qa | releases/app1/qa + * Versions | releases/app1_v2_qa | releases/app1/v2/qa + * + * The delimiter between the release name path elements can be almost anything + * and it should work equally well with the release name list filter, but in + * many ways the structured paths provide a clearer picture of the + * relationship between `Release` instances. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name?: string; + /** + * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must + * exist the `Release` to be created. + */ + rulesetName?: string; + /** + * Time the release was updated. + * Output only. + */ + updateTime?: string; + } + interface Result { + /** The result is undefined, meaning the result could not be computed. */ + undefined?: any; + /** + * The result is an actual value. The type of the value must match that + * of the type declared by the service. + */ + value?: any; + } + interface Ruleset { + /** + * Time the `Ruleset` was created. + * Output only. + */ + createTime?: string; + /** + * Name of the `Ruleset`. The ruleset_id is auto generated by the service. + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + * Output only. + */ + name?: string; + /** `Source` for the `Ruleset`. */ + source?: Source; + } + interface Source { + /** `File` set constituting the `Source` bundle. */ + files?: File[]; + } + interface SourcePosition { + /** First column on the source line associated with the source fragment. */ + column?: number; + /** Name of the `File`. */ + fileName?: string; + /** Line number of the source fragment. 1-based. */ + line?: number; + } + interface TestCase { + /** Test expectation. */ + expectation?: string; + /** + * Optional function mocks for service-defined functions. If not set, any + * service defined function is expected to return an error, which may or may + * not influence the test outcome. + */ + functionMocks?: FunctionMock[]; + /** + * Request context. + * + * The exact format of the request context is service-dependent. See the + * appropriate service documentation for information about the supported + * fields and types on the request. Minimally, all services support the + * following fields and types: + * + * Request field | Type + * ---------------|----------------- + * auth.uid | `string` + * auth.token | `map` + * headers | `map` + * method | `string` + * params | `map` + * path | `string` + * time | `google.protobuf.Timestamp` + * + * If the request value is not well-formed for the service, the request will + * be rejected as an invalid argument. + */ + request?: any; + /** + * Optional resource value as it appears in persistent storage before the + * request is fulfilled. + * + * The resource type depends on the `request.path` value. + */ + resource?: any; + } + interface TestResult { + /** + * Debug messages related to test execution issues encountered during + * evaluation. + * + * Debug messages may be related to too many or too few invocations of + * function mocks or to runtime errors that occur during evaluation. + * + * For example: ```Unable to read variable [name: "resource"]``` + */ + debugMessages?: string[]; + /** + * Position in the `Source` or `Ruleset` where the principle runtime error + * occurs. + * + * Evaluation of an expression may result in an error. Rules are deny by + * default, so a `DENY` expectation when an error is generated is valid. + * When there is a `DENY` with an error, the `SourcePosition` is returned. + * + * E.g. `error_position { line: 19 column: 37 }` + */ + errorPosition?: SourcePosition; + /** + * The set of function calls made to service-defined methods. + * + * Function calls are included in the order in which they are encountered + * during evaluation, are provided for both mocked and unmocked functions, + * and included on the response regardless of the test `state`. + */ + functionCalls?: FunctionCall[]; + /** State of the test. */ + state?: string; + } + interface TestRulesetRequest { + /** + * Optional `Source` to be checked for correctness. + * + * This field must not be set when the resource name refers to a `Ruleset`. + */ + source?: Source; + /** Inline `TestSuite` to run. */ + testSuite?: TestSuite; + } + interface TestRulesetResponse { + /** + * Syntactic and semantic `Source` issues of varying severity. Issues of + * `ERROR` severity will prevent tests from executing. + */ + issues?: Issue[]; + /** + * The set of test results given the test cases in the `TestSuite`. + * The results will appear in the same order as the test cases appear in the + * `TestSuite`. + */ + testResults?: TestResult[]; + } + interface TestSuite { + /** Collection of test cases associated with the `TestSuite`. */ + testCases?: TestCase[]; + } + interface ReleasesResource { + /** + * Create a `Release`. + * + * Release names should reflect the developer's deployment practices. For + * example, the release name may include the environment name, application + * name, application version, or any other name meaningful to the developer. + * Once a `Release` refers to a `Ruleset`, the rules can be enforced by + * Firebase Rules-enabled services. + * + * More than one `Release` may be 'live' concurrently. Consider the following + * three `Release` names for `projects/foo` and the `Ruleset` to which they + * refer. + * + * Release Name | Ruleset Name + * --------------------------------|------------- + * projects/foo/releases/prod | projects/foo/rulesets/uuid123 + * projects/foo/releases/prod/beta | projects/foo/rulesets/uuid123 + * projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 + * + * The table reflects the `Ruleset` rollout in progress. The `prod` and + * `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23` + * refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be + * updated using the UpdateRelease method. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the project which owns this `Release`. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Delete a `Release` by resource name. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the `Release` to delete. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Get a `Release` by name. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name of the `Release`. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get the `Release` executable to use when enforcing rules. */ + getExecutable(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The requested runtime executable version. + * Defaults to FIREBASE_RULES_EXECUTABLE_V1 + */ + executableVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name of the `Release`. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * List the `Release` values for a project. This list may optionally be + * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any + * combination thereof. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * `Release` filter. The list method supports filters with restrictions on the + * `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. + * + * Example 1: A filter of 'name=prod*' might return `Release`s with names + * within 'projects/foo' prefixed with 'prod': + * + * Name | Ruleset Name + * ------------------------------|------------- + * projects/foo/releases/prod | projects/foo/rulesets/uuid1234 + * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 + * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 + * + * Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only + * `Release` instances for 'projects/foo' with names prefixed with 'prod' + * referring to the same `Ruleset` name of 'uuid1234': + * + * Name | Ruleset Name + * ------------------------------|------------- + * projects/foo/releases/prod | projects/foo/rulesets/1234 + * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 + * + * In the examples, the filter parameters refer to the search filters are + * relative to the project. Fully qualified prefixed may also be used. e.g. + * `test_suite_name=projects/foo/testsuites/uuid1` + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the project. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Page size to load. Maximum of 100. Defaults to 10. + * Note: `page_size` is just a hint and the service may choose to load fewer + * than `page_size` results due to the size of the output. To traverse all of + * the releases, the caller should iterate until the `page_token` on the + * response is empty. + */ + pageSize?: number; + /** Next page token for the next batch of `Release` instances. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Update a `Release`. + * + * Only updates to the `ruleset_name` and `test_suite_name` fields will be + * honored. `Release` rename is not supported. To create a `Release` use the + * CreateRelease method. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the `Release`. + * + * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` + * which affords developers a great deal of flexibility in mapping the name + * to the style that best fits their existing development practices. For + * example, a name could refer to an environment, an app, a version, or some + * combination of three. + * + * In the table below, for the project name `projects/foo`, the following + * relative release paths show how flat and structured names might be chosen + * to match a desired development / deployment strategy. + * + * Use Case | Flat Name | Structured Name + * -------------|---------------------|---------------- + * Environments | releases/qa | releases/qa + * Apps | releases/app1_qa | releases/app1/qa + * Versions | releases/app1_v2_qa | releases/app1/v2/qa + * + * The delimiter between the release name path elements can be almost anything + * and it should work equally well with the release name list filter, but in + * many ways the structured paths provide a clearer picture of the + * relationship between `Release` instances. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RulesetsResource { + /** + * Create a `Ruleset` from `Source`. + * + * The `Ruleset` is given a unique generated name which is returned to the + * caller. `Source` containing syntactic or semantics errors will result in an + * error response indicating the first error encountered. For a detailed view + * of `Source` issues, use TestRuleset. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for Project which owns this `Ruleset`. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Delete a `Ruleset` by resource name. + * + * If the `Ruleset` is referenced by a `Release` the operation will fail. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the ruleset to delete. + * + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Get a `Ruleset` by name including the full `Source` contents. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the ruleset to get. + * + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * List `Ruleset` metadata only and optionally filter the results by `Ruleset` + * name. + * + * The full `Source` contents of a `Ruleset` may be retrieved with + * GetRuleset. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * `Ruleset` filter. The list method supports filters with restrictions on + * `Ruleset.name`. + * + * Filters on `Ruleset.create_time` should use the `date` function which + * parses strings that conform to the RFC 3339 date/time specifications. + * + * Example: `create_time > date("2017-01-01") AND name=UUID-*` + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the project. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Page size to load. Maximum of 100. Defaults to 10. + * Note: `page_size` is just a hint and the service may choose to load less + * than `page_size` due to the size of the output. To traverse all of the + * releases, caller should iterate until the `page_token` is empty. + */ + pageSize?: number; + /** Next page token for loading the next batch of `Ruleset` instances. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** + * Test `Source` for syntactic and semantic correctness. Issues present, if + * any, will be returned to the caller with a description, severity, and + * source location. + * + * The test method may be executed with `Source` or a `Ruleset` name. + * Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` + * name is useful for regression testing an existing rule. + * + * The following is an example of `Source` that permits users to upload images + * to a bucket bearing their user id and matching the correct metadata: + * + * _*Example*_ + * + * // Users are allowed to subscribe and unsubscribe to the blog. + * service firebase.storage { + * match /users/{userId}/images/{imageName} { + * allow write: if userId == request.auth.uid + * && (imageName.matches('*.png$') + * || imageName.matches('*.jpg$')) + * && resource.mimeType.matches('^image/') + * } + * } + */ + test(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Tests may either provide `source` or a `Ruleset` resource name. + * + * For tests against `source`, the resource name must refer to the project: + * Format: `projects/{project_id}` + * + * For tests against a `Ruleset`, this must be the `Ruleset` resource name: + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + releases: ReleasesResource; + rulesets: RulesetsResource; + } + } +} diff --git a/types/gapi.client.firebaserules/readme.md b/types/gapi.client.firebaserules/readme.md new file mode 100644 index 0000000000..992701be26 --- /dev/null +++ b/types/gapi.client.firebaserules/readme.md @@ -0,0 +1,87 @@ +# TypeScript typings for Firebase Rules API v1 +Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request. + +For detailed description please check [documentation](https://firebase.google.com/docs/storage/security). + +## Installing + +Install typings for Firebase Rules API: +``` +npm install @types/gapi.client.firebaserules@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firebaserules', 'v1', () => { + // now we can use gapi.client.firebaserules + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and administer all your Firebase data and settings + 'https://www.googleapis.com/auth/firebase', + + // View all your Firebase data and settings + 'https://www.googleapis.com/auth/firebase.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Firebase Rules API resources: + +```typescript + +/* +Test `Source` for syntactic and semantic correctness. Issues present, if +any, will be returned to the caller with a description, severity, and +source location. + +The test method may be executed with `Source` or a `Ruleset` name. +Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` +name is useful for regression testing an existing rule. + +The following is an example of `Source` that permits users to upload images +to a bucket bearing their user id and matching the correct metadata: + +_*Example*_ + + // Users are allowed to subscribe and unsubscribe to the blog. + service firebase.storage { + match /users/{userId}/images/{imageName} { + allow write: if userId == request.auth.uid + && (imageName.matches('*.png$') + || imageName.matches('*.jpg$')) + && resource.mimeType.matches('^image/') + } + } +*/ +await gapi.client.projects.test({ name: "name", }); +``` \ No newline at end of file diff --git a/types/gapi.client.firebaserules/tsconfig.json b/types/gapi.client.firebaserules/tsconfig.json new file mode 100644 index 0000000000..fe476614b8 --- /dev/null +++ b/types/gapi.client.firebaserules/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firebaserules-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firebaserules/tslint.json b/types/gapi.client.firebaserules/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firebaserules/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firestore/gapi.client.firestore-tests.ts b/types/gapi.client.firestore/gapi.client.firestore-tests.ts new file mode 100644 index 0000000000..45c7838019 --- /dev/null +++ b/types/gapi.client.firestore/gapi.client.firestore-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firestore', 'v1beta1', () => { + /** now we can use gapi.client.firestore */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Cloud Datastore data */ + 'https://www.googleapis.com/auth/datastore', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.firestore/index.d.ts b/types/gapi.client.firestore/index.d.ts new file mode 100644 index 0000000000..783434a8c7 --- /dev/null +++ b/types/gapi.client.firestore/index.d.ts @@ -0,0 +1,1579 @@ +// Type definitions for Google Google Cloud Firestore API v1beta1 1.0 +// Project: https://cloud.google.com/firestore +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firestore.googleapis.com/$discovery/rest?version=v1beta1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Firestore API v1beta1 */ + function load(name: "firestore", version: "v1beta1"): PromiseLike; + function load(name: "firestore", version: "v1beta1", callback: () => any): void; + + const projects: firestore.ProjectsResource; + + namespace firestore { + interface ArrayValue { + /** Values in the array. */ + values?: Value[]; + } + interface BatchGetDocumentsRequest { + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + */ + documents?: string[]; + /** + * The fields to return. If not set, returns all fields. + * + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + */ + mask?: DocumentMask; + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + */ + newTransaction?: TransactionOptions; + /** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** Reads documents in a transaction. */ + transaction?: string; + } + interface BatchGetDocumentsResponse { + /** A document that was requested. */ + found?: Document; + /** + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + missing?: string; + /** + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + */ + readTime?: string; + /** + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * BatchGetDocumentsRequest.new_transaction was set in the request. + */ + transaction?: string; + } + interface BeginTransactionRequest { + /** + * The options for the transaction. + * Defaults to a read-write transaction. + */ + options?: TransactionOptions; + } + interface BeginTransactionResponse { + /** The transaction that was started. */ + transaction?: string; + } + interface CollectionSelector { + /** + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + */ + allDescendants?: boolean; + /** + * The collection ID. + * When set, selects only collections with this ID. + */ + collectionId?: string; + } + interface CommitRequest { + /** + * If non-empty, applies all writes in this transaction, and commits it. + * Otherwise, applies the writes as if they were in their own transaction. + */ + transaction?: string; + /** + * The writes to apply. + * + * Always executed atomically and in order. + */ + writes?: Write[]; + } + interface CommitResponse { + /** The time at which the commit occurred. */ + commitTime?: string; + /** + * The result of applying the writes. + * + * This i-th write result corresponds to the i-th write in the + * request. + */ + writeResults?: WriteResult[]; + } + interface CompositeFilter { + /** + * The list of filters to combine. + * Must contain at least one filter. + */ + filters?: Filter[]; + /** The operator for combining multiple filters. */ + op?: string; + } + interface Cursor { + /** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + */ + before?: boolean; + /** + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * + * Can contain fewer values than specified in the order by clause. + */ + values?: Value[]; + } + interface Document { + /** + * Output only. The time at which the document was created. + * + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + */ + createTime?: string; + /** + * The document's fields. + * + * The map keys represent field names. + * + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `foo_bar_17`. + * + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The map + * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by the simple + * or quoted field names of the containing fields, delimited by `.`. For + * example, the structured field + * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be + * represented by the field path `foo.x&y`. + * + * Within a field path, a quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\`tik` `` represents `` bak`tik ``. + */ + fields?: Record; + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name?: string; + /** + * Output only. The time at which the document was last changed. + * + * This value is initally set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + */ + updateTime?: string; + } + interface DocumentChange { + /** + * The new state of the Document. + * + * If `mask` is set, contains only fields that were updated or added. + */ + document?: Document; + /** A set of target IDs for targets that no longer match this document. */ + removedTargetIds?: number[]; + /** A set of target IDs of targets that match this document. */ + targetIds?: number[]; + } + interface DocumentDelete { + /** The resource name of the Document that was deleted. */ + document?: string; + /** + * The read timestamp at which the delete was observed. + * + * Greater or equal to the `commit_time` of the delete. + */ + readTime?: string; + /** A set of target IDs for targets that previously matched this entity. */ + removedTargetIds?: number[]; + } + interface DocumentMask { + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + fieldPaths?: string[]; + } + interface DocumentRemove { + /** The resource name of the Document that has gone out of view. */ + document?: string; + /** + * The read timestamp at which the remove was observed. + * + * Greater or equal to the `commit_time` of the change/delete/remove. + */ + readTime?: string; + /** A set of target IDs for targets that previously matched this document. */ + removedTargetIds?: number[]; + } + interface DocumentTransform { + /** The name of the document to transform. */ + document?: string; + /** + * The list of transformations to apply to the fields of the document, in + * order. + */ + fieldTransforms?: FieldTransform[]; + } + interface DocumentsTarget { + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + */ + documents?: string[]; + } + interface ExistenceFilter { + /** + * The total count of documents that match target_id. + * + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + */ + count?: number; + /** The target ID to which this filter applies. */ + targetId?: number; + } + interface FieldFilter { + /** The field to filter by. */ + field?: FieldReference; + /** The operator to filter by. */ + op?: string; + /** The value to compare to. */ + value?: Value; + } + interface FieldReference { + fieldPath?: string; + } + interface FieldTransform { + /** + * The path of the field. See Document.fields for the field path syntax + * reference. + */ + fieldPath?: string; + /** Sets the field to the given server value. */ + setToServerValue?: string; + } + interface Filter { + /** A composite filter. */ + compositeFilter?: CompositeFilter; + /** A filter on a document field. */ + fieldFilter?: FieldFilter; + /** A filter that takes exactly one argument. */ + unaryFilter?: UnaryFilter; + } + interface Index { + /** The collection ID to which this index applies. Required. */ + collectionId?: string; + /** The fields to index. */ + fields?: IndexField[]; + /** The resource name of the index. */ + name?: string; + /** + * The state of the index. + * The state is read-only. + * @OutputOnly + */ + state?: string; + } + interface IndexField { + /** + * The path of the field. Must match the field path specification described + * by google.firestore.v1beta1.Document.fields. + * Special field path `__name__` may be used by itself or at the end of a + * path. `__type__` may be used only at the end of path. + */ + fieldPath?: string; + /** The field's mode. */ + mode?: string; + } + interface IndexOperationMetadata { + /** + * True if the [google.longrunning.Operation] was cancelled. If the + * cancellation is in progress, cancelled will be true but + * google.longrunning.Operation.done will be false. + */ + cancelled?: boolean; + /** Progress of the existing operation, measured in number of documents. */ + documentProgress?: Progress; + /** + * The time the operation ended, either successfully or otherwise. Unset if + * the operation is still active. + */ + endTime?: string; + /** + * The index resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + */ + index?: string; + /** The type of index operation. */ + operationType?: string; + /** The time that work began on the operation. */ + startTime?: string; + } + interface LatLng { + /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ + latitude?: number; + /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ + longitude?: number; + } + interface ListCollectionIdsResponse { + /** The collection ids. */ + collectionIds?: string[]; + /** A page token that may be used to continue the list. */ + nextPageToken?: string; + } + interface ListDocumentsResponse { + /** The Documents found. */ + documents?: Document[]; + /** The next page token. */ + nextPageToken?: string; + } + interface ListIndexesResponse { + /** The indexes. */ + indexes?: Index[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListenRequest { + /** A target to add to this stream. */ + addTarget?: Target; + /** Labels associated with this target change. */ + labels?: Record; + /** The ID of a target to remove from this stream. */ + removeTarget?: number; + } + interface ListenResponse { + /** A Document has changed. */ + documentChange?: DocumentChange; + /** A Document has been deleted. */ + documentDelete?: DocumentDelete; + /** + * A Document has been removed from a target (because it is no longer + * relevant to that target). + */ + documentRemove?: DocumentRemove; + /** + * A filter to apply to the set of documents previously returned for the + * given target. + * + * Returned when documents may have been removed from the given target, but + * the exact documents are unknown. + */ + filter?: ExistenceFilter; + /** Targets have changed. */ + targetChange?: TargetChange; + } + interface MapValue { + /** + * The map's fields. + * + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + */ + fields?: Record; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface Order { + /** The direction to order by. Defaults to `ASCENDING`. */ + direction?: string; + /** The field to order by. */ + field?: FieldReference; + } + interface Precondition { + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + */ + exists?: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + updateTime?: string; + } + interface Progress { + /** + * An estimate of how much work has been completed. Note that this may be + * greater than `work_estimated`. + */ + workCompleted?: string; + /** + * An estimate of how much work needs to be performed. Zero if the + * work estimate is unavailable. May change as work progresses. + */ + workEstimated?: string; + } + interface Projection { + /** + * The fields to return. + * + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + */ + fields?: FieldReference[]; + } + interface QueryTarget { + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent?: string; + /** A structured query. */ + structuredQuery?: StructuredQuery; + } + interface ReadOnly { + /** + * Reads documents at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + } + interface ReadWrite { + /** An optional transaction to retry. */ + retryTransaction?: string; + } + interface RollbackRequest { + /** The transaction to roll back. */ + transaction?: string; + } + interface RunQueryRequest { + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + */ + newTransaction?: TransactionOptions; + /** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** A structured query. */ + structuredQuery?: StructuredQuery; + /** Reads documents in a transaction. */ + transaction?: string; + } + interface RunQueryResponse { + /** + * A query result. + * Not set when reporting partial progress. + */ + document?: Document; + /** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + */ + readTime?: string; + /** + * The number of results that have been skipped due to an offset between + * the last response and the current response. + */ + skippedResults?: number; + /** + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * RunQueryRequest.new_transaction was set in the request. + * If set, no other fields will be set in this response. + */ + transaction?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface StructuredQuery { + /** A end point for the query results. */ + endAt?: Cursor; + /** The collections to query. */ + from?: CollectionSelector[]; + /** + * The maximum number of results to return. + * + * Applies after all other constraints. + * Must be >= 0 if specified. + */ + limit?: number; + /** + * The number of results to skip. + * + * Applies before limit, but after all other constraints. Must be >= 0 if + * specified. + */ + offset?: number; + /** + * The order to apply to the query results. + * + * Firestore guarantees a stable ordering through the following rules: + * + * * Any field required to appear in `order_by`, that is not already + * specified in `order_by`, is appended to the order in field name order + * by default. + * * If an order on `__name__` is not specified, it is appended by default. + * + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * + * * `SELECT * FROM Foo ORDER BY A` becomes + * `SELECT * FROM Foo ORDER BY A, __name__` + * * `SELECT * FROM Foo ORDER BY A DESC` becomes + * `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` + * * `SELECT * FROM Foo WHERE A > 1` becomes + * `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + */ + orderBy?: Order[]; + /** The projection to return. */ + select?: Projection; + /** A starting point for the query results. */ + startAt?: Cursor; + /** The filter to apply. */ + where?: Filter; + } + interface Target { + /** A target specified by a set of document names. */ + documents?: DocumentsTarget; + /** If the target should be removed once it is current and consistent. */ + once?: boolean; + /** A target specified by a query. */ + query?: QueryTarget; + /** + * Start listening after a specific `read_time`. + * + * The client must know the state of matching documents at this time. + */ + readTime?: string; + /** + * A resume token from a prior TargetChange for an identical target. + * + * Using a resume token with a different target is unsupported and may fail. + */ + resumeToken?: string; + /** + * A client provided target ID. + * + * If not set, the server will assign an ID for the target. + * + * Used for resuming a target without changing IDs. The IDs can either be + * client-assigned or be server-assigned in a previous stream. All targets + * with client provided IDs must be added before adding a target that needs + * a server-assigned id. + */ + targetId?: number; + } + interface TargetChange { + /** The error that resulted in this change, if applicable. */ + cause?: Status; + /** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + */ + readTime?: string; + /** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * + * Not set on every target change. + */ + resumeToken?: string; + /** The type of change that occurred. */ + targetChangeType?: string; + /** + * The target IDs of targets that have changed. + * + * If empty, the change applies to all targets. + * + * For `target_change_type=ADD`, the order of the target IDs matches the order + * of the requests to add the targets. This allows clients to unambiguously + * associate server-assigned target IDs with added targets. + * + * For other states, the order of the target IDs is not defined. + */ + targetIds?: number[]; + } + interface TransactionOptions { + /** The transaction can only be used for read operations. */ + readOnly?: ReadOnly; + /** The transaction can be used for both read and write operations. */ + readWrite?: ReadWrite; + } + interface UnaryFilter { + /** The field to which to apply the operator. */ + field?: FieldReference; + /** The unary operator to apply. */ + op?: string; + } + interface Value { + /** + * An array value. + * + * Cannot contain another array value. + */ + arrayValue?: ArrayValue; + /** A boolean value. */ + booleanValue?: boolean; + /** + * A bytes value. + * + * Must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes are considered by queries. + */ + bytesValue?: string; + /** A double value. */ + doubleValue?: number; + /** A geo point value representing a point on the surface of Earth. */ + geoPointValue?: LatLng; + /** An integer value. */ + integerValue?: string; + /** A map value. */ + mapValue?: MapValue; + /** A null value. */ + nullValue?: string; + /** + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + referenceValue?: string; + /** + * A string value. + * + * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes of the UTF-8 representation are considered by + * queries. + */ + stringValue?: string; + /** + * A timestamp value. + * + * Precise only to microseconds. When stored, any additional precision is + * rounded down. + */ + timestampValue?: string; + } + interface Write { + /** + * An optional precondition on the document. + * + * The write will fail if this is set and not met by the target document. + */ + currentDocument?: Precondition; + /** + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + delete?: string; + /** + * Applies a tranformation to a document. + * At most one `transform` per document is allowed in a given request. + * An `update` cannot follow a `transform` on the same document in a given + * request. + */ + transform?: DocumentTransform; + /** A document to write. */ + update?: Document; + /** + * The fields to update in this write. + * + * This field can be set only when the operation is `update`. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + */ + updateMask?: DocumentMask; + } + interface WriteRequest { + /** Labels associated with this write request. */ + labels?: Record; + /** + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + */ + streamId?: string; + /** + * A stream token that was previously sent by the server. + * + * The client should set this field to the token from the most recent + * WriteResponse it has received. This acknowledges that the client has + * received responses up to this token. After sending this token, earlier + * tokens may not be used anymore. + * + * The server may close the stream if there are too many unacknowledged + * responses. + * + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * + * Leave this field unset when creating a new stream. + */ + streamToken?: string; + /** + * The writes to apply. + * + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + */ + writes?: Write[]; + } + interface WriteResponse { + /** The time at which the commit occurred. */ + commitTime?: string; + /** + * The ID of the stream. + * Only set on the first message, when a new stream was created. + */ + streamId?: string; + /** + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * + * This field is always set. + */ + streamToken?: string; + /** + * The result of applying the writes. + * + * This i-th write result corresponds to the i-th write in the + * request. + */ + writeResults?: WriteResult[]; + } + interface WriteResult { + /** + * The results of applying each DocumentTransform.FieldTransform, in the + * same order. + */ + transformResults?: Value[]; + /** + * The last update time of the document after applying the write. Not set + * after a `delete`. + * + * If the write did not actually change the document, this will be the + * previous update_time. + */ + updateTime?: string; + } + interface DocumentsResource { + /** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + */ + batchGet(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Starts a new transaction. */ + beginTransaction(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Commits a transaction, while optionally updating documents. */ + commit(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Creates a new document. */ + createDocument(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The collection ID, relative to `parent`, to list. For example: `chatrooms`. */ + collectionId: string; + /** + * The client-assigned document ID to use for this document. + * + * Optional. If not specified, an ID will be assigned by the service. + */ + documentId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a document. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + */ + "currentDocument.exists"?: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + "currentDocument.updateTime"?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a single document. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** + * The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Reads the version of the document at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** Reads the document in a transaction. */ + transaction?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists documents. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The collection ID, relative to `parent`, to list. For example: `chatrooms` + * or `messages`. + */ + collectionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The order to sort results by. For example: `priority desc, name`. */ + orderBy?: string; + /** The maximum number of documents to return. */ + pageSize?: number; + /** The `next_page_token` value returned from a previous List request, if any. */ + pageToken?: string; + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** + * If the list should show missing documents. A missing document is a + * document that does not exist but has sub-documents. These documents will + * be returned with a key but will not have fields, Document.create_time, + * or Document.update_time set. + * + * Requests with `show_missing` may not specify `where` or + * `order_by`. + */ + showMissing?: boolean; + /** Reads documents in a transaction. */ + transaction?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the collection IDs underneath a document. */ + listCollectionIds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of results to return. */ + pageSize?: number; + /** + * A page token. Must be a value from + * ListCollectionIdsResponse. + */ + pageToken?: string; + /** + * The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Listens to changes. */ + listen(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates or inserts a document. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + */ + "currentDocument.exists"?: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + "currentDocument.updateTime"?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "updateMask.fieldPaths"?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Rolls back a transaction. */ + rollback(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Runs a query. */ + runQuery(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Streams batches of document updates and deletes, in order. */ + write(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface IndexesResource { + /** + * Creates the specified index. + * A newly created index's initial state is `CREATING`. On completion of the + * returned google.longrunning.Operation, the state will be `READY`. + * If the index already exists, the call will return an `ALREADY_EXISTS` + * status. + * + * During creation, the process could result in an error, in which case the + * index will move to the `ERROR` state. The process can be recovered by + * fixing the data that caused the error, removing the index with + * delete, then re-creating the index with + * create. + * + * Indexes with a single field cannot be created. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The name of the database this index will apply to. For example: + * `projects/{project_id}/databases/{database_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes an index. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The index name. For example: + * `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets an index. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the index. For example: + * `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists the indexes that match the specified filters. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard List page size. */ + pageSize?: number; + /** The standard List page token. */ + pageToken?: string; + /** + * The database name. For example: + * `projects/{project_id}/databases/{database_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DatabasesResource { + documents: DocumentsResource; + indexes: IndexesResource; + } + interface ProjectsResource { + databases: DatabasesResource; + } + } +} diff --git a/types/gapi.client.firestore/readme.md b/types/gapi.client.firestore/readme.md new file mode 100644 index 0000000000..8609bf31fb --- /dev/null +++ b/types/gapi.client.firestore/readme.md @@ -0,0 +1,57 @@ +# TypeScript typings for Google Cloud Firestore API v1beta1 + +For detailed description please check [documentation](https://cloud.google.com/firestore). + +## Installing + +Install typings for Google Cloud Firestore API: +``` +npm install @types/gapi.client.firestore@v1beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firestore', 'v1beta1', () => { + // now we can use gapi.client.firestore + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Cloud Datastore data + 'https://www.googleapis.com/auth/datastore', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Firestore API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.firestore/tsconfig.json b/types/gapi.client.firestore/tsconfig.json new file mode 100644 index 0000000000..c15195612c --- /dev/null +++ b/types/gapi.client.firestore/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firestore-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firestore/tslint.json b/types/gapi.client.firestore/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firestore/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.fitness/gapi.client.fitness-tests.ts b/types/gapi.client.fitness/gapi.client.fitness-tests.ts new file mode 100644 index 0000000000..81bcf6a5bf --- /dev/null +++ b/types/gapi.client.fitness/gapi.client.fitness-tests.ts @@ -0,0 +1,66 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('fitness', 'v1', () => { + /** now we can use gapi.client.fitness */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View your activity information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.activity.read', + /** View and store your activity information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.activity.write', + /** View blood glucose data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + /** View and store blood glucose data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + /** View blood pressure data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + /** View and store blood pressure data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + /** View body sensor information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body.read', + /** View and store body sensor data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body.write', + /** View body temperature data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body_temperature.read', + /** View and store body temperature data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body_temperature.write', + /** View your stored location data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.location.read', + /** View and store your location data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.location.write', + /** View nutrition information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.nutrition.read', + /** View and store nutrition information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.nutrition.write', + /** View oxygen saturation data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + /** View and store oxygen saturation data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + /** View reproductive health data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + /** View and store reproductive health data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.fitness/index.d.ts b/types/gapi.client.fitness/index.d.ts new file mode 100644 index 0000000000..a5b2f034d5 --- /dev/null +++ b/types/gapi.client.fitness/index.d.ts @@ -0,0 +1,767 @@ +// Type definitions for Google Fitness v1 1.0 +// Project: https://developers.google.com/fit/rest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/fitness/v1/rest + +/// + +declare namespace gapi.client { + /** Load Fitness v1 */ + function load(name: "fitness", version: "v1"): PromiseLike; + function load(name: "fitness", version: "v1", callback: () => any): void; + + const users: fitness.UsersResource; + + namespace fitness { + interface AggregateBucket { + /** Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT */ + activity?: number; + /** There will be one dataset per AggregateBy in the request. */ + dataset?: Dataset[]; + /** The end time for the aggregated data, in milliseconds since epoch, inclusive. */ + endTimeMillis?: string; + /** Available for Bucket.Type.SESSION */ + session?: Session; + /** The start time for the aggregated data, in milliseconds since epoch, inclusive. */ + startTimeMillis?: string; + /** The type of a bucket signifies how the data aggregation is performed in the bucket. */ + type?: string; + } + interface AggregateBy { + /** + * A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified data source ID will be included in the aggregation. The + * dataset in the response will have the same data source ID. + */ + dataSourceId?: string; + /** + * The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single + * dataset for this data type name. The dataset will have a data source ID of derived:com.google.:com.google.android.gms:aggregated + */ + dataTypeName?: string; + } + interface AggregateRequest { + /** + * The specification of data to be aggregated. At least one aggregateBy spec must be provided. All data that is specified will be aggregated using the + * same bucketing criteria. There will be one dataset in the response for every aggregateBy spec. + */ + aggregateBy?: AggregateBy[]; + /** + * Specifies that data be aggregated each activity segment recored for a user. Similar to bucketByActivitySegment, but bucketing is done for each activity + * segment rather than all segments of the same type. Mutually exclusive of other bucketing specifications. + */ + bucketByActivitySegment?: BucketByActivity; + /** + * Specifies that data be aggregated by the type of activity being performed when the data was recorded. All data that was recorded during a certain + * activity type (for the given time range) will be aggregated into the same bucket. Data that was recorded while the user was not active will not be + * included in the response. Mutually exclusive of other bucketing specifications. + */ + bucketByActivityType?: BucketByActivity; + /** + * Specifies that data be aggregated by user sessions. Data that does not fall within the time range of a session will not be included in the response. + * Mutually exclusive of other bucketing specifications. + */ + bucketBySession?: BucketBySession; + /** Specifies that data be aggregated by a single time interval. Mutually exclusive of other bucketing specifications. */ + bucketByTime?: BucketByTime; + /** The end of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive. */ + endTimeMillis?: string; + /** + * A list of acceptable data quality standards. Only data points which conform to at least one of the specified data quality standards will be returned. + * If the list is empty, all data points are returned. + */ + filteredDataQualityStandard?: string[]; + /** The start of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive. */ + startTimeMillis?: string; + } + interface AggregateResponse { + /** A list of buckets containing the aggregated data. */ + bucket?: AggregateBucket[]; + } + interface Application { + /** An optional URI that can be used to link back to the application. */ + detailsUrl?: string; + /** + * The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of + * convenience for other developers who would like to identify which REST created an Application or Data Source. + */ + name?: string; + /** + * Package name for this application. This is used as a unique identifier when created by Android applications, but cannot be specified by REST clients. + * REST clients will have their developer project number reflected into the Data Source data stream IDs, instead of the packageName. + */ + packageName?: string; + /** Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. */ + version?: string; + } + interface BucketByActivity { + /** The default activity stream will be used if a specific activityDataSourceId is not specified. */ + activityDataSourceId?: string; + /** Specifies that only activity segments of duration longer than minDurationMillis are considered and used as a container for aggregated data. */ + minDurationMillis?: string; + } + interface BucketBySession { + /** Specifies that only sessions of duration longer than minDurationMillis are considered and used as a container for aggregated data. */ + minDurationMillis?: string; + } + interface BucketByTime { + /** + * Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames that contain no data will be included in the response + * with an empty dataset. + */ + durationMillis?: string; + period?: BucketByTimePeriod; + } + interface BucketByTimePeriod { + /** org.joda.timezone.DateTimeZone */ + timeZoneId?: string; + type?: string; + value?: number; + } + interface DataPoint { + /** Used for version checking during transformation; that is, a datapoint can only replace another datapoint that has an older computation time stamp. */ + computationTimeMillis?: string; + /** The data type defining the format of the values in this data point. */ + dataTypeName?: string; + /** The end time of the interval represented by this data point, in nanoseconds since epoch. */ + endTimeNanos?: string; + /** + * Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the + * current state of the data. + */ + modifiedTimeMillis?: string; + /** + * If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the + * data point originally. + */ + originDataSourceId?: string; + /** The raw timestamp from the original SensorEvent. */ + rawTimestampNanos?: string; + /** The start time of the interval represented by this data point, in nanoseconds since epoch. */ + startTimeNanos?: string; + /** + * Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that + * the field is listed with in the data type specified in a data source. + * + * Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field. + */ + value?: Value[]; + } + interface DataSource { + /** Information about an application which feeds sensor data into the platform. */ + application?: Application; + dataQualityStandard?: string[]; + /** + * A unique identifier for the data stream produced by this data source. The identifier includes: + * + * + * - The physical device's manufacturer, model, and serial number (UID). + * - The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number + * is used when the data source was created by a REST client. + * - The data source's type. + * - The data source's stream name. Note that not all attributes of the data source are used as part of the stream identifier. In particular, the version + * of the hardware/the application isn't used. This allows us to preserve the same stream through version updates. This also means that two DataSource + * objects may represent the same data stream even if they're not equal. + * + * The exact format of the data stream ID created by an Android application is: + * type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName + * + * The exact format of the data stream ID created by a REST client is: type:dataType.name:developer project + * number:device.manufacturer:device.model:device.uid:dataStreamName + * + * When any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minimum viable data + * stream ID would be: type:dataType.name:developer project number + * + * Finally, the developer project number is obfuscated when read by any REST or Android client that did not create the data source. Only the data source + * creator will see the developer project number in clear and normal form. + */ + dataStreamId?: string; + /** + * The stream name uniquely identifies this particular data source among other data sources of the same type from the same underlying producer. Setting + * the stream name is optional, but should be done whenever an application exposes two streams for the same data type, or when a device has two equivalent + * sensors. + */ + dataStreamName?: string; + /** The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. */ + dataType?: DataType; + /** Representation of an integrated device (such as a phone or a wearable) that can hold sensors. */ + device?: Device; + /** An end-user visible name for this data source. */ + name?: string; + /** A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. */ + type?: string; + } + interface DataType { + /** A field represents one dimension of a data type. */ + field?: DataTypeField[]; + /** Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. */ + name?: string; + } + interface DataTypeField { + /** The different supported formats for each field in a data type. */ + format?: string; + /** Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. */ + name?: string; + optional?: boolean; + } + interface Dataset { + /** The data stream ID of the data source that created the points in this dataset. */ + dataSourceId?: string; + /** + * The largest end time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also + * match the first part of the dataset identifier. + */ + maxEndTimeNs?: string; + /** + * The smallest start time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also + * match the first part of the dataset identifier. + */ + minStartTimeNs?: string; + /** + * This token will be set when a dataset is received in response to a GET request and the dataset is too large to be included in a single response. + * Provide this value in a subsequent GET request to return the next page of data points within this dataset. + */ + nextPageToken?: string; + /** + * A partial list of data points contained in the dataset, ordered by largest endTimeNanos first. This list is considered complete when retrieving a small + * dataset and partial when patching a dataset or retrieving a dataset that is too large to include in a single response. + */ + point?: DataPoint[]; + } + interface Device { + /** Manufacturer of the product/hardware. */ + manufacturer?: string; + /** End-user visible model name for the device. */ + model?: string; + /** A constant representing the type of the device. */ + type?: string; + /** + * The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data + * source. Only the data source creator will see the uid field in clear and normal form. + */ + uid?: string; + /** Version string for the device hardware/software. */ + version?: string; + } + interface ListDataPointChangesResponse { + /** The data stream ID of the data source with data point changes. */ + dataSourceId?: string; + /** Deleted data points for the user. Note, for modifications this should be parsed before handling insertions. */ + deletedDataPoint?: DataPoint[]; + /** Inserted data points for the user. */ + insertedDataPoint?: DataPoint[]; + /** The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. */ + nextPageToken?: string; + } + interface ListDataSourcesResponse { + /** A previously created data source. */ + dataSource?: DataSource[]; + } + interface ListSessionsResponse { + /** + * If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and + * endTime frame. + */ + deletedSession?: Session[]; + /** Flag to indicate server has more data to transfer */ + hasMoreData?: boolean; + /** The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. */ + nextPageToken?: string; + /** Sessions with an end time that is between startTime and endTime of the request. */ + session?: Session[]; + } + interface MapValue { + /** Floating point value. */ + fpVal?: number; + } + interface Session { + /** + * Session active time. While start_time_millis and end_time_millis define the full session time, the active time can be shorter and specified by + * active_time_millis. If the inactive time during the session is known, it should also be inserted via a com.google.activity.segment data point with a + * STILL activity value + */ + activeTimeMillis?: string; + /** The type of activity this session represents. */ + activityType?: number; + /** The application that created the session. */ + application?: Application; + /** A description for this session. */ + description?: string; + /** An end time, in milliseconds since epoch, inclusive. */ + endTimeMillis?: string; + /** A client-generated identifier that is unique across all sessions owned by this particular user. */ + id?: string; + /** A timestamp that indicates when the session was last modified. */ + modifiedTimeMillis?: string; + /** A human readable name of the session. */ + name?: string; + /** A start time, in milliseconds since epoch, inclusive. */ + startTimeMillis?: string; + } + interface Value { + /** Floating point value. When this is set, other values must not be set. */ + fpVal?: number; + /** Integer value. When this is set, other values must not be set. */ + intVal?: number; + /** + * Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys + * should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled. + */ + mapVal?: ValueMapValEntry[]; + /** + * String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and + * high data frequency may be down sampled. + */ + stringVal?: string; + } + interface ValueMapValEntry { + key?: string; + value?: MapValue; + } + interface DataPointChangesResource { + /** Queries for user's data point changes for a particular data source. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** If specified, no more than this many data point changes will be included in the response. */ + limit?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The continuation token, which is 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. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DatasetsResource { + /** + * Performs an inclusive delete of all data points whose start and end times have any overlap with the time range specified by the dataset ID. For most + * data types, the entire data point will be deleted. For data types where the time span represents a consistent value (such as + * com.google.activity.segment), and a data point straddles either end point of the dataset, only the overlapping portion of the data point will be + * deleted. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The client's current time in milliseconds since epoch. */ + currentTimeMillis?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** + * Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. + * The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** When the operation was performed on the client. */ + modifiedTimeMillis?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns a dataset containing all data points whose start and end times overlap with the specified range of the dataset minimum start time and maximum + * end time. Specifically, any data point whose start time is less than or equal to the dataset end time and whose end time is greater than or equal to + * the dataset start time. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** + * Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. + * The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * If specified, no more than this many data points will be included in the dataset. If there are more data points in the dataset, nextPageToken will be + * set in the dataset response. + */ + limit?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of + * nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller + * than those in the previous partial response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Adds data points to a dataset. The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to + * retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds + * instead of milliseconds. + */ + currentTimeMillis?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** + * Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. + * The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DataSourcesResource { + /** + * Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated + * by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source + * fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer + * project number is obfuscated when read by any other developer reading public data types. + */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified data source. The request will fail if the data source contains any data points. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to delete. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified data source. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to retrieve. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists all data sources that are visible to the developer, using the OAuth scopes provided. The list is not exhaustive; the user may have private data + * sources that are only visible to other developers, or calls using other scopes. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The names of data types to include in the list. If not specified, all data sources will be returned. */ + dataTypeName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be + * modified. + * + * Data sources are identified by their dataStreamId. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to update. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be + * modified. + * + * Data sources are identified by their dataStreamId. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to update. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + dataPointChanges: DataPointChangesResource; + datasets: DatasetsResource; + } + interface DatasetResource { + /** + * Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple + * sources can be aggreated into exactly one bucket type per request. + */ + aggregate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SessionsResource { + /** Deletes a session specified by the given session ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The client's current time in milliseconds since epoch. */ + currentTimeMillis?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the session to be deleted. */ + sessionId: string; + /** Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists sessions previously created. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other + * fields. + */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The continuation token, which is 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. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. */ + startTime?: string; + /** List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates or insert a given session. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The client's current time in milliseconds since epoch. */ + currentTimeMillis?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the session to be created. */ + sessionId: string; + /** Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UsersResource { + dataSources: DataSourcesResource; + dataset: DatasetResource; + sessions: SessionsResource; + } + } +} diff --git a/types/gapi.client.fitness/readme.md b/types/gapi.client.fitness/readme.md new file mode 100644 index 0000000000..e8dee74aba --- /dev/null +++ b/types/gapi.client.fitness/readme.md @@ -0,0 +1,105 @@ +# TypeScript typings for Fitness v1 +Stores and accesses user data in the fitness store from apps on any platform. +For detailed description please check [documentation](https://developers.google.com/fit/rest/). + +## Installing + +Install typings for Fitness: +``` +npm install @types/gapi.client.fitness@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('fitness', 'v1', () => { + // now we can use gapi.client.fitness + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View your activity information in Google Fit + 'https://www.googleapis.com/auth/fitness.activity.read', + + // View and store your activity information in Google Fit + 'https://www.googleapis.com/auth/fitness.activity.write', + + // View blood glucose data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + + // View and store blood glucose data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + + // View blood pressure data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + + // View and store blood pressure data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + + // View body sensor information in Google Fit + 'https://www.googleapis.com/auth/fitness.body.read', + + // View and store body sensor data in Google Fit + 'https://www.googleapis.com/auth/fitness.body.write', + + // View body temperature data in Google Fit + 'https://www.googleapis.com/auth/fitness.body_temperature.read', + + // View and store body temperature data in Google Fit + 'https://www.googleapis.com/auth/fitness.body_temperature.write', + + // View your stored location data in Google Fit + 'https://www.googleapis.com/auth/fitness.location.read', + + // View and store your location data in Google Fit + 'https://www.googleapis.com/auth/fitness.location.write', + + // View nutrition information in Google Fit + 'https://www.googleapis.com/auth/fitness.nutrition.read', + + // View and store nutrition information in Google Fit + 'https://www.googleapis.com/auth/fitness.nutrition.write', + + // View oxygen saturation data in Google Fit + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + + // View and store oxygen saturation data in Google Fit + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + + // View reproductive health data in Google Fit + 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + + // View and store reproductive health data in Google Fit + 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Fitness resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.fitness/tsconfig.json b/types/gapi.client.fitness/tsconfig.json new file mode 100644 index 0000000000..d165e53085 --- /dev/null +++ b/types/gapi.client.fitness/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.fitness-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.fitness/tslint.json b/types/gapi.client.fitness/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.fitness/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.fusiontables/gapi.client.fusiontables-tests.ts b/types/gapi.client.fusiontables/gapi.client.fusiontables-tests.ts new file mode 100644 index 0000000000..3ce93fc7f1 --- /dev/null +++ b/types/gapi.client.fusiontables/gapi.client.fusiontables-tests.ts @@ -0,0 +1,225 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('fusiontables', 'v2', () => { + /** now we can use gapi.client.fusiontables */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Fusion Tables */ + 'https://www.googleapis.com/auth/fusiontables', + /** View your Fusion Tables */ + 'https://www.googleapis.com/auth/fusiontables.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes the specified column. */ + await gapi.client.column.delete({ + columnId: "columnId", + tableId: "tableId", + }); + /** Retrieves a specific column by its ID. */ + await gapi.client.column.get({ + columnId: "columnId", + tableId: "tableId", + }); + /** Adds a new column to the table. */ + await gapi.client.column.insert({ + tableId: "tableId", + }); + /** Retrieves a list of columns. */ + await gapi.client.column.list({ + maxResults: 1, + pageToken: "pageToken", + tableId: "tableId", + }); + /** Updates the name or type of an existing column. This method supports patch semantics. */ + await gapi.client.column.patch({ + columnId: "columnId", + tableId: "tableId", + }); + /** Updates the name or type of an existing column. */ + await gapi.client.column.update({ + columnId: "columnId", + tableId: "tableId", + }); + /** + * Executes a Fusion Tables SQL statement, which can be any of + * - SELECT + * - INSERT + * - UPDATE + * - DELETE + * - SHOW + * - DESCRIBE + * - CREATE statement. + */ + await gapi.client.query.sql({ + hdrs: true, + sql: "sql", + typed: true, + }); + /** + * Executes a SQL statement which can be any of + * - SELECT + * - SHOW + * - DESCRIBE + */ + await gapi.client.query.sqlGet({ + hdrs: true, + sql: "sql", + typed: true, + }); + /** Deletes a style. */ + await gapi.client.style.delete({ + styleId: 1, + tableId: "tableId", + }); + /** Gets a specific style. */ + await gapi.client.style.get({ + styleId: 1, + tableId: "tableId", + }); + /** Adds a new style for the table. */ + await gapi.client.style.insert({ + tableId: "tableId", + }); + /** Retrieves a list of styles. */ + await gapi.client.style.list({ + maxResults: 1, + pageToken: "pageToken", + tableId: "tableId", + }); + /** Updates an existing style. This method supports patch semantics. */ + await gapi.client.style.patch({ + styleId: 1, + tableId: "tableId", + }); + /** Updates an existing style. */ + await gapi.client.style.update({ + styleId: 1, + tableId: "tableId", + }); + /** Copies a table. */ + await gapi.client.table.copy({ + copyPresentation: true, + tableId: "tableId", + }); + /** Deletes a table. */ + await gapi.client.table.delete({ + tableId: "tableId", + }); + /** Retrieves a specific table by its ID. */ + await gapi.client.table.get({ + tableId: "tableId", + }); + /** Imports more rows into a table. */ + await gapi.client.table.importRows({ + delimiter: "delimiter", + encoding: "encoding", + endLine: 3, + isStrict: true, + startLine: 5, + tableId: "tableId", + }); + /** Imports a new table. */ + await gapi.client.table.importTable({ + delimiter: "delimiter", + encoding: "encoding", + name: "name", + }); + /** Creates a new table. */ + await gapi.client.table.insert({ + }); + /** Retrieves a list of tables a user owns. */ + await gapi.client.table.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** + * Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch + * semantics. + */ + await gapi.client.table.patch({ + replaceViewDefinition: true, + tableId: "tableId", + }); + /** Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready. */ + await gapi.client.table.replaceRows({ + delimiter: "delimiter", + encoding: "encoding", + endLine: 3, + isStrict: true, + startLine: 5, + tableId: "tableId", + }); + /** Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. */ + await gapi.client.table.update({ + replaceViewDefinition: true, + tableId: "tableId", + }); + /** Deletes a specific task by its ID, unless that task has already started running. */ + await gapi.client.task.delete({ + tableId: "tableId", + taskId: "taskId", + }); + /** Retrieves a specific task by its ID. */ + await gapi.client.task.get({ + tableId: "tableId", + taskId: "taskId", + }); + /** Retrieves a list of tasks. */ + await gapi.client.task.list({ + maxResults: 1, + pageToken: "pageToken", + startIndex: 3, + tableId: "tableId", + }); + /** Deletes a template */ + await gapi.client.template.delete({ + tableId: "tableId", + templateId: 2, + }); + /** Retrieves a specific template by its id */ + await gapi.client.template.get({ + tableId: "tableId", + templateId: 2, + }); + /** Creates a new template for the table. */ + await gapi.client.template.insert({ + tableId: "tableId", + }); + /** Retrieves a list of templates. */ + await gapi.client.template.list({ + maxResults: 1, + pageToken: "pageToken", + tableId: "tableId", + }); + /** Updates an existing template. This method supports patch semantics. */ + await gapi.client.template.patch({ + tableId: "tableId", + templateId: 2, + }); + /** Updates an existing template */ + await gapi.client.template.update({ + tableId: "tableId", + templateId: 2, + }); + } +}); diff --git a/types/gapi.client.fusiontables/index.d.ts b/types/gapi.client.fusiontables/index.d.ts new file mode 100644 index 0000000000..95750c8f38 --- /dev/null +++ b/types/gapi.client.fusiontables/index.d.ts @@ -0,0 +1,1188 @@ +// Type definitions for Google Fusion Tables API v2 2.0 +// Project: https://developers.google.com/fusiontables +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/fusiontables/v2/rest + +/// + +declare namespace gapi.client { + /** Load Fusion Tables API v2 */ + function load(name: "fusiontables", version: "v2"): PromiseLike; + function load(name: "fusiontables", version: "v2", callback: () => any): void; + + const column: fusiontables.ColumnResource; + + const query: fusiontables.QueryResource; + + const style: fusiontables.StyleResource; + + const table: fusiontables.TableResource; + + const task: fusiontables.TaskResource; + + const template: fusiontables.TemplateResource; + + namespace fusiontables { + interface Bucket { + /** Color of line or the interior of a polygon in #RRGGBB format. */ + color?: string; + /** Icon name used for a point. */ + icon?: string; + /** Maximum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight. */ + max?: number; + /** Minimum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight. */ + min?: number; + /** Opacity of the color: 0.0 (transparent) to 1.0 (opaque). */ + opacity?: number; + /** Width of a line (in pixels). */ + weight?: number; + } + interface Column { + /** Identifier of the base column. If present, this column is derived from the specified base column. */ + baseColumn?: { + /** The id of the column in the base table from which this column is derived. */ + columnId?: number; + /** Offset to the entry in the list of base tables in the table definition. */ + tableIndex?: number; + }; + /** Identifier for the column. */ + columnId?: number; + /** JSON schema for interpreting JSON in this column. */ + columnJsonSchema?: string; + /** JSON object containing custom column properties. */ + columnPropertiesJson?: string; + /** Column description. */ + description?: string; + /** + * Format pattern. + * Acceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 DT_DATE_SHORTfor example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, 2008 8:30:45 PM + * DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08 DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30 + * DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008 DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor + * example 24/12/2008 20:30 DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24 + * DT_ISO_YEAR_MONTH_DAY_TIMEfor example 2008-12-24 20:30:45 DT_MONTH_DAY_4_DIGIT_YEARfor example 12/24/2008 DT_TIME_LONGfor example 8:30:45 PM UTC-6 + * DT_TIME_MEDIUMfor example 8:30:45 PM DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor example 2008 HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does + * not match the data type NONENo formatting (default) NUMBER_CURRENCYfor example $1234.56 NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor example + * 1235 NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor example 123,456% NUMBER_SCIENTIFICfor example 1E3 STRING_EIGHT_LINE_IMAGEDisplays + * thumbnail images as tall as eight lines of text STRING_FOUR_LINE_IMAGEDisplays thumbnail images as tall as four lines of text STRING_JSON_TEXTAllows + * editing of text as JSON in UI STRING_JSON_LISTAllows editing of text as a JSON list in UI STRING_LINKTreats cell as a link (must start with http:// or + * https://) STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as one line of text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail + */ + formatPattern?: string; + /** + * Column graph predicate. + * Used to map table to graph data model (subject,predicate,object) + * See W3C Graph-based Data Model. + */ + graphPredicate?: string; + /** The kind of item this is. For a column, this is always fusiontables#column. */ + kind?: string; + /** Name of the column. */ + name?: string; + /** Type of the column. */ + type?: string; + /** List of valid values used to validate data and supply a drop-down list of values in the web application. */ + validValues?: string[]; + /** If true, data entered via the web application is validated. */ + validateData?: boolean; + } + interface ColumnList { + /** List of all requested columns. */ + items?: Column[]; + /** The kind of item this is. For a column list, this is always fusiontables#columnList. */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + /** Total number of columns for the table. */ + totalItems?: number; + } + interface Geometry { + /** The list of geometries in this geometry collection. */ + geometries?: any[]; + geometry?: any; + /** Type: A collection of geometries. */ + type?: string; + } + interface Import { + /** The kind of item this is. For an import, this is always fusiontables#import. */ + kind?: string; + /** The number of rows received from the import request. */ + numRowsReceived?: string; + } + interface Line { + /** The coordinates that define the line. */ + coordinates?: number[][]; + /** Type: A line geometry. */ + type?: string; + } + interface LineStyle { + /** Color of the line in #RRGGBB format. */ + strokeColor?: string; + /** Column-value, gradient or buckets styler that is used to determine the line color and opacity. */ + strokeColorStyler?: StyleFunction; + /** Opacity of the line : 0.0 (transparent) to 1.0 (opaque). */ + strokeOpacity?: number; + /** Width of the line in pixels. */ + strokeWeight?: number; + /** Column-value or bucket styler that is used to determine the width of the line. */ + strokeWeightStyler?: StyleFunction; + } + interface Point { + /** The coordinates that define the point. */ + coordinates?: number[]; + /** Point: A point geometry. */ + type?: string; + } + interface PointStyle { + /** Name of the icon. Use values defined in http://www.google.com/fusiontables/DataSource?dsrcid=308519 */ + iconName?: string; + /** Column or a bucket value from which the icon name is to be determined. */ + iconStyler?: StyleFunction; + } + interface Polygon { + /** The coordinates that define the polygon. */ + coordinates?: number[][][]; + /** Type: A polygon geometry. */ + type?: string; + } + interface PolygonStyle { + /** Color of the interior of the polygon in #RRGGBB format. */ + fillColor?: string; + /** Column-value, gradient, or bucket styler that is used to determine the interior color and opacity of the polygon. */ + fillColorStyler?: StyleFunction; + /** Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque). */ + fillOpacity?: number; + /** Color of the polygon border in #RRGGBB format. */ + strokeColor?: string; + /** Column-value, gradient or buckets styler that is used to determine the border color and opacity. */ + strokeColorStyler?: StyleFunction; + /** Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). */ + strokeOpacity?: number; + /** Width of the polyon border in pixels. */ + strokeWeight?: number; + /** Column-value or bucket styler that is used to determine the width of the polygon border. */ + strokeWeightStyler?: StyleFunction; + } + interface Sqlresponse { + /** Columns in the table. */ + columns?: string[]; + /** The kind of item this is. For responses to SQL queries, this is always fusiontables#sqlresponse. */ + kind?: string; + /** + * The rows in the table. For each cell we print out whatever cell value (e.g., numeric, string) exists. Thus it is important that each cell contains only + * one value. + */ + rows?: any[][]; + } + interface StyleFunction { + /** Bucket function that assigns a style based on the range a column value falls into. */ + buckets?: Bucket[]; + /** Name of the column whose value is used in the style. */ + columnName?: string; + /** Gradient function that interpolates a range of colors based on column value. */ + gradient?: { + /** Array with two or more colors. */ + colors?: Array<{ + /** Color in #RRGGBB format. */ + color?: string; + /** Opacity of the color: 0.0 (transparent) to 1.0 (opaque). */ + opacity?: number; + }>; + /** Higher-end of the interpolation range: rows with this value will be assigned to colors[n-1]. */ + max?: number; + /** Lower-end of the interpolation range: rows with this value will be assigned to colors[0]. */ + min?: number; + }; + /** + * Stylers can be one of three kinds: "fusiontables#fromColumn if the column value is to be used as is, i.e., the column values can have colors in + * #RRGGBBAA format or integer line widths or icon names; fusiontables#gradient if the styling of the row is to be based on applying the gradient function + * on the column value; or fusiontables#buckets if the styling is to based on the bucket into which the the column value falls. + */ + kind?: string; + } + interface StyleSetting { + /** + * The kind of item this is. A StyleSetting contains the style definitions for points, lines, and polygons in a table. Since a table can have any one or + * all of them, a style definition can have point, line and polygon style definitions. + */ + kind?: string; + /** Style definition for points in the table. */ + markerOptions?: PointStyle; + /** Optional name for the style setting. */ + name?: string; + /** Style definition for polygons in the table. */ + polygonOptions?: PolygonStyle; + /** Style definition for lines in the table. */ + polylineOptions?: LineStyle; + /** Identifier for the style setting (unique only within tables). */ + styleId?: number; + /** Identifier for the table. */ + tableId?: string; + } + interface StyleSettingList { + /** All requested style settings. */ + items?: StyleSetting[]; + /** The kind of item this is. For a style list, this is always fusiontables#styleSettingList . */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more styles left. */ + nextPageToken?: string; + /** Total number of styles for the table. */ + totalItems?: number; + } + interface Table { + /** Attribution assigned to the table. */ + attribution?: string; + /** Optional link for attribution. */ + attributionLink?: string; + /** Base table identifier if this table is a view or merged table. */ + baseTableIds?: string[]; + /** Default JSON schema for validating all JSON column properties. */ + columnPropertiesJsonSchema?: string; + /** Columns in the table. */ + columns?: Column[]; + /** Description assigned to the table. */ + description?: string; + /** Variable for whether table is exportable. */ + isExportable?: boolean; + /** The kind of item this is. For a table, this is always fusiontables#table. */ + kind?: string; + /** Name assigned to a table. */ + name?: string; + /** SQL that encodes the table definition for derived tables. */ + sql?: string; + /** Encrypted unique alphanumeric identifier for the table. */ + tableId?: string; + /** JSON object containing custom table properties. */ + tablePropertiesJson?: string; + /** JSON schema for validating the JSON table properties. */ + tablePropertiesJsonSchema?: string; + } + interface TableList { + /** List of all requested tables. */ + items?: Table[]; + /** The kind of item this is. For table list, this is always fusiontables#tableList. */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + } + interface Task { + /** Type of the resource. This is always "fusiontables#task". */ + kind?: string; + /** Task percentage completion. */ + progress?: string; + /** false while the table is busy with some other task. true if this background task is currently running. */ + started?: boolean; + /** Identifier for the task. */ + taskId?: string; + /** Type of background task. */ + type?: string; + } + interface TaskList { + /** List of all requested tasks. */ + items?: Task[]; + /** Type of the resource. This is always "fusiontables#taskList". */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + /** Total number of tasks for the table. */ + totalItems?: number; + } + interface Template { + /** List of columns from which the template is to be automatically constructed. Only one of body or automaticColumns can be specified. */ + automaticColumnNames?: string[]; + /** + * Body of the template. It contains HTML with {column_name} to insert values from a particular column. The body is sanitized to remove certain tags, + * e.g., script. Only one of body or automaticColumns can be specified. + */ + body?: string; + /** The kind of item this is. For a template, this is always fusiontables#template. */ + kind?: string; + /** Optional name assigned to a template. */ + name?: string; + /** Identifier for the table for which the template is defined. */ + tableId?: string; + /** Identifier for the template, unique within the context of a particular table. */ + templateId?: number; + } + interface TemplateList { + /** List of all requested templates. */ + items?: Template[]; + /** The kind of item this is. For a template list, this is always fusiontables#templateList . */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + /** Total number of templates for the table. */ + totalItems?: number; + } + interface ColumnResource { + /** Deletes the specified column. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column being deleted. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table from which the column is being deleted. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific column by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column that is being requested. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table to which the column belongs. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds a new column to the table. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which a new column is being added. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of columns. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of columns to return. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table whose columns are being listed. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the name or type of an existing column. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column that is being updated. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which the column is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the name or type of an existing column. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column that is being updated. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which the column is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface QueryResource { + /** + * Executes a Fusion Tables SQL statement, which can be any of + * - SELECT + * - INSERT + * - UPDATE + * - DELETE + * - SHOW + * - DESCRIBE + * - CREATE statement. + */ + sql(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether column names are included in the first row. Default is true. */ + hdrs?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A Fusion Tables SQL statement, which can be any of + * - SELECT + * - INSERT + * - UPDATE + * - DELETE + * - SHOW + * - DESCRIBE + * - CREATE + */ + sql: string; + /** Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. */ + typed?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Executes a SQL statement which can be any of + * - SELECT + * - SHOW + * - DESCRIBE + */ + sqlGet(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether column names are included (in the first row). Default is true. */ + hdrs?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A SQL statement which can be any of + * - SELECT + * - SHOW + * - DESCRIBE + */ + sql: string; + /** Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. */ + typed?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface StyleResource { + /** Deletes a style. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (within a table) for the style being deleted */ + styleId: number; + /** Table from which the style is being deleted */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a specific style. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (integer) for a specific style in a table */ + styleId: number; + /** Table to which the requested style belongs */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds a new style for the table. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which a new style is being added */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of styles. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of styles to return. Optional. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table whose styles are being listed */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing style. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (within a table) for the style being updated. */ + styleId: number; + /** Table whose style is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing style. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (within a table) for the style being updated. */ + styleId: number; + /** Table whose style is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TableResource { + /** Copies a table. */ + copy(request: { + /** Data format for the response. */ + alt?: string; + /** Whether to also copy tabs, styles, and templates. Default is false. */ + copyPresentation?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the table that is being copied. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a table. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the table to be deleted. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific table by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier for the table being requested. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Imports more rows into a table. */ + importRows(request: { + /** Data format for the response. */ + alt?: string; + /** The delimiter used to separate cell values. This can only consist of a single character. Default is ,. */ + delimiter?: string; + /** The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. */ + encoding?: string; + /** + * The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of + * the file; the imported content will exclude the last endLine lines. + */ + endLine?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether the imported CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default + * is true. + */ + isStrict?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The index of the first line from which to start importing, inclusive. Default is 0. */ + startLine?: number; + /** The table into which new rows are being imported. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Imports a new table. */ + importTable(request: { + /** Data format for the response. */ + alt?: string; + /** The delimiter used to separate cell values. This can only consist of a single character. Default is ,. */ + delimiter?: string; + /** The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. */ + encoding?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name to be assigned to the new table. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Creates a new table. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Retrieves a list of tables a user owns. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of tables to return. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch + * semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. */ + replaceViewDefinition?: boolean; + /** ID of the table that is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + /** Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready. */ + replaceRows(request: { + /** Data format for the response. */ + alt?: string; + /** The delimiter used to separate cell values. This can only consist of a single character. Default is ,. */ + delimiter?: string; + /** The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. */ + encoding?: string; + /** + * The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of + * the file; the imported content will exclude the last endLine lines. + */ + endLine?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether the imported CSV must have the same number of column values for each row. If true, throws an exception if the CSV does not have the same number + * of columns. If false, rows with fewer column values will be padded with empty values. Default is true. + */ + isStrict?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The index of the first line from which to start importing, inclusive. Default is 0. */ + startLine?: number; + /** Table whose rows will be replaced. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. */ + replaceViewDefinition?: boolean; + /** ID of the table that is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
; + } + interface TaskResource { + /** Deletes a specific task by its ID, unless that task has already started running. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table from which the task is being deleted. */ + tableId: string; + /** The identifier of the task to delete. */ + taskId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific task by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table to which the task belongs. */ + tableId: string; + /** The identifier of the task to get. */ + taskId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of tasks. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of tasks to return. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Index of the first result returned in the current page. */ + startIndex?: number; + /** Table whose tasks are being listed. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TemplateResource { + /** Deletes a template */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table from which the template is being deleted */ + tableId: string; + /** Identifier for the template which is being deleted */ + templateId: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific template by its id */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table to which the template belongs */ + tableId: string; + /** Identifier for the template that is being requested */ + templateId: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request